image class broken with new packages under Windows

Showing 1-4 of 4 messages
image class broken with new packages under Windows Zsolt Ero 3/29/12 10:52 AM
There are some posts on the Q&A site about not-working cameras, and one of them ( has the same error I've just come up with.

It has nothing to do with camera, it is something with the newer packages <> image class incompatibility on windows. I've just done a new install, this time with ActivePython and downloaded all the latest packages, getting Pygame from the official website (the others from ActivePython's pypm).

So what is happening is that even a simple or Display() is giving the error.

Here is a full error-log:

In [3]: from SimpleCV import *

In [6]: img = Image("stache.png")

In [7]:
\SimpleCV\ UserWarning: Couldn't load Image
  warnings.warn("Couldn't load Image")
TypeError                                 Traceback (most recent call last)
in <module>()
----> 1

\SimpleCV\ImageClass.pyc in show(self, type)
   3039         elif (type == 'window'):
   3040           from SimpleCV.Display import Display
-> 3041           d = Display(self.size())
   3043           return d

\SimpleCV\Display.pyc in __init__(self, resolution, flags, title, displaytype, h
    136         if not displaytype == 'notebook':
    137             self.screen = pg.display.set_mode(resolution, flags)
--> 138         scvLogo = SimpleCV.Image("simplecv").scale(32,32)
    139         pg.display.set_icon(scvLogo.getPGSurface())
    140         if flags != pg.FULLSCREEN and flags != pg.NOFRAME:

\SimpleCV\ImageClass.pyc in scale(self, width, height)
   1278         scaled_bitmap = cv.CreateImage((w, h), 8, 3)
-> 1279         cv.Resize(self.getBitmap(), scaled_bitmap)
   1280         return Image(scaled_bitmap, colorSpace=self._colorSpace)

TypeError: CvArr argument 'src' must be IplImage, CvMat or CvMatND. Use fromarra
y() to convert numpy arrays to CvMat or cvMatND

In [8]:
Re: image class broken with new packages under Windows Zsolt Ero 3/29/12 10:53 AM
I forgot, SimpleCV is from git, as of now.
Re: [simplecv] Re: image class broken with new packages under Windows Krishna Mohan 3/31/12 5:19 PM
After Importing OpenCV, check the value of  ' PIL_ENABLED '  (Without the quotes of course).

If you are getting False value, then you dont have PIL installed, If you installed SimpleCV using the windows installer, this may have been blocked if you are behind a firewall (your university maybe? )

The fix is very simple though , you can install PIL in one of the following methods

easiest method would probably be
 Open cmd.exe
 run the following commands
 easy_install PIL

If this does not work, then you can just install it from their website

The problem here is not due to error in reading the image, but there is a small logo of simplecv trying to load on the window, which is loaded through PIL. This is a small bug that needs to be fixed, (and also an easy fix bug)..

Tell me if this works
Re: [simplecv] Re: image class broken with new packages under Windows Zsolt Ero 3/31/12 6:35 PM
Hi Krishna,

Thanks, it works!!! With ActivePython I could just install it using
"pypm install pil" and it worked!