3 This script will test highgui's cvGetCaptureProperty() function
6 # name of this test and it's requirements
7 TESTNAME = "cvGetCaptureProperty"
8 REQUIRED = ["cvCreateFileCapture"]
11 # needed for sys.exit(int) and .works file handling
16 # path to imagefiles we need
17 PREFIX=os.path.join(os.environ["srcdir"],"../../opencv_extra/testdata/python/videos/")
19 # check requirements and delete old flag file, if it exists
20 if not works.check_files(REQUIRED,TESTNAME):
23 # import the necessary things for OpenCV
28 # create a video reader using the tiny video 'vd_uncompressed.avi'
29 video = cvCreateFileCapture(PREFIX+"uncompressed.avi")
31 # retrieve video dimensions and compare with known values
32 print str(cvGetCaptureProperty( video, CV_CAP_PROP_FOURCC ))
34 print "Checking image dimensions"
35 if cvGetCaptureProperty( video, CV_CAP_PROP_FRAME_WIDTH ) != 720:
37 if cvGetCaptureProperty( video, CV_CAP_PROP_FRAME_HEIGHT ) != 576:
41 print "Checking framerate"
42 if cvGetCaptureProperty( video, CV_CAP_PROP_FPS ) != 25:
46 print str(cvGetCaptureProperty( video, CV_CAP_PROP_FOURCC ) )
48 # ATTENTION: We do not release the video reader, window or any image.
49 # This is bad manners, but Python and OpenCV don't care...
51 # create flag file for sollowing tests
52 works.set_file(TESTNAME)