当前位置:网站首页>Halcon knowledge: segment_ contours_ XLD operator
Halcon knowledge: segment_ contours_ XLD operator
2022-07-07 01:57:00 【Mr anhydrous】
One 、 Case description
Boundary extraction : Previous edge extraction was based on foreground passing thresold Extract the region , Then propose from the area XLD, however , If the area cannot be raised, it will be difficult to do . This example tells you , There is no need for binary extraction , You can also take out the edge ,edges_sub_pix It can be done .
This case mainly presents a kind of diagram with unclear contrast , Extract the circle 、 The ellipse 、 Examples of straight lines .
In use Halcon In the process of image processing , The contour must be segmented , Divide the contour into straight segments 、 round ( Or arc )、 Different segments of elliptical arc , The most commonly used operator for contour segmentation is segment_contours_xld.
Two 、 Operator introduction
segment_contours_xld——Segment XLD contours into line segments and circular or elliptic arcs( Will a XLD The contour is divided into straight line segments 、 round ( arc )、 Elliptical arc .)
MaxLineDist1 For the first time to use Ramer Algorithm ( That is, use straight line segments to approach the contour step by step ) At the time of the MaxLineDist, After approaching completion , Then use arc or elliptical arc to fit the adjacent segment , If the distance from the fitting arc to the contour is less than the distance from the approximation line segment to the contour , Replace the approximation line segment with an arc , This process iterates uniformly until all line segments are fitted .
3、 ... and 、 Examples of contour segmentation :
read_image (Image, 'pumpe')
edges_sub_pix (Image, Edges, 'canny', 1.5, 15, 40)
segment_contours_xld (Edges, ContoursSplit, 'lines_circles', 5, 4, 2)
count_obj (ContoursSplit, Number)
gen_empty_obj (Lines)
gen_empty_obj (Circles)
for I := 1 to Number by 1
select_obj(ContoursSplit, Contour, I)
get_contour_global_attrib_xld (Contour, 'cont_approx', Type)
if (Type == -1)
concat_obj (Lines, Contour, Lines)
else
concat_obj (Circles, Contour, Circles)
endif
endfor
fit_line_contour_xld (Lines, 'tukey', -1, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
fit_circle_contour_xld (Circles, 'atukey', -1, 2, 0, 3, 2, Row, Column, Radius, StartPhi, EndPhi, PointOrder)
边栏推荐
- AcWing 345. Cattle station solution (nature and multiplication of Floyd)
- centos8安装mysql报错:The GPG keys listed for the “MySQL 8.0 Community Server“ repository are already ins
- Mysqlbackup restores specific tables
- Appium automation test foundation uiautomatorviewer positioning tool
- ZOJ problem set – 2563 long dominoes [e.g. pressure DP]
- Shell script quickly counts the number of lines of project code
- Hutool post requests to set the body parameter to JSON data
- Date processing tool class dateutils (tool class 1)
- Redis tool class redisutil (tool class III)
- Analyze "C language" [advanced] paid knowledge [i]
猜你喜欢
Shell script quickly counts the number of lines of project code
制作带照明的DIY焊接排烟器
js如何快速创建一个长度为 n 的数组
Let's see how to realize BP neural network in Matlab toolbox
Gin introduction practice
Cisp-pte practice explanation (II)
蓝桥杯2022年第十三届省赛真题-积木画
永久的摇篮
According to the analysis of the Internet industry in 2022, how to choose a suitable position?
Today's question -2022/7/4 modify string reference type variables in lambda body
随机推荐
Command injection of cisp-pte
JS ES5也可以创建常量?
STM32F4---通用定时器更新中断
Set up [redis in centos7.x]
AcWing 1142. 繁忙的都市 题解(最小生成树)
Analyze "C language" [advanced] paid knowledge [II]
Image watermarking, scaling and conversion of an input stream
糊涂工具类(hutool)post请求设置body参数为json数据
@Before, @after, @around, @afterreturning execution sequence
JVM 内存模型
js如何快速创建一个长度为 n 的数组
AcWing 904. 虫洞 题解(spfa求负环)
场景实践:基于函数计算快速搭建Wordpress博客系统
2022/0524/bookstrap
Input and output of C language pointer to two-dimensional array
Drag to change order
The foreground downloads network pictures without background processing
Centos8 install MySQL 8.0 using yum x
Can't you understand the code of linked list in C language? An article allows you to grasp the secondary pointer and deeply understand the various forms of parameter passing in the function parameter
Baidu flying general BMN timing action positioning framework | data preparation and training guide (Part 1)