Halcon operator dual_rank

  effect:

Parameter translation (the order corresponds to the order of the above parameters):

Input image,

Output image,

Input mask shape,

Input mask radius 1 ≤ Radius ≤ 101,

Input filter mode: 0 corresponds to open operation, 50 corresponds to median operation, and 100 corresponds to close operation. Value range: 0 ≤ ModePercent ≤ 100,

Enter boundary processing parameters ('mirrored','cyclic','continued', 0, 30, 60, 90, 120, 150, 180, 210, 240, 255)

 

description:

The operator dual_rank performs nonlinear conversion on the gray values ​​of all input images, and a circle or a square can be used as the mask shape. The operator dual_rank will cause two consecutive rank_image calls (refer to my halcon operator column for detailed explanation of rank_image). The first calculation uses the specified (input parameter) ModePercent to calculate the gray value range, and then the result of the first calculation is used as the input of the second calculation, this time the 100-modepercent value is used to calculate the gray value range.

Boundary processing parameters:

1. The specific gray value of gray value: the gray value of pixels outside the edge of the image are assumed to be constant;

2.'continued' continues the edge pixels of the image

3.'cyclic' continues image edge pixels in a loop

4.'mirrored' reflect the edge pixels of the image

 

The scope of filtering is achieved according to the following steps:

1. First, cover the mask once on the image that needs to be filtered, so that the center of the mask will touch all pixels once;

2. For each of these pixels, all adjacent pixels covered by the mask will be sorted according to their gray value from small to small;

3. Each sorted gray value sequence contains the same number of gray values, just like a mask and image points;

4. The n-th largest element (= ModePercent, rank values ​​between 0...100 in percent) is selected in the corresponding result image and set as the result gray value.

 

ModePercent:

1. If ModePercent is 0, it is equivalent to open operation on the gray value;

2. If ModePercent is 50, it is equivalent to performing two median filtering median_image;

3. If ModePercent is 100, it is equivalent to performing a closed operation;

4. Choosing parameter values ​​within these ranges will result in smooth conversion of these operators.

 

Guess you like

Origin blog.csdn.net/weixin_39829336/article/details/112765622