Ask Your Question
0

Error with running segmentation related to cv.Convert

asked 2013-01-04 22:37:54 -0500

cipher gravatar image

updated 2013-01-04 22:39:05 -0500

I am working on creating a motion tracking system it was working fine but i observed that when there was too much commotion in the video, i got this error. I am using running segmentation, I have seen some examples that utilize the same. Once I grab the blobs, I process them. I am wondering what am i doing wrong. Here's the error:

WARNING: Holy Heck! You tried to make an image really big or impossibly small. I can't scale that
ERROR: 
Traceback (most recent call last):
  File "C:\MotionTrack\TrackSubversioned\MotionTrack.py", line 233, in <module>
    t.run()
  File "C:\MotionTrack\TrackSubversioned\MotionTrack.py", line 169, in run
    rs.addImage(color_image)
  File "C:\Python27\lib\site-packages\SimpleCV\Segmentation\RunningSegmentation.py", line 54, in addImage
    cv.AbsDiff(self.mModelImg.getBitmap(),img.getFPMatrix(),self.mDiffImg.getBitmap())
  File "C:\Python27\lib\site-packages\SimpleCV\ImageClass.py", line 1584, in getFPMatrix
    cv.Convert(self.getBitmap(),retVal)
TypeError: CvArr argument 'src' must be IplImage, CvMat or CvMatND. Use fromarray() to convert numpy arrays to CvMat or cvMatND
edit retag flag offensive close merge delete

Comments

As the warning suggests your image dimensions are really low or off the charts. But there could be some other error. If you could give a link to your code, someone might be able to debug it.

jayrambhia gravatar imagejayrambhia ( 2013-01-05 00:37:05 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-01-29 19:03:47 -0500

cipher gravatar image

I found out that when the video ends , the next image i get from

cam.getImage()

is of zero size. So currently I set display.done to True and exit the script:

            try:
                rs.addImage(color_image)
            except:
                rsError += 1
                print "Running Segmentation Error:", rsError, "Times."
                if rsError <50:
                    continue
                else:
                    print "max error level reached, probably video ended here!, quitting"                    
                    self.disp.done = True
                    continue

I am wondering if there is a way in SimpleCV to check if video stream being processed has ended and to exit in that event?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-01-04 22:37:54 -0500

Seen: 615 times

Last updated: Jan 29 '13