工控编程吧

标题: halcon shape_histo_all函数介绍 [打印本页]

作者: qq263946146    时间: 2019-5-10 11:49
标题: halcon shape_histo_all函数介绍
shape_histo_all(Region, Image : : Feature : AbsoluteHisto, RelativeHisto)
shape_column_all在图像Image的区域Region内执行255个阈值分割操作
直方图的入口i对应用阈值i分割后的图像中组件或孔洞的个数(Feature = 'connected_components', 'holes')。或用(Feature = 'convexity', 'compactness', 'ansisometry')分割的区域属性的平均值。

Region,Image为输入区域和图像。
Feature为提取的属性,可选项有 'anisometry', 'compactness', 'connected_components', 'convexity', 'holes'
AbsoluteHisto,RelativeHisto有输出的属性相对和绝对直方图分布。
例如模拟属性为connected_components,计算直方图过程函数
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image (Image, 'printer_chip/printer_chip_01')
gen_circle (Circle, 200, 200, 100.5)
reduce_domain(Image,Circle,RegionGray)
for i := 0 to 255 by 1
    threshold(RegionGray,Seg,i,255)
    connect_and_holes (Seg, NumConnected, _)
    AbsHisto := NumConnected
endfor
Sum := 0
for i := 0 to 255 by 1
    Sum := Sum+AbsHisto
endfor
for i := 0 to 255 by 1
    RelHisto := AbsHisto/Sum
endfor


shape_histo_point(Region, Image : : Feature, Row, Column : AbsoluteHisto, RelativeHisto)
和shape_histo_all一样,此函数也在Image 的区域Region内执行255个灰度阈值分割,
不同的是仅包含像素Row, Column的区域参与计数。
直方图入口I对应用I分割的区域内的孔洞( (Feature = 'holes'),
或区域的属性值 (Feature = 'convexity', 'compactness', 'ansisometry')







欢迎光临 工控编程吧 (https://www.gkbc8.com/) Powered by Discuz! X3.4