# Machine Vision

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Non linearity between pixels and widht for linescan

Hi

I'm developing a width gauge based on a linescan camera.

The gauge is measuring the surface of a steel strip moving at 200m/sec.

I found a non linearity between the relation of pixels and real widht:

1904mm X 6635,6pixels

1308mm X 4616,7pixels

814mm X 2880,6pixels

I've tried the working distances between 2600 to 2800mm.

The field of view is 2200mm.

The focal lengh is 35mm.

The size of CCD is 28.67mm (3.5um X 8192pixels - Basler raL8192-12gm).

Thanks,

Alexandre.

Message 1 of 5
(4,385 Views)

## Re: Non linearity between pixels and widht for linescan

I haven't had this exact problem, but it sounds like a lens distortion.  If you are able to image a (very accurate) ruler or similar object with known spacings, you should be able to define a mapping between width and pixels over your range of interest.  Whether or not that mapping is linear, you can easily "look up" the true width based on the pixel count.

Message 2 of 5
(4,369 Views)

## Re: Non linearity between pixels and widht for linescan

Hi Greg

That's a good idea. I'm going to do the ruler to evaluate.

Do you have a suggestion to adjust this distortion from the knowledge of the ruler?

Message 3 of 5
(4,357 Views)
Solution
Accepted by topic author alexandresantos

## Re: Non linearity between pixels and widht for linescan

There are a lot of ways to do it, such as fitting an equation to your data that you can then use, but if you want to be fast (and if you're using a very fast line-scan camera, then I'm guessing you do), I think the quickest way is to use a lookup table like this:

This simply assumes that the relationship is piecewise linear, that is, linear between each of your measured data points (and you've already provided three).  Keep filling in the cluster array with paired values (pixels, width), making sure that the values are in a strictly ascending order, and the Interpolate 1D Array function used here does all the work, and seems to be very fast too.  You only need enough points in the array to make your interpolation accurate enough for your needs.

There are certainly many ways to do this though, so someone else might have a better suggestion.

Message 4 of 5
(4,346 Views)

## Re: Non linearity between pixels and widht for linescan

Hi Greg

Thanks for your idea. I implemented a polynomial from Excel according the attached. It's running well until now.

Another problem that I'm facing is the oscilation on the image (https://www.dropbox.com/s/cboyglx74g8sd93/width%20gauge.mp4?dl=0) when the grid and filter are applied. I would like get stable the filtered image and grid from edge detector.

Does anyone know how to solve this?

Thanks for the moment.

Message 5 of 5
(4,236 Views)