Calculate the average of maximum and minimum inside any mask.
The operator ::midrange_image forms the average of maximum and minimum inside the indicated mask in the whole image. Several margin controls (Margin) can be chosen for filtering:
0...255 pixels outside of the image edges
are assumed constant (with the indicated
gray value).
-1 Continuation of edge pixels.
-2 Cyclic continuation of image edges.
-3 Reflection of pixels at the image edges.
The indicated mask (= region of the mask image) is put over the
image to be filtered in such a way that the center of the mask
touches all pixels once.
|
Image (input_object) |
(multichannel-)image(-array) -> Hobject: HImage(Array) ( byte ) |
| Image to be filtered. | |
|
Mask (input_object) |
region -> Hobject: HRegion ( byte ) |
| Region serving as filter mask. | |
|
ImageMidrange (output_object) |
multichannel-image(-array) -> Hobject * : HImage(Array) |
| Filtered output image. | |
|
Margin (input_control) |
integer -> HTuple.long |
| Margin control: 0...255 (constant), -1 (edge pixels continued), -2 (cyclic continuation), -3 (reflection). | |
| Default value: -3 | |
| Typical range of values: -3 <= Margin <= 255 | |
read_image(&Image,"fabrik"); draw_region(&Region,WindowHandle); midrange_image(Image,Region,&Midrange,-3,); disp_image(Midrange,WindowHandle);
For each pixel: O(sqrt(F) * 5) with F = area of the mask.
If the parameter values are correct the operator ::midrange_image returns the value H_MSG_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 handling is raised.
::read_image, ::draw_region, ::gen_circle, ::gen_rectangle1
::threshold, ::dyn_threshold, ::regiongrowing
::gen_circle, ::gen_rectangle1, ::gray_erosion_rect, ::gray_dilation_rect, ::gray_range_rect
R. Haralick, L. Shapiro; ``Computer and Robot Vision''; Addison-Wesley, 1992, Seite 319
Image filters