当前位置:网站首页>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)
边栏推荐
- Set WordPress pseudo static connection (no pagoda)
- STM32F4---PWM输出
- Drag to change order
- Livox激光雷达硬件时间同步---PPS方法
- npm install 编译时报“Cannot read properties of null (reading ‘pickAlgorithm‘)“
- Scenario practice: quickly build wordpress blog system based on function calculation
- AcWing 1148. 秘密的牛奶运输 题解(最小生成树)
- POJ 3177 redundant paths POJ 3352 road construction (dual connection)
- Domestic images of various languages, software and systems. It is enough to collect this warehouse: Thanks mirror
- 盒子拉伸拉扯(左右模式)
猜你喜欢
sql中批量删除数据---实体中的集合
AcWing 1148. Secret milk transportation problem solution (minimum spanning tree)
@Before, @after, @around, @afterreturning execution sequence
Centos8 install MySQL 8.0 using yum x
Scenario practice: quickly build wordpress blog system based on function calculation
一片叶子两三万?植物消费爆火背后的“阳谋”
454-百度面经1
js如何快速创建一个长度为 n 的数组
JVM 内存模型
JS how to quickly create an array with length n
随机推荐
Input and output of C language pointer to two-dimensional array
AcWing 904. 虫洞 题解(spfa求负环)
百度飞将BMN时序动作定位框架 | 数据准备与训练指南 (上)
Redis tool class redisutil (tool class III)
Drag to change order
Get to know MySQL for the first time
Box stretch and pull (left-right mode)
Flir Blackfly S 工业相机:通过外部触发实现多摄像头同步拍摄
JVM memory model
STM32F4---通用定时器更新中断
C语言关于链表的代码看不懂?一篇文章让你拿捏二级指针并深入理解函数参数列表中传参的多种形式
Livox激光雷达硬件时间同步---PPS方法
2022/0524/bookstrap
Telnet,SSH1,SSH2,Telnet/SSL,Rlogin,Serial,TAPI,RAW
一片叶子两三万?植物消费爆火背后的“阳谋”
Date processing tool class dateutils (tool class 1)
STM32F4---PWM输出
AcWing 346. Solution to the problem of water splashing festival in the corridor (deduction formula, minimum spanning tree)
How can I code for 8 hours without getting tired.
Domestic images of various languages, software and systems. It is enough to collect this warehouse: Thanks mirror