diff options
Diffstat (limited to 'test-cli/test')
-rw-r--r-- | test-cli/test/helpers/camara.py | 5 | ||||
-rwxr-xr-x | test-cli/test/scripts/v4l-cam.sh | 14 | ||||
-rw-r--r-- | test-cli/test/tests/qvideo.py | 25 |
3 files changed, 15 insertions, 29 deletions
diff --git a/test-cli/test/helpers/camara.py b/test-cli/test/helpers/camara.py index bcb1df7..b23df74 100644 --- a/test-cli/test/helpers/camara.py +++ b/test-cli/test/helpers/camara.py @@ -17,7 +17,7 @@ class Camara(object): self.__device_name = device self.__w = width self.__h = height - self.__setupScriptPath = setup_script_path; + self.__setupScriptPath = setup_script_path def Close(self): if self.__device is not None: @@ -64,8 +64,7 @@ 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) - sh.bash(self.__setupScriptPath + '/test/scripts/v4l-cam.sh') - # sh.bash("../scripts/v4l-cam.sh") + sh.bash(self.__setupScriptPath) def __setCamVar(self, key, val): valold = cv2.VideoCapture.get(self.__device, key) diff --git a/test-cli/test/scripts/v4l-cam.sh b/test-cli/test/scripts/v4l-cam.sh deleted file mode 100755 index 18da1c0..0000000 --- a/test-cli/test/scripts/v4l-cam.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -v4l2-ctl -d /dev/video0 -c exposure_auto=3 -v4l2-ctl -d /dev/video0 -c brightness=0 -v4l2-ctl -d /dev/video0 -c contrast=20 -v4l2-ctl -d /dev/video0 -c saturation=55 -v4l2-ctl -d /dev/video0 -c hue=0 -v4l2-ctl -d /dev/video0 -c white_balance_temperature_auto=0 -v4l2-ctl -d /dev/video0 -c gamma=100 -v4l2-ctl -d /dev/video0 -c power_line_frequency=1 -v4l2-ctl -d /dev/video0 -c white_balance_temperature=4500 -v4l2-ctl -d /dev/video0 -c sharpness=2 -v4l2-ctl -d /dev/video0 -c backlight_compensation=2 -# v4l2-ctl -d /dev/video0 -c exposure_absolute=166
\ No newline at end of file diff --git a/test-cli/test/tests/qvideo.py b/test-cli/test/tests/qvideo.py index b4133b6..225940b 100644 --- a/test-cli/test/tests/qvideo.py +++ b/test-cli/test/tests/qvideo.py @@ -16,17 +16,20 @@ class Qvideo(unittest.TestCase): self.__xmlObj = varlist["xml"] self.__QVideoName = varlist.get('name', 'qvideo') self.__resultlist = [] - self.__Camara = Camara(setup_script_path=varlist['testPath']) - self.__SDL2_Test = SDL2_Test() - self.__SDL2_Test.Clear() + self.__w = int(varlist.get('capture_size_w', self.__xmlObj.getKeyVal(self.__QVideoName, "capture_size_w", 1280))) + self.__h = int(varlist.get('capture_size_h', self.__xmlObj.getKeyVal(self.__QVideoName, "capture_size_h", 720))) + self.__discard_frames_Count = int(varlist.get('capture_discardframes',self.__xmlObj.getKeyVal(self.__QVideoName, "capture_discardframes", 3))) + self.__frame_mean = int(varlist.get('capture_framemean', self.__xmlObj.getKeyVal(self.__QVideoName, "capture_framemean", 3))) + self.__max_failed = int(varlist.get('capture_maxfailed', self.__xmlObj.getKeyVal(self.__QVideoName, "capture_maxfailed", 1))) + self.__cam_setupscript = varlist.get('cam_setupfile', self.__xmlObj.getKeyVal(self.__QVideoName, "cam_setupfile", + "/root/hwtest-files/board/scripts/v4l-cam.sh")) + self.__sdl_display = varlist.get('sdl_display', self.__xmlObj.getKeyVal(self.__QVideoName, "sdl_display", ":0")) + self.__sdl_driver = varlist.get('sdl_driver', self.__xmlObj.getKeyVal(self.__QVideoName, "sdl_driver", "x11")) + self.__camdevice = varlist.get('camdevice', self.__xmlObj.getKeyVal(self.__QVideoName, "camdevice", "video0")) - def define_capture(self): - self.__Camara.setSize( - int(self.params.get('capture_size_w', self.__xmlObj.getKeyVal(self.__QVideoName, "capture_size_w", 1280))), - int(self.params.get('capture_size_h', self.__xmlObj.getKeyVal(self.__QVideoName, "capture_size_h", 720)))) - self.__discard_frames_Count = int(self.params.get('capture_discardframes', self.__xmlObj.getKeyVal(self.__QVideoName, "capture_discardframes", 3))) - self.__frame_mean = int(self.params.get('capture_framemean', self.__xmlObj.getKeyVal(self.__QVideoName, "capture_framemean", 3))) - self.__max_failed = int(self.params.get('capture_maxfailed', self.__xmlObj.getKeyVal(self.__QVideoName, "capture_maxfailed", 1))) + self.__Camara = Camara(setup_script_path=self.__cam_setupscript, device=self.__camdevice, width=self.__w, height=self.__h) + self.__SDL2_Test = SDL2_Test(driver=self.__sdl_driver, display=self.__sdl_display, w=self.__w, h=self.__h) + self.__SDL2_Test.Clear() def __drop_frames(self, frame_count): count = frame_count @@ -99,8 +102,6 @@ class Qvideo(unittest.TestCase): def execute(self): self.__resultlist = [] - # set image size - self.define_capture() # Open camara if not self.__Camara.Open(): self.fail('Error: USB camera not found') |