Quote:
Originally Posted by nige777
Thanks you very much that worked perfectly.
Now I, like the original poster, just need to sort a method for converting frame buffer images to IPLImage!!
Came across this -
http://www.depthfirstsearch.net/blog...cv-and-python/
- which seems to address this prob however I am unable to utilize this at the moment due to my severe lack of C or C++ know-how. Any windows/C++ wizards out there who could help?
|
I am still trying to find a better way to do the conversion myself, but in the meantime I was able to get something to "work" using the actual screen capture and file save capability in Vizard.
I used the viztask schedule capability and basically saved each image to a bitmap and then loaded the bitmaps into the squares example. It is slow, only average 2 -3 frames per second which doesn't work for me, but might work for your application. I am attaching the code I used in squares for you to look at. Maybe it'll help you.
Like, you I found that same link that might address the problem but I couldn't figure out how to do anything with it. I do know C++, but only as a language. Getting all the plugins, modules, and runtime environments setup is beyond my capability. I'd kill for some sort of class to attend that would cover all the setup stuff that people assume you know just because you know a language.
Code:
def SquareIt():
global img, storage
while True:
name = 'C:/DK Files/OpenCV Learn/test1.bmp'
yield viz.window.screenCapture(name)
#
# create memory storage that will contain all the dynamic data
storage = cvCreateMemStorage(0);
img0 = cvLoadImage( name, 1 );
if not img0:
print "Couldn't load %s" % name
img = cvCloneImage( img0 );
# force the image processing
on_trackbar(0);
# Also the function cvWaitKey takes care of event processing
cvWaitKey(5);
# clear memory storage - reset free space position
cvClearMemStorage( storage );
t = viztask.schedule( SquareIt() )
vizact.onkeyup('s',t.kill)