当前位置:网站首页>Halcon principle: Auto_ Threshold operator
Halcon principle: Auto_ Threshold operator
2022-06-23 12:00:00 【Mr anhydrous】
One 、 operator auto_threshold brief introduction
auto_threshold Use multiple thresholds to segment a single channel image . First , Determine the absolute histogram of the gray value . then , Extract the relevant minimum value from the histogram , These minimum values are used continuously as parameters for threshold operation . be used for byte Image threshold is 0、255, And all the minimum values extracted from the histogram ( Use standard deviation in histogram Sigma After Gaussian filter smoothing ). For each gray value interval , Will generate a region . therefore , The number of areas is the minimum + 1 The number of .
about uint2 Images , The above process uses... Similarly . However , The highest threshold here is 65535. Besides , about uint2 Images ,Sigma Value ( actually ) It means having 256 Histogram of values , Although the histogram with higher resolution is used internally . This is done to facilitate switching between image types , Without changing the parameters Sigma.
about float Images , The threshold is the minimum and maximum gray values in the image and all the minimum values extracted from the histogram . here , Parameters Sigma The scaling of the image refers to the original gray value of the image . Select the Sigma The bigger the value is. , The less areas to extract . If the region to be extracted shows similar gray values ( Homogeneous region ), This operator is useful .
Two 、 Actual case
read_image (Image, 'fabrik')
median_image (Image, Median, 'circle', 3, 'mirrored')
auto_threshold (Median, Seg, 5)
connection (Seg, Connected)
3、 ... and 、 Implement with your own code
Here, according to auto_threshold Official explanation , The principle of the operator implemented by the user . Be careful , The following algorithm has been used to auto_threshold The meaning of is completely expressed .
read_image (Image, 'fabrik')
median_image (Image, Median, 'circle', 3, 'mirrored')
get_image_size(Median, Width, Height)
gen_rectangle1(Rectangle, 0, 0, Width, Height)
gray_histo(Rectangle,Image, AbsoluteHisto, RelativeHisto)
create_funct_1d_array(RelativeHisto, Function)
smooth_funct_1d_gauss(Function, 4, SmoothedFunction)
derivate_funct_1d( SmoothedFunction, 'first',function1_der)
derivate_funct_1d( SmoothedFunction, 'second',function2_der)
funct_1d_to_pairs( function1_der, XValues1, YValues1)
funct_1d_to_pairs( function2_der, XValues2, YValues2)
tuple_length(XValues2, Length)
xx:=[]
for I:=0 to Length-1 by 1
if ( ( abs(YValues1[I]) < 0.001 ) and (YValues2[I]>0.00001 ) )
xx:=[xx,I]
endif
endfor
stop()
offset:=6
var:=xx[0]
mm:=[]
mm:=[mm,var]
i:=1
tuple_length(xx,len)
len:=len-1
while(i<len)
while(abs(xx[i]-var)<offset and i<len )
var:=xx[i]
i:=i+1
endwhile
if(i<len)
mm:=[mm,xx[i]]
var:=xx[i]
endif
endwhile
stop()
tlow:=[0,mm]
thigh:=[mm,255]
threshold(Image,Region, tlow,thigh)
connection (Region, Connected)
Reference article :
halcon principle : One dimensional function function_1d type 【1】
halcon principle : One dimensional function function_1d type 【2】
边栏推荐
- WC statistics are out of date, and every line of cloc code is valid
- 语音模块:pyttsx变声项目
- 电脑坏了,换了台电脑,装node环境的时候出了问题,报错URL not defined
- 想学习eTS开发?教你开发一款IQ-EQ测试应用
- ROS知识:rviz库librviz的结构
- 10-- 根据中序遍历和后序遍历,构造二叉树
- 2022工具钳工(初级)考试练习题模拟考试平台操作
- Linked list 5 - 234 Palindrome linked list
- Common fault analysis and Countermeasures of MySQL in go language
- 4路电话+1路千兆以太网4路PCM电话光端机
猜你喜欢

汉源高科1路千兆光口转4路千兆以太网电口千兆1光4电光纤收发器

汉源高科8路电话+1路百兆以太网RJ11电话光端机 8路PCM电话光端机

Introduction to redis - Chapter 3 - data structures and objects - Dictionary

汉源高科USB2.0光端机USB2.0光纤延长器USB2.0光纤传输器USB2.0接口转光纤

Halcon知识:binocular_disparity 知识

年薪中位数超30万,南大AI专业首届毕业生薪资曝光

halcon知识:dyn_threshold的用法(划痕检测)

Redis 入门-第三篇-数据结构与对象-字典

Qt 知识:使用 QGraphicsPixmapItem类

Easy to understand soft route brushing tutorial
随机推荐
QT5知识:信号和槽的一些要点
Open classes are short videos! Tonight, I will teach you how to realize accurately!
64路电话+2路千兆以太网64路PCM电话光端机语音电话转光纤
十大劵商如何开户?在线开户安全么?
电脑坏了,换了台电脑,装node环境的时候出了问题,报错URL not defined
HMS core video editing service has the ability to open templates, helping users get the same cool video with one click
DuPont analysis: what is the investment value of Anyang Iron and Steel Co., Ltd?
基本数据类型和对应的包装类
理财产品的赎回时间有规定吗?
2光2电级联型光纤收发器千兆2光2电光纤收发器迷你嵌入式工业矿用本安型光纤收发器
ROS2知识(6):坐标对象TF原理和实践
How does easygbs solve the abnormal use of intercom function?
Surprise! Amd acquires Xilinx with USD 35billion!
2022工具钳工(初级)考试练习题模拟考试平台操作
Where is the safest and most formal way to open an account at present?
Does the inductance have polarity?
php 手写一个完美的守护进程
"Dream of children's travel" in 2022, GAC Honda children's road safety charity travel entered the Northeast
如何卸载Gazebo与重装
ROS2知识(1):开始实践机器人