Skip to Main Content
Centro Assistenza Cognex
Logo

Findline's Performance Against Rotational Drift With Consideration of Line's Contrast

This is an experimental explanation on FindLine’s performance against rotational drift.

15/05/2025

Details

In VisionPro, FindLine and LineMax are both line extraction tools for 2D images. 

In performance, FindLine shows much faster processing time. But other aspects of performance are not known in official documentation.

This article tries to show the performance of FindLine tool against rotational drift with the consideration of line’s contrast.

To assess the performance of FindLine against rotational drift, synthetic line dataset is generated for evaluation. Rotational drift can be affected by two major factors: one is the rotational angle of line and the other is the contrast of line. Thus, the synthetic line dataset needs to provide variety in line angle and contrast.

As you may know, line's contrast is also known as the gradient of line profile. The steeper in gradient, the larger in contrast. So, the change of gradient in line profile exactly changes the contrast of line. To model the gradient of the line profile, a Gaussian function-based method is designed in which the gradient of the Gaussian function graph can be configured by the parameter called variance.

The Gaussian functions are often used to represent the probability density function of a normally distributed random variable with expected value μ and variance σ² as the form below:

placeholder

The Gaussian function graph configured by the above formula is shown below.

placeholder

As you may know, the change of mean value μ does not affect the shape of graph but translate the graph along x =axis.

While, the change of variance σ² can modify the shape of graph vastly, especially for the gradient of graph.

With the above observations, Gaussian function graph can be a good model to emulate line with various contrasts. By adjusting variance σ² we can modify the gradient of Gaussian function graph which is the contrast of line. The following figure shows the generated synthetic line with the Gaussian function and its profile.

placeholder
σ =1.6, rot = 0, Contrast = 84.197
placeholder
Profile of line

Here, σ stands for the standard deviation of Gaussian function and rot = 0 stands for the ground-truth rotation angle is zero degree. Also contrast value is measured by the Caliper tool in VisionPro. The shape of the above profile of line is the same as the graph of Gaussian function with the standard deviation of 1.6. Of course, Gaussian function is scaled with 128, so that the highest point is set to 128 higher than the base intensity.

The following images show the synthetically generated lines with various line angles and contrasts. As you can see, the Gaussian function’s standard deviation σ plays a key role in controlling the contrast of the line. The bigger the σ produces the smaller the magnitude of the contrast.

 

placeholder
σ =0.25, rot = -3, Contrast = -127.449
placeholder
σ =1.0, rot = -2, Contrast = -117.909
placeholder
σ =2.0, rot = -1, Contrast = 72.1869
placeholder
σ =3.0, rot = 1, Contrast = 50.2021
placeholder
σ =5.0, rot = 2, Contrast = 31.1415
placeholder
σ =8.0, rot = 3, Contrast = -20.0909

Here are the parameters set for FindLine tool, and all the parameters remain the same during the whole process of performance evaluation.

placeholder
placeholder
placeholder

During the synthetic line generation process, 54 values are sampled from the range of [0.2, 8.0] in standard deviation and 61 angles are sampled from the range of [-3.0, 3.0] in rotation angle. Thus, eventually 3294 lines are generated for performance evaluation. The following figure shows the 3D bar graph of deviation error between actual angle of line and result angle from FindLine’s result.

placeholder

From the above 3D bar graph, two observations can be derived as follows:

  1. Angular deviation mostly maintains at a low level (less than 0.04 degree) during the variation of line angle and contrast. Even the highest error is no more than 0.1 degree. It means that with proper parameter setting (including edge polarity and number of ignores in filter), FindLine can achieve sufficient high angular accuracy against rotational drift. The best performance of angular deviation is shown within the range of [3, 5] in standard deviation and [-1, 1] in actual line angle, which the average deviation error is less than 0.0016. The range of [3, 5] in standard deviation is corresponding to the range of 18-30 pixels of the line thickness. Please note that the above best performance range is measured within the proposed synthetic line dataset. For real line cases, the best performance range can be varied due to the characteristics of line profile and FindLine’s parameter settings. But even though, it is highly possible that the best performance range of line thickness should not be too thin or too thick. 
  2. Angular deviation shows big fluctuations along the change of actual line angle when sigma is small. This is originally caused by the aliasing effect during the synthetic line rendering. This aliasing effect will become obvious when sigma is very small and it can be clearly seen in the figure of [σ = 0.25, rot = -3, Contrast = -127.449], in which dozens of steps with one- or two-pixel width can be observed easily. The number of steps depends on the rotation angle of line and usually more magnitude in rotation angle; more steps can be generated. If the frequency of calipers in FindLine (each caliper can be regarded as a sampling process, thus frequency here means the sampling frequency) can match the frequency of steps well, then angular deviation can be small and for the opposite case, the angular deviation can be relatively large. This’s the reason for fluctuation of angular deviation along with the change of line rotation. To avoid fluctuation, line can be tuned to be thicker.

Due to the proposed method for synthetic line generation use low sampling rate, aliasing effect seems severe than real line cases. Nowadays, most camera processors contain image quality enhancing technology which alleviates the aliasing effect dramatically. Even though deviation error still can be fluctuated by the line angle especially when line is very thin.

Conclusion:

  1. FindLine shows sufficient high angular accuracy against rotational drift in general cases. The angular accuracy depends on Findline’s parameter setting (especially for caliper setting) and the characteristics of line profile. A too thin or too thick line can drop the performance of angular accuracy.
  2. FindLine’s angular accuracy against rotational drift can be sensitive to line angle when the line is too thin. To avoid possible fluctuations in angular accuracy, not too thin line is preferred.

Note 1: To view 'LineMax's performance against rotational drift with consideration of line's contrast', please refer to the article 000002179.

Note 2: All the above line finding tool names and tests are valid with VisionPro 9.23.

Risorse correlate