summaryrefslogtreecommitdiff
path: root/test-cli/test/helpers/camara.py
diff options
context:
space:
mode:
authorHector Fernandez <hector@iatec.biz>2020-09-29 13:27:32 +0200
committerHector Fernandez <hector@iatec.biz>2020-09-30 14:30:05 +0200
commitca73fcc336edc23db5750e93b6e1014d32a54ea5 (patch)
tree890e4786f1c241a79b44a99dd8447062572cbc62 /test-cli/test/helpers/camara.py
parentd8d4684c24a7c34334bb0b1d74dead69282e8c46 (diff)
downloadboard-ca73fcc336edc23db5750e93b6e1014d32a54ea5.zip
board-ca73fcc336edc23db5750e93b6e1014d32a54ea5.tar.gz
board-ca73fcc336edc23db5750e93b6e1014d32a54ea5.tar.bz2
Added new test to validate video output with a webcam.
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