From: Walter Roberson on 9 Jul 2010 10:50 Baar Boris wrote: > I don't really understand how I should take into account the depth of > field of my camera. I make another series of test measurment in the > range 20-40 , I set my focus at 25cm and not changed it. This time I > used a squar as test image. I calculated the area of it and sqrt-ing it > I got the pixel equivalent of one side. after divided by the real length > and got the cm/px ratio, this time I saw from the graphic that the > change was linear in the range 30-40cm (U said 30cm should be the minim > distance). The results....well they were worser than before, I am using > Labtec webcam and I need to locate objects on a surface (object size > max 6cm) and have them picked up by a robot arm after the measured data. Which Labtec webcam model are you using? I am having difficulty finding optical specifications for the Labtec webcam models I have been able to locate. One site I looked at hints that probably the Labtec webcam models below Pro (and maybe even that one) use an inexpensive plastic lens: if that is the case for yours then you should expect the optical axes not to be symmetric, and you should probably expect a bit of "fish-eye" as well. Calculating the area and taking the square root is not mathematically necessary unless you are already making the assumption that the optics is non-linear. If you have linear optics as your distance calculation routines assume, then you have a simple trig situation, L = d * sin(theta) so doubling the distance to the surface (d) would imply that the same subtended angle corresponded to twice the linear distance. If, though, you have some fish-eye then your distance routines would have to take into account the distance of the point from the center of the optical axis, which would involve both the horizontal and vertical coordinates. I would suggest that you put down a grid test pattern and measure the linearity of the resulting image.
From: Baar Boris on 12 Jul 2010 13:12 Sorry for the delayed response but I didn't have access to the camera in the weekend, so I had some testing at home on my webcam, other model/brand (doesn't matters). Apropos, the camera I am using with the robot is the Labtec Pro category, so I hope I will not have problems with it's quality. This is what I did: made a test grid as you suggested (dots at 2.5cm distance from each other in a row) , put one in the middle of the image and measured the distance to the other ones. After that using matlabs "polyfix" I calculated the pixel/cm equation , I gave my a simple y=0.035x => it is linear. Using this equation I managed to obtain an accuracy under 5%. All these data is obtained and used at the same distance (23cm). I followed the same process in the lab for the Labtec camera and there I got the maximum 5% error. I made the distance measurment for the same test grips from different distances too, I am about to calculate the pixel/cm ratio at other distances to, maybe it will be also a linear variation, if not I will use the polyfix function so I hope to mentaine the same error limit. Any suggestions to do that.
From: Baar Boris on 12 Jul 2010 15:36 polyfix->polyfit
First
|
Prev
|
Pages: 1 2 Prev: How to fit a maximum area ellipse inside of a data set Next: Need a project on IDS |