summaryrefslogtreecommitdiff
path: root/test-cli/test/helpers/camara.py
diff options
context:
space:
mode:
Diffstat (limited to 'test-cli/test/helpers/camara.py')
-rw-r--r--test-cli/test/helpers/camara.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/test-cli/test/helpers/camara.py b/test-cli/test/helpers/camara.py
index 9b2829c..afe8112 100644
--- a/test-cli/test/helpers/camara.py
+++ b/test-cli/test/helpers/camara.py
@@ -1,8 +1,7 @@
import cv2
-from test.helpers.syscmd import SysCommand
+import sh
class Camara(object):
- __parent = None
__device_name = None
__device = None
__w = 1280
@@ -13,8 +12,7 @@ class Camara(object):
__hue = 0.0
__exposure = 166
- def __init__(self, parent, device="video0", width=1280, height=720):
- self.__parent = parent
+ def __init__(self, device="video0", width=1280, height=720):
self.__device_name = device
self.__w = width
self.__h = height
@@ -64,21 +62,13 @@ class Camara(object):
def __configure(self):
self.__w = self.__setCamVar(cv2.CAP_PROP_FRAME_WIDTH, self.__w)
self.__h = self.__setCamVar(cv2.CAP_PROP_FRAME_HEIGHT, self.__h)
- cam_setup = SysCommand('v4lsetup', '{}/scripts/v4l-cam.sh'.format(self.__parent.getAppPath()))
- cam_setup.execute()
-
- #self.__contrast = self.__setCamVar(cv2.CAP_PROP_CONTRAST, self.__contrast)
- #self.__brightness = self.__setCamVar(cv2.CAP_PROP_BRIGHTNESS, self.__brightness)
- #self.__saturation = self.__setCamVar(cv2.CAP_PROP_SATURATION, self.__saturation)
- #self.__hue = self.__setCamVar(cv2.CAP_PROP_HUE, self.__hue)
- #self.__exposure = self.__setCamVar(cv2.CAP_PROP_EXPOSURE, self.__exposure)
-
+ sh.bash("../scripts/v4l-cam.sh")
def __setCamVar(self, key, val):
valold = cv2.VideoCapture.get(self.__device, key)
if valold != val:
cv2.VideoCapture.set(self.__device, key, val)
- t = cv2.VideoCapture.get(self.__device, key)
+ t = cv2.VideoCapture.get(self.__device, key)
return t
return val