Opening, Median and Closing with circle or rectangle mask.
The operator dual_rank carries out a non-linear transformation of the gray values of all input images (Image). Circles or squares can be used as structuring elements. The operator dual_rank effects two consecutive calls of rank__. At the first call the range gray value is calculated with the indicated range (ModePercent). The result of this calculation is the input of a further call of rank__, this time using the range value 100-ModePercent.
When filtering different parameters for margin control (Margin) can be chosen:
0...255 pixels outside the image edges are assumed to be constant (with the indicated gray value). -1 Continuation of edge pixels. -2 cyclic continuation of image edges. -3 Reflection of pixels at image edges.A range filtering is calculated according to the following scheme: The indicated mask is put over the image to be filtered in such a way that the center of the mask touches all pixels once. For each of these pixels all neighboring pixels covered by the mask are are sorted in an ascending sequence corresponding to their gray values. Each sorted sequence of gray values contains the same number of gray values like the mask has image points. The n-th highest element, (= ModePercent, rank values between 0 100 in percent) is selected and set as result gray value in the corresponding result image.
If ModePercent is 0, then the operator equals to the gray value opening (grey_opening). If ModePercent is 50, the operator results in the median filter, which is applied twice (median). The ModePercent 100 in dual_rank means that it calculates the gray value closing (grey_closing). Choosing parameter values between this range results in a smooth transformation between the application of the corresponding operators.
Image (input_object) |
image(-array) -> object : byte |
Image to be filtered. |
ImageRank (output_object) |
image(-array) -> object |
Filtered Image. |
MaskType (input_control) |
string -> string |
Shape of the mask. | |
Default value: 'circle' | |
List of values: 'circle', 'rectangle' |
Radius (input_control) |
integer -> integer |
Radius of the median-mask. | |
Default value: 1 | |
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 15, 19, 25, 31, 39, 47, 59 | |
Range of values: 1 <= Radius <= 101 | |
Minimum increment: 1 | |
Recommended increment: 2 |
ModePercent (input_control) |
integer -> integer |
Filter Mode: 0 corresponds to a gray value opening , 50 corresponds to a median and 100 to a gray values closing. | |
Default value: 10 | |
Suggested values: 0, 2, 5, 10, 15, 20, 40, 50, 60, 80, 85, 90, 95, 98, 100 | |
Range of values: 0 <= ModePercent <= 100 | |
Minimum increment: 1 | |
Recommended increment: 2 |
Margin (input_control) |
integer -> integer |
Margin control: 0...255 (constant), -1 (margin points continued), -2 (cyclic continuation), -3 (mirroring). | |
Default value: -3 | |
Range of values: -3 <= Margin <= 255 |
read_image(:Image:'fabrik':) > dual_rank(Image:ImageOpening:'circle',10,10,-3:) > disp_image(ImageOpening:::).
For each pixel: O(sqrt(F) * 10) with F = area of the structureing element.
If the parameter values are correct the operator dual_rank returns the value TRUE. The behavior in case of empty input (no input images available) is set via the operator set_system(::'no_object_result',<Result>:). If necessary an exception is raised.
threshold__, dyn_threshold__, sub__, regiongrowing__
rank__, grey_closing, grey_opening, median
circle, rectangle1, min1__, max1__, sigma__
W. Eckstein, O. Munkelt "Extracting Objects form Digital Terrain Model" Remote Sensing and Reconstruction for Threedimensional Objects and Scenes, SPIE Symposium on Optical Science, Engeneering, and Instrumentation, July 1995, San Diego