当前位置:网站首页>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)
边栏推荐
- 猫猫回收站
- Introduction to microservice architecture
- Related programming problems of string
- Add PDF Title floating window
- Redis tool class redisutil (tool class III)
- JS es5 peut également créer des constantes?
- AcWing 1148. 秘密的牛奶运输 题解(最小生成树)
- ROS学习(22)TF变换
- Use nodejs to determine which projects are packaged + released
- JS ES5也可以创建常量?
猜你喜欢
ROS learning (XX) robot slam function package -- installation and testing of rgbdslam
Recognition of C language array
刨析《C语言》【进阶】付费知识【二】
Gin introduction practice
一片叶子两三万?植物消费爆火背后的“阳谋”
刨析《C语言》【进阶】付费知识【一】
Batch delete data in SQL - set in entity
ROS学习(24)plugin插件
我如何编码8个小时而不会感到疲倦。
The difference between Tansig and logsig. Why does BP like to use Tansig
随机推荐
JS how to quickly create an array with length n
ROS学习(26)动态参数配置
Mongodb checks whether the table is imported successfully
NPM install compilation times "cannot read properties of null (reading 'pickalgorithm')“
454 Baidu Mianjing 1
ROS learning (23) action communication mechanism
mongodb查看表是否导入成功
String to date object
Centos8 install MySQL 8.0 using yum x
Correct use of BigDecimal
centos8安装mysql报错:The GPG keys listed for the “MySQL 8.0 Community Server“ repository are already ins
AcWing 361. Sightseeing cow problem solution (SPFA seeking positive ring)
AcWing 1148. 秘密的牛奶运输 题解(最小生成树)
使用nodejs完成判断哪些项目打包+发版
Telnet,SSH1,SSH2,Telnet/SSL,Rlogin,Serial,TAPI,RAW
WCF基金会
ROS learning (26) dynamic parameter configuration
Public key \ private SSH avoid password login
JS ES5也可以创建常量?
Flir Blackfly S 工业相机:通过外部触发实现多摄像头同步拍摄