Halcon算子之min_max_gray

Halcon算子之min_max_gray

* Threshold segmentation with training region:
read_image(Image,'fabrik')
draw_region(Region,WindowHandle)
min_max_gray(Region,Image,5,Min,Max,Range)
threshold(Image,SegmentedRegion,Min,Max)
dev_display(SegmentedRegion)

此算子用于提取 Regions 所在区域图像的最大与最小灰度值


如果percent参数设置为5,那么图像中灰度值最大和最小的5%的像素不参与最大最小灰度值的计算


先统计区域内图像的灰度直方图,即在0-255灰度值范围内图像像素个数的分布频率图。

区域面积乘以***percent***得到一个数,设为 a,然后用 a分别从0灰度值和255灰度值处向里截取a个像素点。

然后在剩下的像素点中取最小最大灰度值


Name

min_max_gray — Determine the minimum and maximum gray values within regions.

Signature

min_max_gray(Regions, Image : : Percent : Min, Max, Range)

Description

The operator min_max_gray creates the histogram of the absolute frequencies of the gray values within Regions in the input image Image (see gray_histo) and calculates the number of pixels Percent corresponding to the area of the input image. Then it goes inwards on both sides of the histogram by this number of pixels and determines the smallest and the largest gray value:

  e.g.:
    Area = 60, percent = 5, i.e. 3 pixels
    Histogram = [2,8,0,7,13,0,0,...,0,10,10,5,3,1,1]
    => Maximum = 255, Minimum = 0, Range = 255

    min_max_gray returns: Maximum = 253, Minimum = 1, Range = 252
For images of type int4, int8, and real, the above calculation is not performed via histograms, but using a rank selection algorithm. If Percent is set to 50, Min = Max = Median. If Percent is 0 no histogram is calculated in order to enhance the runtime.

Attention

Note that the operator min_max_gray only considers the given Regions and ignores any previously set domain of the input image Image.
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值