Halcon轮廓提取
简介:
对目标区域进行轮廓提取,可以用于判定形状等。
介绍:
Region (input_object) | Regions for which the boundary is to be computed. | 区域 | ||||||
RegionBorder (output_object) | Resulting boundaries. | 输出的边界 | ||||||
BoundaryType (input_control) |
Boundary type.
|
边界类型 |
Regions (input_object) | Input regions. | 区域 | ||||||
Contours (output_object) | Resulting contours. | 输出的边界 | ||||||
Mode (input_control) |
Mode of contour generation.
|
轮廓生成方式 |
XLD (input_object) | Contours or polygons to be examined. | XLD |
Row (output_control) | Row coordinate of the center point of the enclosing rectangle. | 输出的行坐标 |
Column (output_control) | Column coordinate of the center point of the enclosing rectangle. | 输出的列坐标 |
Phi (output_control) |
Orientation of the enclosing rectangle (arc measure). Assertion: ((- pi / 2) < Phi) && (Phi <= (pi / 2)) |
弧度 |
Length1 (output_control) |
First radius (half length) of the enclosing rectangle. Assertion: Length1 >= 0.0 |
第一个边长 |
Length2 (output_control) |
Second radius (half width) of the enclosing rectangle. Assertion: (Length2 >= 0.0) && (Length2 <= Length1) |
第二个边长 |
Rectangle (output_object) | Rectangle contour. | 输出的矩形轮廓 |
Row (input_control) |
Row coordinate of the center of the rectangle. Default value: 300.0 |
行坐标 |
Column (input_control) |
Column coordinate of the center of the rectangle. Default value: 200.0 |
列坐标 |
Phi (input_control) |
Orientation of the main axis of the rectangle [rad]. Default value: 0.0 Restriction: ((- pi / 2) < Phi) && (Phi <= (pi / 2)) |
弧度 |
Length1 (input_control) |
First radius (half length) of the rectangle. Default value: 100.5 |
第一个边长 |
Length2 (input_control) |
Second radius (half width) of the rectangle. Default value: 20.5 |
第二个边长 |
Contours (input_object) | Contours to be segmented. | 要分割的轮廓 |
ContoursSplit (output_object) | Segmented contours. | 输出的分割轮廓 |
Mode (input_control) |
Mode for the segmentation of the contours. Default value: 'lines_circles' List of values: 'lines', 'lines_circles', 'lines_ellipses' |
轮廓分割模式 |
SmoothCont (input_control) |
Number of points used for smoothing the contours. Default value: 5 Suggested values: 0, 3, 5, 7, 9 Restriction: (SmoothCont == 0) || ((SmoothCont >= 3) && odd(SmoothCont)) |
用于平滑轮廓的点的数目 |
MaxLineDist1 (input_control) |
Maximum distance between a contour and the approximating line (first iteration). Default value: 4.0 Suggested values: 1.0, 1.5, 2.0, 2.5, 3.0, 3.5 Restriction: MaxLineDist1 >= 0.0 |
第一次迭代时轮廓线与近似线之间的最大距离 |
MaxLineDist2 (input_control) |
Maximum distance between a contour and the approximating line (second iteration). |
第二次迭代时轮廓线与近似线之间的最大距离 |
Contours (input_object) | Input XLD contours. | XLD轮廓 | ||||||||||||
SelectedContours (output_object) | Output XLD contours. | 输出的XDL轮廓 | ||||||||||||
Feature (input_control) |
Feature to select contours with.
|
特征选择 | ||||||||||||
Min1 (input_control) |
Lower threshold. Default value: 0.5 |
最小值1 | ||||||||||||
Max1 (input_control) |
Upper threshold. Default value: 200.0 |
最大值1 | ||||||||||||
Min2 (input_control) |
Lower threshold. Default value: -0.5 |
最小值2 | ||||||||||||
Max2 (input_control) |
Upper threshold. Default value: 0.5 |
最大值2 |
Contours (input_object) | Contours to be sorted. | 要排序的轮廓 | ||||||||||
SortedContours (output_object) | Sorted contours. | 输出的排序轮廓 | ||||||||||
SortMode (input_control) |
Kind of sorting.
|
排序种类 | ||||||||||
Order (input_control) |
Increasing or decreasing sorting order. Default value: 'true' List of values: 'false', 'true' |
减或增序 | ||||||||||
RowOrCol (input_control) |
Sorting first with respect to row, then to column. Default value: 'row' List of values: 'column', 'row' |
行或列 |
Contour (input_object) | Input XLD contour. | XLD轮廓 |
Name (input_control) |
Name of the attribute. Default value: 'regr_norm_row' Suggested values: 'regr_norm_row', 'regr_norm_col', 'regr_mean_dist', 'regr_dev_dist', 'cont_approx', 'bright_dark', 'is_hole' |
属性名 |
Attrib (output_control) | Attribute values. | 属性值 |
Contours (input_object) | Input contours. | XLD轮廓 | ||||||||||
Algorithm (input_control) |
Algorithm for the fitting of lines. Default value: 'tukey' List of values: 'drop', 'gauss', 'huber', 'regression', 'tukey'
|
直线拟合算法 | ||||||||||
MaxNumPoints (input_control) |
Maximum number of contour points used for the computation (-1 for all points). |
用于计算的最大轮廓点数量(-1表示所有点) | ||||||||||
ClippingEndPoints (input_control) |
Number of points at the beginning and at the end of the contours to be ignored for the fitting. Default value: 0 Restriction: ClippingEndPoints >= 0 |
拟合时忽略轮廓开始点和结束点的个数 | ||||||||||
Iterations (input_control) |
Maximum number of iterations (unused for 'regression'). Default value: 5 Restriction: Iterations >= 0 |
最大迭代次数(regression不使用) | ||||||||||
ClippingFactor (input_control) |
Clipping factor for the elimination of outliers (typical: 1.0 for 'huber' and 'drop' and 2.0 for 'tukey'). Default value: 2.0 List of values: 1.0, 1.5, 2.0, 2.5, 3.0 Restriction: ClippingFactor > 0 |
裁剪因子用于消除异常值(典型的:“huber”和“drop”时使用1,“tukey”时使用2) | ||||||||||
RowBegin (output_control) | Row coordinates of the starting points of the line segments. | 线段起始点的行坐标 | ||||||||||
ColBegin (output_control) | Column coordinates of the starting points of the line segments. | 线段起始点的列坐标 | ||||||||||
RowEnd (output_control) | Row coordinates of the end points of the line segments. | 线段结束点的行坐标 | ||||||||||
ColEnd (output_control) | Column coordinates of the end points of the line segments. | 线段结束点的列坐标 | ||||||||||
Nr (output_control) | Line parameter: Row coordinate of the normal vector. | 线参数:向量的行坐标 | ||||||||||
Nc (output_control) | Line parameter: Column coordinate of the normal vector. | 线参数:向量的列坐标 | ||||||||||
Dist (output_control) | Line parameter: Distance of the line from the origin. | 线参数:直线到原点的距离 |
Contour (output_object) | Resulting contour. | 输出的轮廓 |
Row (input_control) |
Row coordinates of the polygon. Default value: [0,1,2,2,2] Suggested values: 0, 1, 2, 3, 4, 5, 10, 20, 50, 100, 200, 500 |
行坐标 |
Col (input_control) |
Column coordinates of the polygon. Default value: [0,0,0,1,2] Suggested values: 0, 1, 2, 3, 4, 5, 10, 20, 50, 100, 200, 500 |
列坐标 |
使用:
- 彩色图像要转成灰色图像。
- 通过阈值等方法获取目标区域。
- 获取区域的边界轮廓。
- 规则的形状可以使用最小外界矩形等获取形状的信息后画出形状。
- 不规则的可以对轮廓分段、选择、排序。获取轮廓线的属性,根据属性,获取坐标等然后拟合线(圆或椭圆)。
read_image (Image, 'E:/照片/轮廓.png')
decompose3 (Image, Image1, Image2, Image3)
trans_from_rgb (Image1, Image2, Image3, ImageResult1, ImageResult2, ImageResult3, 'hsv')
auto_threshold (ImageResult3, Regions, 2)
area_center (Regions, Area, Row, Column)
connection (Regions, ConnectedRegions)
count_obj (ConnectedRegions, Number)dev_set_draw ('margin')
for Index := 1 to Number by 1select_obj (ConnectedRegions, ObjectSelected, Index)area_center (ObjectSelected, Area1, Row1, Column1)*提取感兴趣的特征if (Area1 > 300 and Area1 < 500)dev_clear_window()dev_display (ObjectSelected) boundary (ObjectSelected, RegionBorder, 'outer') gen_contour_region_xld (RegionBorder, Contours, 'border')*规则形状-矩形smallest_rectangle2_xld (Contours, RowRec, ColumnRec, Phi1, LengthRec1, LengthRec2)gen_rectangle2_contour_xld (Rectangle, RowRec, ColumnRec, Phi1, LengthRec1, LengthRec2)*不规则形状-多边形segment_contours_xld (Contours, ContoursSplit, 'lines', 0, 0, 0)select_contours_xld (ContoursSplit, SelectedContours, 'contour_length', 0.5, 200, -0.5, 0.5) sort_contours_xld (SelectedContours, SortedContours, 'upper_left', 'true', 'row')count_obj (SortedContours, Number1)gen_empty_obj (Lines)for Index1 := 1 to Number1 by 1select_obj (SortedContours, ObjectSelected1, Index1)get_contour_global_attrib_xld (ObjectSelected1, 'cont_approx', Attrib)*-1:线 0:椭圆 1:圆if (Attrib == -1)fit_line_contour_xld (ObjectSelected1, 'tukey', 2, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)gen_contour_polygon_xld (Polygon, [RowBegin,RowEnd], [ColBegin,ColEnd])concat_obj (Lines, Polygon, Lines) endifendfor breakendif
endfor
dev_clear_window ()
dev_display (Lines)
Halcon轮廓提取相关推荐
- OpenCV(25)轮廓检测(轮廓提取、属性、近似轮廓、外接矩形和外接圆)
目录 一.轮廓检测基础理论 1.轮廓概述 2.API介绍 1.cv.findContours函数(查找轮廓) 2.cv.drawContours函数(画出轮廓) 检测轮廓并画出:(用二值图检测轮廓) ...
- 边缘检测、Hough变换、轮廓提取、种子填充、轮廓跟踪
转自:http://blog.sina.com.cn/s/blog_6c083cdd0100nm4s.html 7.1 边沿检测 我们给出一个模板 和一幅图象 .不难发现原图中左边暗,右边亮,中间存在 ...
- 基于深度学习的图像边缘和轮廓提取
点击上方"小白学视觉",选择加"星标"或"置顶" 重磅干货,第一时间送达 导读:边缘和轮廓的提取是一个非常棘手的工作,细节也许就会被过强的图 ...
- 一种新型鱼眼图像轮廓提取算法
from: http://www.scimao.com/read/2307651 摘 要:提取鱼眼图像轮廓是利用鱼眼图像的前提.传统提取鱼眼图像轮廓的扫描线逼近法对噪点抑制能力不强,精度差.本 ...
- python opencv轮廓提取_Python + Opencv2 实现轮廓提取,轮廓区域面积计算
对图像处理时,会遇到这样一个场景:找到图像主体轮廓,这是其一,可能为了凸显轮廓,需要用指定的颜色进行标记:轮廓标记完可能任务还没有结束,还需对轮廓所勾勒的像素面积区域统计计算. 本篇文章的主要内容就是 ...
- 【OpenCV函数】轮廓提取;轮廓绘制;轮廓面积;外接矩形
FindContours 在二值图像中寻找轮廓 int cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** first_cont ...
- python cv2 轮廓的包络 面积_Python + Opencv2 实现轮廓提取,轮廓区域面积计算
对图像处理时,会遇到这样一个场景:找到图像主体轮廓,这是其一,可能为了凸显轮廓,需要用指定的颜色进行标记:轮廓标记完可能任务还没有结束,还需对轮廓所勾勒的像素面积区域统计计算. 本篇文章的主要内容就是 ...
- Win8 Metro(C#)数字图像处理--2.40二值图像轮廓提取算法
Win8 Metro(C#)数字图像处理--2.40二值图像轮廓提取算法 原文:Win8 Metro(C#)数字图像处理--2.40二值图像轮廓提取算法 [函数名称] 二值图像轮廓提取 ...
- 基于机器视觉的眼镜镜片轮廓提取
基于机器视觉的眼镜镜片轮廓提取 眼镜的镜片轮廓提取,可以用于镜片轮廓本身的精准度测量,当然用在一些灰色产业链上,如仿制名牌眼镜,通过提取名牌眼镜片的轮廓,得到其数据,然后制作一些高仿的眼镜. 眼镜镜片 ...
最新文章
- Python内置数据结构之双向队列
- 【欧拉回路】解题报告:luogu P6066 [USACO]Watchcow (欧拉回路详解)【模板】
- Rust 语言风靡学术界
- QRadioButton分组且无边框的简单实现
- visual studio code跳转到定义处插件
- 下列代码的执行结果是 php,执行下列代码后的结果是: $x=15; echo $x++; $y=20; echo ++y;...
- java 编译器获得型号_关于编译器构造:如何找到已编译类的目标Java版本?
- 列举Python中常见的内置函数
- e7用什么主板_主板上这么多扩展插槽,都是干什么用的,看了不后悔
- 不用卷积也能生成清晰图像,用两个Transformer构建一个GAN
- 记一次Debian11安装
- python 异步执行多个函数_Python的asyncio模块写多个异步的执行顺序和影响?
- [RabbitMQ]MQ 的分类
- java课程设计进程管理_Java课设总结(个人版)
- linux 29900端口,USB2.0接口100M以太网芯片SR9900(A)的应用
- 实现手机版和电脑端显示不同的广告代码
- 在.net 当中如何XML序列化一个Collection
- datagrivew删除列_c# 如何获取datagrivew 表里面名称为card_id的一列,并把这列里面的元素循环...
- Adminlte数据分页设置
- 日立服务器显示地址操作异常,日立电梯服务器地址操作异常