Halcon算子之scale_image_range

read_image (Image, 'fabrik')
scale_image_range (Image, ImageScaled, [100,50], [200,250])
* 将灰度值[-0.4,0.4]映射到[50,200]
scale_image_range(Grady,CurvatureRowScale,[-0.4,50],[0.4,200])

解释实例

read_image (Image, '../test.png')

rgb1_to_gray (Image, GrayImage)

get_domain (GrayImage, Domain)

get_region_points (Domain, Rows, Columns)

get_grayval (GrayImage, Rows, Columns, Grayval)

scale_image_range (GrayImage, ImageScaled, 100, 200)

get_grayval (ImageScaled, Rows, Columns, Grayval2)




简短描述

scale_image_range — Scale the gray values of an image from the interval [Min,Max] to [0,255]

签名

scale_image_range(Image : ImageScaled : Min, Max : )

描述

Convenience procedure to scale the gray values of the input image Image from the interval [Min,Max] to the interval [0,255] (default).
Gray values < 0 or > 255 (after scaling) are clipped.
If the image shall be scaled to an interval different from [0,255], this can be achieved by passing tuples with 2 values [From, To] as Min and Max.
Example:
scale_image_range (Image, ImageScaled, [100,50], [200,250])
maps the gray values of Image from the interval [100,200] to [50,250].
All other gray values will be clipped.

参数

Image (input_object)  (multichannel-)image(-array) → object (byte / int1 / int2 / uint2 / int4 / int8 / real / cyclic / direction / complex)
The input image to be scaled
ImageScaled (output_object)  (multichannel-)image(-array) → object (byte / int1 / int2 / uint2 / int4 / int8 / real / cyclic / direction / complex)
The scaled output image
Min (input_control)  number-array → (integer / real)
The minimum gray value which will be mapped to 0. If a tuple with two values is given, the first value will be mapped to the second value.
Default Value: 100
Max (input_control)  number(-array) → (integer / real)
The maximum gray value which will be mapped to 255. If a tuple with two values is given, the first value will be mapped to the second value.
Default Value: 200