Help! I have two weeks to solve this
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
Thanks
Comments
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.
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.
This is a proof of concept document that I put together that may be of interest to you...
Thread:
http://forums.parallax.com/showthread.php?118023-An-example-of-the-Parallax-effect...&highlight=schwabe+parallax+distance
Document:
http://forums.parallax.com/attachment.php?attachmentid=65513&d=1259760176
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