On a side note:
I also get the same error when using the built in ipl_to_pil
function...
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "C:\Documents and Settings\jack\Desktop\RT3000\rtrack2.py",
line 25, in analyze_video
newframe = ipl_to_pil(threshframe)
File "C:\Python26\lib\site-packages\ctypes_opencv\interfaces.py",
line 70, in ipl_to_pil
'raw', "BGR", im_ipl.widthStep
File "C:\Python26\lib\site-packages\PIL\Image.py", line 1744, in
fromstring
im.fromstring(data, decoder_name, args)
File "C:\Python26\lib\site-packages\PIL\Image.py", line 575, in
fromstring
raise ValueError("not enough image data")
ValueError: not enough image data
And Here is my Code up to that point:
def analyze_video(stuffs):
#cvNamedWindow( filename, CV_WINDOW_AUTOSIZE)
capture = cvCaptureFromAVI (filename)
num_frames = cvGetCaptureProperty(capture,
CV_CAP_PROP_FRAME_COUNT)
print "NUMBER OF FRAMES =", num_frames
frame = cvQueryFrame(capture)
print frame
bwframe = cvCreateImage(cvGetSize(frame), IPL_DEPTH_8U ,1)
threshframe = cvCreateImage(cvGetSize(frame), IPL_DEPTH_8U ,1)
cvConvertImage(frame, bwframe, 1)
cvThreshold(bwframe, threshframe, 70, 256, CV_THRESH_BINARY)
print "Enter NEW FRAME"
#cvShowImage( filename, threshframe )
newframe = ipl_to_pil(threshframe)