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
15 from python.highgui import *
16 from python.cv import *
20 TESTNAME = "cvLoadImage"
23 # path to imagefiles we need
24 PREFIX=os.environ["top_srcdir"]+"/tests/python/testdata/images/baboon_256x256"
27 # this functions tries to open an imagefile
28 # using the filename PREFIX.EXTENSION and returns True/False
31 def image_ok( EXTENSION ):
33 # check requirements and delete old .works file
34 WORKSNAME = TESTNAME+'.'+EXTENSION
36 if not works.check_files( REQUIRED, WORKSNAME ):
37 print "worksfile "+WORKSNAME+" not found."
40 image = cvLoadImage(PREFIX+'.'+EXTENSION)
45 works.set_file( TESTNAME+EXTENSION )