当前位置:网站首页>Halcon knowledge: contour operator on region (2)
Halcon knowledge: contour operator on region (2)
2022-06-24 03:38:00 【Mr anhydrous】
One 、 summary
Regions and contours are always used interchangeably in calculations , therefore , Know the good outline , Can better solve regional problems . This article introduces three examples of obtaining outer contour .
Two 、 Convex envelope
2.1 . get_region_convex operator
function : Look up the raised surface as the outline (contour).
read_image (Image, 'f:/images/DOTS/block.jpg')
rgb1_to_gray(Image,gray)
get_image_size(gray,width,height)
* gen_rectangle1(rect,0,0,height,width)
fast_threshold (gray,regin,0, 50 , 7)
get_region_convex(regin, row, col)
gen_image_const(BlkImage,'byte',width,height)
for I:=0 to |row|-1 by 1
tmpRow :=row[I]
tmpCol :=col[I]
set_grayval(BlkImage, tmpRow, tmpCol, 228)
endfor
dev_display(BlkImage)
disp_polygon(3600, row, col)Original picture :

Highlight :

The figure connecting the salient points is :

2.2 How to generate contour regions from hash points

- gen_region_polygon( : Region : Rows, Columns : )
By hashing point coordinates , Generate a region , This area is the contour bar area . Through this area , Sub pixel contour lines can be generated . Such as ( The red linear area above ).
- gen_contour_nurbs_xld
gen_contour_nurbs_xld Generate approximation NURBS curve ( Non uniform rational B Splines ) Of XLD outline . NURBS A curve is defined by its degree 、 Control polygon ( Through rows and columns )、 Weight vectors and node vectors specify .( The green linear area above ).
The degree of the curve determines the degree of differentiability of the curve . The curve lies on its control polygon (Rows,Cols) In the convex hull of . The weight in the weight determines that the curve is controlled by each control point ( That's ok 、 Column ) The degree of attraction . If you choose “ Automatically ”, A weight vector with the same weight for all control points will be generated . Knots A vector describes the domain of a curve . Usually , This parameter can be set to “ Automatically ”.
Generated Contour The accuracy of depends on two parameters MaxDistance and MaxError. MaxDistance Limit two subsequent Contour The maximum distance between points . Generated Contour And the reality NURBS The maximum distance between curves is limited to MaxError. By default , The approximation must satisfy these two constraints , But you can set one of these parameters to “ Omit ”. Select the MaxError and MaxDistance The lower the , The better the approximation of the curve . Please note that , All contour points are exactly on the curve ( Except for inaccurate values ).
边栏推荐
- A figure showing the price and expense structure of Tencent cloud real-time audio and video TRTC
- Understand Devops from the perspective of leader
- Modstartcms theme introductory development tutorial
- How to choose excellent server hosting or server leasing in Beijing
- Pits encountered in refactoring code (1)
- RPM 包的构建 - SPEC 基础知识
- Why do I need a code signing certificate? Where can I get a code signing certificate?
- What is load balancing? What are the functions of load balancing?
- Supply chain system platform: two management areas
- Dialogue with Google technical experts: soundstream is expected to be used for general audio coding in the future
猜你喜欢

Community pycharm installation visual database

老弹出explorer.exe遇到问题已停止工作,怎么办?

浅谈游戏安全 (一)

Sorting out of key vulnerabilities identified by CMS in the peripheral management of red team (I)

元气森林推“有矿”,农夫山泉们跟着“卷”?

你了解TLS协议吗?

QT creator tips

On Sunday, I rolled up the uni app "uview excellent UI framework"

Get to know MySQL database

618大促:手机品牌“神仙打架”,高端市场“谁主沉浮”?
随机推荐
Some basic knowledge of data center server cabinet
golang clean a slice
Iguard6.0 - appropriate website protection system
Is it necessary to buy EIP? Price analysis of EIP
How to handle the uplink and downlink silence of TRTC
How the new operator works
What are the advantages of EIP? What is the relationship between EIP and fixed IP?
How to choose excellent server hosting or server leasing in Beijing
getLocationInWindow源码
Actual combat | how to use micro build low code to realize tolerance application
What is the price of the elastic public network IP bandwidth
Record a programming contest
Coding CD of Devops
[new double 11] the latest interpretation of Tencent cloud double 11! Get 11000 yuan voucher now!!
What is the difference between server leasing and hosting?
Tens of millions of Android infected with malicious virus and Microsoft disabled a function of Excel | global network security hotspot on October 9
Coding Ci of Devops
Ligature in font design
Industrial security experts talk about how to build security protection capability for government big data platform?
Self built DNS to realize the automatic intranet resolution of tke cluster apiserver domain name