当前位置:网站首页>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 越低,曲线的近似值就越好。请注意,所有等高线点都准确地位于曲线上(数值不准确除外)。
边栏推荐
- Record the creation process of a joke widget (II)
- Grpc: how to reasonably manage log configuration?
- Technical dry goods - how to use AI technology to accurately identify mining Trojans
- Cloud development RMB 1 purchase activity is in progress
- Sorting out of key vulnerabilities identified by CMS in the peripheral management of red team (I)
- How does the fortress machine connect to the server? Which is easy to use, fortress machine or firewall?
- Using RDM (Remote Desktop Manager) to import CSV batch remote
- Record the creation process of a joke widget (I)
- RI Geng series: tricks of using function pointers
- How to query trademark registration? Where should I check?
猜你喜欢

Community pycharm installation visual database
Thank you for your recognition! One thank-you note after another

Ar 3D map technology
![[summary of interview questions] zj6 redis](/img/4b/eadf66ca8d834f049f3546d348fa32.jpg)
[summary of interview questions] zj6 redis

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

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

QT creator tips

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

元气森林推“有矿”,农夫山泉们跟着“卷”?
随机推荐
What does elastic scaling of cloud computing mean? What are the application scenarios for elastic scaling of cloud computing?
Summary of common SSH commands
Actual combat | how to use micro build low code to realize tolerance application
Chapter 6: UART echo case of PS bare metal and FreeRTOS case development
Independent innovation and localization technology: SMT production line monitoring and management visualization of intelligent manufacturing
TRTC audio quality problem
New Google brain research: how does reinforcement learning learn to observe with sound?
LeetCode 1047. Delete all adjacent duplicates in the string
How to handle the uplink and downlink silence of TRTC
Which brand is a good backup all-in-one machine price
Grp: how to gracefully shutdown a process?
How the new operator works
What are the functions of Fortress machine equipment
How to select a server with appropriate configuration when planning to build a live broadcast platform
Principle of efficient animation Implementation-A preliminary exploration of jetpack compose
Why should I change my PC to a cloud desktop server? What are the characteristics of this server?
An example of SPM manual binding execution plan
[Tencent cloud update] against 11.11! Here comes the 1.1% discount for enterprises!
How to register a trademark? What needs to be prepared?
MySQL stored procedure + function