Image.adaptiveScale() with PARAMETER of "fit=false" dose not work

asked 2013-06-14 11:43:16 -0500

anonymous user

Anonymous

updated 2013-06-14 13:14:51 -0500

jayrambhia gravatar image

I tried this code on my Ubuntu12.04 LTS box:

from SimpleCV import Image
import time
img = Image('lenna')
bigimg = img.adaptiveScale((img.width + 50, img.height + 20), fit = False)
bigimg.show()
time.sleep(2)

Please notice that I set "fit" to "False", and then I save it as "4.7.py" and tried this in a Terminal window:

$ python 4.7.py 

ERROR: 

Traceback (most recent call last):

  File "4.7.py", line 6, in <module>

    bigimg = img.adaptiveScale((img.width + 50, img.height + 20), fit = False)

  File "/usr/lib/pymodules/python2.7/SimpleCV/ImageClass.py", line 6026, in adaptiveScale

    cv.SetImageROI(retVal,(x,y,targetw,targeth))

UnboundLocalError: local variable 'x' referenced before assignment

I opened ImageClass.py, and look at the code piece from line 5992 to line 6026: image description

I guess it would run line 5997 and line 5998, and then run directly line 6026, so both "x" and "y" are not assigned before being referenced here.

I tried to modify this piece of code, but finally failed. Does anybody can help me?

edit retag flag offensive close merge delete

Comments

jayrambhia gravatar imagejayrambhia ( 2013-06-14 13:18:01 -0500 )edit