Searching for source code on how a robot identifies a coloured object. Using c++ source code. Please help.. Thank you.
Searching for source code on how a robot identifies a coloured object. Using c++ source code. Please help.. Thank you.
This one is nominated for the vague question of the month.
The software controling the robot will search it's data input stream from a mounted optical device for values that the data input stream generator deems to be red. It will then establish borders and identify everything included in the borders as "the red object".
If you need a less vague answer, post a smart question. See signature link.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.
Typically, an image will be stored as a bitmap (pixel array). If it is stored in another format such as JPEG or MPEG you usually need to convert it to an uncompressed bitmap before analyzing it. Each pixel has red, blue, and green values. With 8-bits per color, 0,0,0 is black and 255,255,255 is white. So, it's easy to check each pixel and determine its color.
In the real world, it's not so easy to identify objects and shapes. ...In a simulated 2-dimensional world, it's not too hard to find rectangles that are perfectly aligned horizontally & vertically. So, I hope this is a 2-dimensional "homework" world!
You can look-up the BMP file format on wotsit.org, and you can find lots if information about how Windows handles bitmaps on MSDN.
The easiest way to get started with this kid of thing is to play-around with some icon creation/editing software. Icons are small bitmaps. You can easily blow them up and see the individual pixels.
Last edited by DougDbug; 11-28-2005 at 04:09 PM.