Image Parsing using the Propeller ( C or Spin )
ValeT
Posts: 308
In my CS class, I am working on an independent study to make a "smart" robot for the FTC competition. I am *hoping* to use some vision sensor to grab images and parse through them. This got me thinking....Could I use the Propeller to parse through images? I am thinking though that it might take too much computation or too much memory for the Propeller to actually be useful ( parsing at least 1 frame per couple of seconds ).
Anyone done this before or worked on it?
Anyone done this before or worked on it?
Comments
The CMUcam4 can be used to grab grey scale 128x96 images and store them in RAM with this firmware.
-Phil
If not, is it possible to run Spin and C in parallel on the Propeller Activity Board? E.g. using Spin to grab an image and then C for everything else on the ActivyBot, Ping, XBee, servos etc.
My scenario is that I'd like to grab an image through PropCam, if needed save it to a SD-card, and send the image through XBee Wi-Fi (later perhaps XBee Pro HP) to a laptop or iPad. I'm fully aware it won't be fast with 9600 Baud, so any kind of tele-presence.
Do note that I have only the DB-expander, the Propeller Backpack was not available when I bought the PropCam and seems to still be out of stock at my favourite seller (Parallax).
Edit: What about spin2cpp, would that be able to turn Phil's Spin-code, drivers etc. to usable C?
spin2cpp is definitely the way to go. Start with that and then use your own intellect to enhance the output. Spin2cpp is awesome, but it isn't perfect and has no comprehension of "good" code. For instance - it's going to take the assembly and create a binary blob instead of a separate assembly file. My recommendation would be to copy/paste the DAT section into a *.S file.
Also, be sure to use C++ (classes) not C. Spin uses objects and there's no reason to undo that hard work.
In case you haven't found it yet, I list 3 different options for reading from an SD card with C/C++ in this post.
So it's 'impossible' to run Spin and C/C++ in parallel then?
But, I think the Propeller may be too slow to do much processing with it.
Still, I'm wondering if you could dumb the image down to very low resolution and then maybe it could be used as a line follower.
What might be better is to send the image data to an Edison module over hardware, or send it to a real computer over wireless to analyze and send back instructions.
The SSD1921 can also compress the image to jpg, so that might help to increase the transfer rate to the external processor...
I have a dream of turning my Manta board into a line following robot one of these ways. May never get the time, but I can dream about it anyway...
David Betz also wrote a tool (called spinwrap) to allow the use of Spin code directly from C. IIRC it starts a Spin interpreter in another COG. I haven't used it myself, but it might be worth looking in to -- David certainly knows what he is doing. The URL is: https://github.com/parallaxinc/spinwrap.
Eric