Wicked Minds Electronics

Multi Color Object Tracking with Papilio and TCM8230

Recommended Posts

Setup and tracking of multiple objects (Rubiks squares) of different  colors using Papilio 500k and a camera from SparkFun. Image acquisition  and segmentation are implemented in custom VHDL. Blob detection is  limited to 8 objects and is very crude at this point because only a  single pass algorithm has been implemented in assembly using a KCPSM3  running at 64MHz. The client application shown here is written in C#.  Only Wing C on Papilio is needed to interface the camera, the next step  after adding a second and maybe third pass to blob detection is to throw  some servos on the other side (Wings A,B) and see what that leads to.  Still lots of room left!

Logic Utilization

Slice Flip Flops 423 of 9,312 (4%)

4 input LUTs 1,072 of 9,312 (11%)

Occupied  Slices 629 of 4,656 (13%)   

Slices containing only related logic 100% 

    Number of Slices containing unrelated logic 0% 

Total Number  of 4 input LUTs 1,128 of  9,312 (12%)

    Number used as logic 740

      Number used as a route-thru 56   

Number used for Dual Port RAMs 272     

Number used for 32x1 RAMs 52   

Number used as Shift registers 8

This post has been promoted to an article

Share this post


Link to post
Share on other sites

Tracking area is 128 pixels x 96 lines (subQCIF) with 13-bit color resolution.

Tracking registers are updated every frame at 30 frames per second.

 

A single DCM is used to provide 24MHz clock to the camera/UART and 64MHz clock to the picoBlaze.

All memory is accessible via UART at 115,200 baud.

Memory Utilization:

  • 24k x 8-bit RAMB for raw frame capture
  • 8k x 8-bit RAMB to hold the color map
  • 6k x 8-bit RAMB for segmented image capture
  • 1k x 16-bit RAMB provides program storage for picoBlaze
  • 64 byte Distributed RAM for picoBlaze scratchpad memory
  • 128 byte FIFO for RLE compression during tracking
  • 256 byte Distributed RAM to host the Tracking Registers

.

Raw frame capture is only used to support creation of color maps and is possible to omit from a stand alone design however I kind of like the thought of having the ability to take a snapshot of objects I am tracking in the field.

Share this post


Link to post
Share on other sites

I tossed a servo core from opencores.org into the mix and hooked up an old servo I had laying around. Currently just a single axis going. Need to find another working servo to implement the other axis.

So far so good :)

Here is a quick video of the servo tracking in action.

Share this post


Link to post
Share on other sites

Just a question: is that a PQFN package?

Alvie

Not really, SparkFun has the datasheet for the camera. There are two ways to connect to it, there are pads on the bottom which are also broken out to tabs on the sides for a socket.

You will have to look at the drawings in the datasheet, it is hard to describe the pattern.

Share this post


Link to post
Share on other sites

I added a TV Wing to my design and here is the results of tracking with a live composite video monitor. I added some screenshots at the end of the video so that you can see what the picture looks like without the brightness being skewed by the angle I filmed the demo at. The TV Wing is based on the design by BenL posted on the GadgetFactory playground with slight modifications to bring the DAC up to 8 bit resolution and using 100ohm/200ohm values for R/R2. I had to add some VHDL to convert the cameras YUV422 data stream into the separate Y, U and V channels for encoding.

post-12751-13431627650367.jpg

post-12751-13431627650681.jpg

Share this post


Link to post
Share on other sites

So here it is assembled by hand using the new socket design. Just finished running tests on it and taking pictures. Works flawlessly :)

This time around I chose female headers as connectors so that I have more mounting flexibility and can more readily use some ribbon cable to mount the camera on a servo assembly.

P.S. As you can see from the close-ups, I couldn't find my tweezers for the caps and such :(

ocellusfinalassembled1.jpgocellusfinalassembled2.jpgocellusfinalassembled3.jpgocellusfinalassembled4.jpgocellusfinalassembled5.jpg

Share this post


Link to post
Share on other sites

Looks great Wicked! I'm waiting for parts to arrive to build up a few as well. Then we can start working on making these available in the Gadget Factory store so anyone can play with FPGA based vision system!

Jack.

Share this post


Link to post
Share on other sites

Nice! Tell him thank you for helping out. :) My boy loves that kind of stuff, I recorded a youtube video with him in it and he had a blast showing to all his friends at school.

BTW, take a look at Flowstone, I'm pretty excited about all the things we can do with this new graphical programming tool. Has lots of great image processing and DSP tools that don't require any programming to make a really cool windows application.

Jack.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now