Extended colorpicker to read pictures also

Some minor refactoring on photo capturing script, also.
This commit is contained in:
2018-06-01 20:11:56 +02:00
parent ec90e8fda8
commit cc8589d750
3 changed files with 39 additions and 45 deletions

View File

@@ -1,6 +1,9 @@
import numpy as np
import cv2
from naoqi import ALProxy
try:
from naoqi import ALProxy
except:
ALProxy = None
class NaoImageReader(object):
@@ -54,3 +57,16 @@ class VideoReader(object):
def close(self):
self.cap.release()
class PictureReader(object):
"Dummy class for maybe convenience."
def __init__(self, filename):
self.frame = cv2.imread(filename)
def get_frame(self):
return self.frame.copy()
def close(self):
pass