Table of Contents

Laser Profile

Basics:

In the FPGA of the camera an algorithm is implemented to extract in real time a laser line (or simply spots) in a greyvalue image. The output is instead of the image, the result of the processed image. For every column of the image one row position (offset from top/bottom) of the laser line is transferred. Notice, that only one position per column can be found.

The FPGA calculates the position of a laser line within an image in real-time and independently from the processor.

The projection direction of the laser is horizontal, i.e. the full width of 640 pixels can be used with VGA sensors. The horizontal alignment is also decisive for the attainable scan rate (profiles/s), as the VGA sensor allows a higher frame rate only if lines are limited.

The output of the FPGA is an array of offset values y(x), with a 16-bit word y(x) being calculated for each column. This array defines the length of the laser line measured in pixels from the lower to the upper image border. The 16-bit y values contain 12-bit integer places and 4-bit decimal places.

The method used, delivers values sub-pixel accurate with a resolution of 1/16 pixel (decimal places).

To each laser line the FPGA appends a data block of 32 Bytes. This block is reserved for future use and must be ignored. Therefore the total number of bytes generated by the FPGA for a profile line with a width of 640 pixels is 1312 Bytes.

Tips for selecting the right parameter

Thresholds:

Greyscale(8-bit): The algorithm finds these greyvalue-spots, which are lying between the lower and upper threshold. e.g. searching for a bright laserline, you will have to select high thresholds. Gmin ⇐ Pixelvalue ⇐ Gmax

Area(14-bit): Vertical successive greyvalues, which are lying between the thresholds, are summed up. Only when this sum is between a minimum and maximum value, the spot is of interest. Too small or too great spots can be eliminated with these parameters. Please note, that the 14-bit limits the number of vertical successive valid pixels to at least 64. If the grey-level pixel value is lower than 255, then also greater spots can be detected.

Priority(2-bit):

If the setup of the thresholds is done, but there are more than one relevant spot in a column, a spot select parameter (prio) has to be defined. Which select the first(0), the last(1), the first most significant(2) or the last most significant spot(3).

Application:

The method “SetupLaserProfiling” prepares the camera do start with laser profiling. One 16-bit output offset has a 12-bit integer part and a 4-bit fractional part to allow for subpixel accuracy. The profile can be taken only horizontally, i.e. for an image of 640×480 pixel you get 640 position values. You can specify any position and size of the image taken from the sensor that produces output data sizes in a multiple of 32 bytes. (i.e. you can specify the window in multiples of 16 pixel columns as each column produces a 16-bit output value).

Output data is fetched from the FPGA via the normal call to GetImage() with the '16-bit offset as the resulting image'. We recommend to use acquisition mode FREE_RUN_SLAVE to produce profiles at fixed framerates. But any other acquisition mode is possible. Keep in mind that reducing the number of lines in an image increases the highest possible framerate but reducing the number of columns does not (but of course the amount of data will be reduced).

Every profile you acquire via the GetImage() call has a resulting size from 2*N+32 bytes. This includes the 16-bit values for N columns and an additional 32 byte data block. This block is reserved for future use and should be ignored.

Output offsets can be calculated with respect to the top or bottom line depending on your needs in the application.

By a relative movement between the object and the camera merging the laser profiles of following images a 3D shape of the scanned object can be reconstructed.