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

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

anonymous user


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)

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

$ python 


Traceback (most recent call last):

  File "", line 6, in <module>

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

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


UnboundLocalError: local variable 'x' referenced before assignment

I opened, 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


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