go_away

### Author Topic: Cam, object detection  (Read 3231 times)

0 Members and 1 Guest are viewing this topic.

#### m3h

• Beginner
• Posts: 1
##### Cam, object detection
« on: December 27, 2006, 12:09:12 PM »
hi,

i just deleted the whole text i wrote down here

i'll make the question alot shorter:

how can i make a cam look for a colour? just filter out the colour i want?
and how do i get the signal it gives me to a µc?

i dont think the signal will look like 0 2 5 0
0 3 5 9
1 6 8 0
5 9 8 0
numbers r intensities of the colour

and then filtered 0 0 0 0
0 0 0 0
0 1 0 0
0 0 0 0
and '1' representing the colour blob

i dont know what the signal looks like, so im basically walking in the dark

it's late over here atm, goeing to bed now.
hope u guys can help me.

thx

« Last Edit: December 27, 2006, 06:57:47 PM by m3h »

• Supreme Robot
• Posts: 11,696
##### Re: Cam, object detection
« Reply #1 on: December 27, 2006, 08:20:25 PM »
Quote
how can i make a cam look for a colour? just filter out the colour i want?
there are many ways to do it. the method id use is middle mass. just find the average X and Y
location of all pixels of that color in the matrix.
http://www.societyofrobots.com/programming_computer_vision_tutorial_pt3.shtml#middle_mass
the location can then be used for your robot to decide what to do.

Quote
how do i get the signal it gives me to a µc?
the camera sends the data over serial, and your µc can save the stream into a matrix

the actually data sent greatly depends on the camera.

you will see some start bit info
a stream of numbers (depends on camera resolution, amount of color, compression, etc.)
end bit info

the stream is the part that you record into the matrix.

find the camera you want to use, and read the datasheet. it should tell you what info it sends. you can probably also found source code to read in the datastream from the camera you want by searching for it.

here is some source code you might be interested in:
http://www.cs.cmu.edu/~cil/v-source.html

the cmucam manual here, on page 56:
http://www.cs.cmu.edu/~cmucam2/CMUcam2_manual.pdf
has an example of the datastream. in this case, it is already processed data, so you dont (although you can set it up for this) see the image data itself.

lastly, search this forum for 'camera' as other people are doing cam vision too.

ps - ive only used the CMUcam with a microcontroller, and webcams that interface with a PC, for robots. ive never used a regular camera directly with a microcontroller . . . anyone else have thoughts?

• Supreme Robot
• Posts: 11,696