Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Sensors (http://www.chiefdelphi.com/forums/forumdisplay.php?f=173)
-   -   pixel granularity with axis camera (http://www.chiefdelphi.com/forums/showthread.php?t=99893)

Jeanne Boyarsky 11-01-2012 23:02

pixel granularity with axis camera
 
We were reading the vision whitepaper on camera aiming to figure out whether the camera can be used for distance. The document implies things are fine.

However there is an arthmetic error in the document. On page 9, it says
Quote:

The target width measures 2 ft wide, and in the example images used earlier, the target rectangle measures 56 pixels when the camera resolution is 320x240. This means that the blue rectangle width is 2*320/56 or 11.4 ft. Half of the width is 6.7 ft, and the camera used is the M1011, so the view angle is ~47 ̊, making Θ equal to 23.5 ̊.
Half of 11.4 feet is 5.7 feet, not 6.7 feet which implies what follows is also inaccurate.

One of our team's mentors recalculated and concluded:
Quote:

Even with the best possible image, one has to be no more than 95 inches from the target for one inch of distance change to result in a one pixel change and no more than 68 inches for a 2 pixel change.
Thoughts? Is this discussed anywhere? (I did try searching.)

Greg McKaskle 12-01-2012 19:18

Re: pixel granularity with axis camera
 
That is correct, the white paper has an error in calculating the example distance, but the formulas are correct. Using the correct value of 5.7 gives a distance of 13.1 ft. As mentioned in the paper, the actual lens view angle is a bit different from the data sheet. That calibration was not based on the example data. The example coded in LV is not surprisingly correct when dividing by two, and gives the correct distance value.

The calculations in the camera size section are not impacted by the previous error. To elaborate a bit, the point where a 2" element is 2 pixels wide is where the field of view is 320 pixels and 320" wide. Half of 320 is 160" or 13.3 ft. 13.3 / tan( 47 / 2 ) is a bit over 30 ft.

Using the equations from the paper, it predicts that at 95" from the target, the target will be 93 pixels wide. At 96", it will appear 92 pixels. So it would appear that we are in mathematical agreement.

This observation calculates the expected error term of the distance at around 8 ft, or 95 in, from the target is plus/minus 0.5 inches. I don't really believe that is a problem. At 27 ft, it looks like error term is plus/minus 6 inches. I'm not going to claim that is ideal, but I would expect the variability of the balls and other mechanical shooter elements will likely be similar.

I hope that helps explain things a bit.

Greg Mckaskle

Sparks333 13-01-2012 02:28

Re: pixel granularity with axis camera
 
If this granularity is insufficient, you might try a few oversampling techniques to get sub-pixel resolution - I find that dithering works very well in these scenarios.

Sparks

Greg McKaskle 14-01-2012 09:58

Re: pixel granularity with axis camera
 
If you care more about precision than performance, you don't have to use the bounding box width. You can determine a location, say near the vertical center of the bounding rect, and use edge detection on the original image to find the distance between the vertical edges of the original monochrome image. That measurement can give subPixel accuracy. Though keep in mind that you can't make something from nothing. The accuracy improvement achievable and the technique is described in the Vision Concepts manual -- C:\Program Files\National Instruments\Vision\Documentation\NIVisionConcepts. chm. Chapter one covers edge definition.

As usual, it is easiest to experiment with this using Vision Assistant. Take your color image, extract the luminance plane, and use the Edge Detector(Simple Edge Tool, First and Last, with a large edge strength of like 200). The edge strength depends on the brightness of your ring light. Draw a line across the rectangle, and the graph will help you determine the actual strength that differentiates the edges. The X values are now subPixel and more accurate than the bounding box.

Greg McKaskle


All times are GMT -5. The time now is 08:08.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi