2 This script will test highgui's image loading functionality
3 for a given parameter of a file extension.
7 # needed for sys.exit(int) and .works file handling
13 #import the necessary things for OpenCV
19 TESTNAME = "cvLoadImage"
22 # path to imagefiles we need
23 PREFIX=os.path.join(os.environ["srcdir"],"../../opencv_extra/testdata/python/images/baboon_256x256")
26 # this functions tries to open an imagefile
27 # using the filename PREFIX.EXTENSION and returns True/False
30 def image_ok( EXTENSION ):
32 # check requirements and delete old .works file
33 WORKSNAME = TESTNAME+'.'+EXTENSION
35 if not works.check_files( REQUIRED, WORKSNAME ):
36 print "worksfile "+WORKSNAME+" not found."
39 image = cvLoadImage(PREFIX+'.'+EXTENSION)
44 works.set_file( TESTNAME+EXTENSION )