Help Please

This is a discussion on Help Please within the C++ Programming forums, part of the General Programming Boards category; Searching for source code on how a robot identifies a coloured object. Using c++ source code. Please help.. Thank you....

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    1

    Help Please

    Searching for source code on how a robot identifies a coloured object. Using c++ source code. Please help.. Thank you.

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    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.

  3. #3
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    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.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21