当前位置:网站首页>halcon知识:区域(Region)上的轮廓算子(2)
halcon知识:区域(Region)上的轮廓算子(2)
2022-06-24 03:34:00 【无水先生】
一、提要
区域和轮廓在计算中总是互相交替使用,因此,了解好轮廓,能够更好地解决区域问题。本篇介绍三个获取外轮廓的例子。
二、凸包络
2.1 . get_region_convex算子
功能:查询突起的外表作为轮廓(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)原图:

显示突出点:

将突出点连接的图形为:

2.2 如何从散列点生成轮廓区域

- gen_region_polygon( : Region : Rows, Columns : )
通过散列点坐标,生成一个区域,该区域是轮廓条区域。通过该区域,可以生成亚像素轮廓线。如(上图的红色线状区域)。
- gen_contour_nurbs_xld
gen_contour_nurbs_xld 生成近似 NURBS 曲线(非均匀有理 B 样条曲线)的 XLD 轮廓。 NURBS 曲线由其度数、控制多边形(通过行和列)、权重向量和节点向量指定。(上图的绿色线状区域)。
曲线的度数决定了曲线的可微性等级。曲线位于其控制多边形 (Rows,Cols) 的凸包内。权重中的权重决定了曲线被各个控制点(行、列)吸引的程度。如果选择“自动”,则会生成对所有控制点具有相同权重的权重向量。 Knots 向量描述了曲线的域。通常,此参数可以设置为“自动”。
生成的 Contour 的精度取决于两个参数 MaxDistance 和 MaxError。 MaxDistance 限制两个后续 Contour 点的最大距离。生成的 Contour 和实际 NURBS 曲线之间的最大距离限制为 MaxError。默认情况下,近似值必须满足这两个约束,但可以将这些参数之一设置为“省略”。选择的 MaxError 和 MaxDistance 越低,曲线的近似值就越好。请注意,所有等高线点都准确地位于曲线上(数值不准确除外)。
边栏推荐
- 13. Tencent cloud IOT device side learning - data template function and Implementation
- Why do I need a code signing certificate? Where can I get a code signing certificate?
- Record the creation process of a joke widget (II)
- Differences between EDI and VMI
- Chapter 4: LED flash case of PS bare metal and FreeRTOS case development
- No monitoring information seen in kibana
- Micro build low code enterprise exchange day · Shenzhen station opens registration
- Summary of common SSH commands
- Under what circumstances do you need a fortress machine? What are the functions of a fortress machine
- Troubleshooting and resolution of errors in easycvr calling batch deletion interface
猜你喜欢

Simple and beautiful weather code
![[summary of interview questions] zj6 redis](/img/4b/eadf66ca8d834f049f3546d348fa32.jpg)
[summary of interview questions] zj6 redis

Ar 3D map technology

Get to know MySQL database
Thank you for your recognition! One thank-you note after another

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

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

618大促:手机品牌“神仙打架”,高端市场“谁主沉浮”?
![[summary of interview questions] zj5](/img/d8/ece82f8b2479adb948ba706f6f5039.jpg)
[summary of interview questions] zj5

On Sunday, I rolled up the uni app "uview excellent UI framework"
随机推荐
Sorting out of key vulnerabilities identified by CMS in the peripheral management of red team (I)
ClickHouse Buffer
Grpc: how to implement the restful API for file uploading?
What is the fortress machine? What role does the fortress machine play?
How to register a trademark? What needs to be prepared?
Using RDM (Remote Desktop Manager) to import CSV batch remote
Tke accesses the cluster through kubectl in pod
What is elastic scaling in cloud computing? What are the main applications of elastic scaling in cloud computing?
General scheme for improving reading and writing ability of online es cluster
Several key tools for cloud native implementation
What is the all-in-one backup machine? How about its cost performance
What is the difference between server leasing and hosting?
MySQL stored procedure + function
[competition experience sharing] design of intelligent guide rod
Applicationclientprotocol of yarn source code
Iguard6.0 - appropriate website protection system
Can elastic public IP be bound to a home server? The difference between elastic public IP and fixed IP
Double 11 will arrive soon. Is your website ready?
Cloud development RMB 1 purchase activity is in progress
Actual battle case | refuse information disclosure, Tencent cloud helps e-commerce fight against web crawlers