Shop OBEX P1 Docs P2 Docs Learn Events
Help! I have two weeks to solve this — Parallax Forums

Help! I have two weeks to solve this

sticktradersticktrader Posts: 15
edited 2011-04-03 07:28 in Propeller 1
I need help in I am trying to make two cameras track a light source and then by using that source tell how far the away the light is. I have the two cameras set up and I am using the ViewPorts image capture. I can get a video source capture and that all works fine. I am having a problem with understanding exactly what I need to do to get just an x y location from the brightest pixel from this program.

Thanks

Comments

  • Clive WakehamClive Wakeham Posts: 152
    edited 2011-04-02 19:25
    Won't you need to calculate the angles for the two cameras and then using geometery work out the distance?
  • kwinnkwinn Posts: 8,697
    edited 2011-04-02 22:04
    I need help in I am trying to make two cameras track a light source and then by using that source tell how far the away the light is. I have the two cameras set up and I am using the ViewPorts image capture. I can get a video source capture and that all works fine. I am having a problem with understanding exactly what I need to do to get just an x y location from the brightest pixel from this program.

    Thanks

    First you need to find the approximate location of the light source, and this is usually done by finding the group of pixels with the highest intensities. Then you select a square or rectangular area of pixels that contains the light source. Then you create an array of x and y intensities by adding the intensity values of each row and each column in that area. The x and y centers are found by taking the average position of the points at 50% of peak intensity.
  • kwinnkwinn Posts: 8,697
    edited 2011-04-02 22:33
    Won't you need to calculate the angles for the two cameras and then using geometery work out the distance?

    There are 3 basic ways to do this.

    1 - Cameras are parallel and a fixed distance apart on a beam, the beam rotates until the light source is centered in one of the cameras. The pixel offset of the other camera determines position.

    2 - The cameras are in fixed positions, both can be rotated to center the light source in the image, and the precise angle of the cameras measured.

    3 - Cameras are parallel and a fixed distance apart on a beam, the beam rotates until the light source is centered in one of the cameras. The other camera is rotated to center the light source and the angle of the camera is measured.

    In all 3 cases simple geometry calculates the distance to the light source. The first method is the simplest mechanism. If mounted on a robot no additional motors are required. The cameras can face straight ahead and the robot can turn to the light source.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2011-04-02 23:14
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-04-02 23:49
    I am glad that this thread wasn't posted two days ago. Using a Propeller to work out parallax ...
  • RS_JimRS_Jim Posts: 1,773
    edited 2011-04-03 06:42
    I am glad that this thread wasn't posted two days ago. Using a Propeller to work out parallax ...
    lol
  • ssoutherssouther Posts: 7
    edited 2011-04-03 07:28
    Just curious - what sort of average distances are we talking about here? There's a great deal of difference in a solution based on tracking something within 10-20 feet, or are we talking about starfield use at millions of kilometers?

    Second question - is it an absolute necessity that you use a camera-based measurement for some reason, or is your solution flexible enough to provide for other hardware?

    As, I said in opening, just curious - for short distance work I would use an entirely different approach, but you may be stuck with cameras as part of someone else's design, so let us know.
    Steve
Sign In or Register to comment.