Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRelative vs. Absolute Path #534
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
ionelmc
commented
Jun 3, 2013
|
Shouldn't it raise some |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
jayrambhia
Jun 3, 2013
Contributor
What version are you using?
on doing something like this
img = Image("some_image.jpg") # I don't have some_image.jpg in my directory.I'm getting this error.
SimpleCV:3> img=Image("some_image.jpg")
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
/home/jay/SimpleCV/SimpleCV/Shell/Shell.pyc in <module>()
----> 1 img=Image("some_image.jpg")
/home/jay/SimpleCV/SimpleCV/ImageClass.pyc in __init__(self, source, camera, colorSpace, verbose, sample, cv2image, webp)
1061 self._bitmap = cv.LoadImage(self.filename, iscolor=cv.CV_LOAD_IMAGE_COLOR)
1062 except:
-> 1063 self._pil = pil.open(self.filename).convert("RGB")
1064 self._bitmap = cv.CreateImageHeader(self._pil.size, cv.IPL_DEPTH_8U, 3)
1065 cv.SetData(self._bitmap, self._pil.tostring())
/usr/lib/python2.7/dist-packages/PIL/Image.pyc in open(fp, mode)
1950 import __builtin__
1951 filename = fp
-> 1952 fp = __builtin__.open(fp, "rb")
1953 else:
1954 filename = ""
IOError: [Errno 2] No such file or directory: 'some_image.jpg'|
What version are you using? img = Image("some_image.jpg") # I don't have some_image.jpg in my directory.I'm getting this error. SimpleCV:3> img=Image("some_image.jpg")
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
/home/jay/SimpleCV/SimpleCV/Shell/Shell.pyc in <module>()
----> 1 img=Image("some_image.jpg")
/home/jay/SimpleCV/SimpleCV/ImageClass.pyc in __init__(self, source, camera, colorSpace, verbose, sample, cv2image, webp)
1061 self._bitmap = cv.LoadImage(self.filename, iscolor=cv.CV_LOAD_IMAGE_COLOR)
1062 except:
-> 1063 self._pil = pil.open(self.filename).convert("RGB")
1064 self._bitmap = cv.CreateImageHeader(self._pil.size, cv.IPL_DEPTH_8U, 3)
1065 cv.SetData(self._bitmap, self._pil.tostring())
/usr/lib/python2.7/dist-packages/PIL/Image.pyc in open(fp, mode)
1950 import __builtin__
1951 filename = fp
-> 1952 fp = __builtin__.open(fp, "rb")
1953 else:
1954 filename = ""
IOError: [Errno 2] No such file or directory: 'some_image.jpg' |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
predmach
Jun 3, 2013
You are right, it turned out to be that the image file name in the constructor was a Unicode string. Once encoded as ascii, the class performed properly. this is actually issue: #159
predmach
commented
Jun 3, 2013
|
You are right, it turned out to be that the image file name in the constructor was a Unicode string. Once encoded as ascii, the class performed properly. this is actually issue: #159 |
predmach
closed this
Jun 3, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
predmach commentedJun 3, 2013
TypeError: CvArr argument 'src' must be IplImage, CvMat, or CvMatND. Use fromarray() to convert numpy arrays to CvMat or cvMatND.
Received this error when executing SimpleCV [[img=Image('test.jpg'); img.save('test2.jpg')]] from a Celery task. It is possible that the current working directory of the celeryd is not the same as the directory, which would have made the image object invalid. The error indicates that the argument is the wrong type, not that the image wasn't loaded.
By changing the relative path to an absolute path, the error was resolved. (credit: ionelmc)
I would expect an error that would indicate that the image did not load.