当前位置:网站首页>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)边栏推荐
- STM32F4---PWM输出
- 盒子拉伸拉扯(左右模式)
- JS how to quickly create an array with length n
- ZOJ Problem Set – 2563 Long Dominoes 【如压力dp】
- AcWing 346. 走廊泼水节 题解(推公式、最小生成树)
- AcWing 361. Sightseeing cow problem solution (SPFA seeking positive ring)
- ROS学习(23)action通信机制
- js如何快速创建一个长度为 n 的数组
- Cisp-pte practice explanation (II)
- ROS学习(24)plugin插件
猜你喜欢

Analyze "C language" [advanced] paid knowledge [i]

AcWing 345. Cattle station solution (nature and multiplication of Floyd)

Today's question -2022/7/4 modify string reference type variables in lambda body

2022/0524/bookstrap

2022/0524/bookstrap

centos8安裝mysql報錯:The GPG keys listed for the “MySQL 8.0 Community Server“ repository are already ins

Livox激光雷达硬件时间同步---PPS方法

How can I code for 8 hours without getting tired.

ROS学习(23)action通信机制

454 Baidu Mianjing 1
随机推荐
Baidu flying general BMN timing action positioning framework | data preparation and training guide (Part 2)
MySQL execution process and sequence
百度飞将BMN时序动作定位框架 | 数据准备与训练指南 (上)
AcWing 1140. Shortest network (minimum spanning tree)
454-百度面经1
ROS学习(24)plugin插件
ROS学习(十九)机器人SLAM功能包——cartographer
JVM memory model
grep查找进程时,忽略grep进程本身
ROS学习(25)rviz plugin插件
ROS学习(23)action通信机制
Shell script quickly counts the number of lines of project code
C language [23] classic interview questions [Part 2]
Modify the system time of Px4 flight control
Introduction to microservice architecture
Use nodejs to determine which projects are packaged + released
When grep looks for a process, it ignores the grep process itself
Ros Learning (23) Action Communication Mechanism
Command injection of cisp-pte
ZOJ problem set – 2563 long dominoes [e.g. pressure DP]