《zw版·Halcon-delphi系列原创教程》 Halcon分类函数005·graphics-obj,基本绘图单元,包括线段、矩形、椭圆、圆形
graphics-obj,基本绘图单元,包括线段、矩形、椭圆、圆形
为方便阅读,在不影响说明的前提下,笔者对函数进行了简化:
- :: 用符号“**”,替换:“procedure”
- :: 用大写字母“X”,替换:“IHUntypedObjectX”
- :: 省略了字符:“const”、“OleVariant”
【示例】 说明
函数:
procedure AddNoiseWhiteContourXld( const Contours: IHUntypedObjectX; out NoisyContours: IHUntypedObjectX; NumRegrPoints: OleVariant; Amp: OleVariant);
简化后为:
** AddNoiseWhiteContourXld( Contours: X; out NoisyContours: X; NumRegrPoints, Amp);
1 ** AddMetrologyObjectCircleMeasure( MetrologyHandle, Row, Column, Radius, MeasureLength1, MeasureLength2, MeasureSigma, MeasureThreshold, GenParamName, GenParamValue, out Index); 2 说明, add_metrology_object_circle_measure ( : : MetrologyHandle, Row,Column, Radius, MeasureLength1, MeasureLength2, MeasureSigma,MeasureThreshold, GenParamName, GenParamValue : Index ) 3 4 ** AddMetrologyObjectEllipseMeasure( MetrologyHandle, Row, Column, Phi, Radius1, Radius2, MeasureLength1, MeasureLength2, MeasureSigma, MeasureThreshold, GenParamName, GenParamValue, out Index); 5 说明, 增加一个椭圆或弧形物体,到测量模型当中 6 7 ** AddMetrologyObjectLineMeasure( MetrologyHandle, RowBegin, ColumnBegin, RowEnd, ColumnEnd, MeasureLength1, MeasureLength2, MeasureSigma, MeasureThreshold, GenParamName, GenParamValue, out Index); 8 说明, 增加一个线型物体,到测量模型当中 9 10 ** ApproxChain( Row, Column, MinWidthCoord, MaxWidthCoord, ThreshStart, ThreshEnd, ThreshStep, MinWidthSmooth, MaxWidthSmooth, MinWidthCurve, MaxWidthCurve, Weight1, Weight2, Weight3, out ArcCenterRow, out ArcCenterCol, out ArcAngle, out ArcBeginRow, out ArcBeginCol, out LineBeginRow, out LineBeginCol, out LineEndRow, out LineEndCol, out Order); 11 说明, approx_chain,通过弧和线近似一个轮廓。 12 13 ** ApproxChainSimple( Row, Column, out ArcCenterRow, out ArcCenterCol, out ArcAngle, out ArcBeginRow, out ArcBeginCol, out LineBeginRow, out LineBeginCol, out LineEndRow, out LineEndCol, out Order); 14 说明, approx_chain_simple,通过弧和线近似一个轮廓。 15 16 ** ClosingCircle( Region: X; out RegionClosing: X; Radius); 17 说明, closing_circle,关闭一个圆形结构基础的一个区域。 18 19 ** CombineRoadsXld( EdgePolygons: X; ModParallels: X; ExtParallels: X; CenterLines: X; out RoadSides: X; MaxAngleParallel, MaxAngleColinear, MaxDistanceParallel, MaxDistanceColinear); 20 说明, combine_roads_xld,合并两个等级分辨率中的路(road)。 21 22 ** ConnectGridPoints( Image: X; out ConnectingLines: X; Row, Column, Sigma, MaxDist); 23 说明, connect_grid_points,建立矫正网格的矫正点间的连接。 24 25 ** DilationCircle( Region: X; out RegionDilation: X; Radius); 26 27 ** DispCircle( WindowHandle, Row, Column, Radius); 28 说明, disp_circle,在窗口中显示圆。 29 30 ** DispEllipse( WindowHandle, CenterRow, CenterCol, Phi, Radius1, Radius2); 31 说明, disp_ellipse,显示椭圆。 32 33 ** DispLine( WindowHandle, Row1, Column1, Row2, Column2); 34 说明, disp_line,在窗口中画一条线。 35 36 ** DistEllipseContourPointsXld( Contour: X; DistanceMode, ClippingEndPoints, Row, Column, Phi, Radius1, Radius2, out Distances); 37 说明, dist_ellipse_contour_points_xld,计算所有轮廓,内的点到一个椭圆的距离。 38 39 ** DistEllipseContourXld( Contours: X; Mode, MaxNumPoints, ClippingEndPoints, Row, Column, Phi, Radius1, Radius2, out MinDist, out MaxDist, out AvgDist, out SigmaDist); 40 说明, dist_ellipse_contour_xld,轮廓到一个椭圆的距离。 41 42 ** DrawCircle( WindowHandle, out Row, out Column, out Radius); 43 说明, draw_circle,一个圆的交互绘图。 44 45 ** DrawCircleMod( WindowHandle, RowIn, ColumnIn, RadiusIn, out Row, out Column, out Radius); 46 说明, draw_circle_mod,一个圆的交互绘图。 47 48 ** DrawEllipse( WindowHandle, out Row, out Column, out Phi, out Radius1, out Radius2); 49 说明, draw_ellipse,一个椭圆的交互绘图。 50 51 ** DrawEllipseMod( WindowHandle, RowIn, ColumnIn, PhiIn, Radius1In, Radius2In, out Row, out Column, out Phi, out Radius1, out Radius2); 52 说明, draw_ellipse_mod,一个椭圆的交互绘图。 53 54 ** DrawLine( WindowHandle, out Row1, out Column1, out Row2, out Column2); 55 说明, draw_line,画一根线。 56 57 ** DrawLineMod( WindowHandle, Row1In, Column1In, Row2In, Column2In, out Row1, out Column1, out Row2, out Column2); 58 说明, draw_line_mod,画一根线。 59 60 ** EllipticAxis( Regions: X; out Ra, out Rb, out Phi); 61 说明, elliptic_axis,相似椭圆的参数。 62 63 ** EllipticAxisGray( Regions: X; Image: X; out Ra, out Rb, out Phi); 64 说明, elliptic_axis_gray,在一个灰度值图像中计算一个区域的方位和主轴。 65 66 ** EllipticAxisPointsXld( XLD: X; out Ra, out Rb, out Phi); 67 说明, elliptic_axis_points_xld,被看做点云的轮廓,或多边形(polygon)的等价椭圆参数。 68 69 ** EllipticAxisXld( XLD: X; out Ra, out Rb, out Phi); 70 说明, elliptic_axis_xld,轮廓,或多变形(polygon)的等价椭圆参数。 71 72 ** ErosionCircle( Region: X; out RegionErosion: X; Radius); 73 说明, erosion_circle,腐蚀一个圆形结构基础的一个区域。 74 75 ** ExpandLine( Image: X; out RegionExpand: X; Coordinate, ExpandType, RowColumn, Threshold); 76 说明, expand_line,从给定线开始扩充区域。 77 78 ** Find1DBarCodeScanline( Image: X; out CodeRegion: X; BarCodeDescr, GenericName, GenericValue, StopIfFound, out BarcodeFound, out BarCodeElements, out Orientation, out ScanlineNumPoints, out ScanlineDecoded, out ScanlinePointsRow, out ScanlinePointsColumn); 79 说明, find_1d_bar_code_scanline,搜索一幅图像中的一个条形码。 80 81 ** FitCircleContourXld( Contours: X; Algorithm, MaxNumPoints, MaxClosureDist, 82 83 ** FitEllipseContourXld( Contours: X; Algorithm, MaxNumPoints, MaxClosureDist, 84 85 ** FitLineContourXld( Contours: X; Algorithm, MaxNumPoints, ClippingEndPoints, Iterations, ClippingFactor, out RowBegin, out ColBegin, out RowEnd, out ColEnd, out Nr, out Nc, out Dist); 86 87 ** FnewLine( FileHandle); 88 说明, fnew_line,创建一个换行符。 89 90 ** FreadLine( FileHandle, out OutLine, out IsEOF); 91 说明, fread_line,从一个文本文件中读取一行。 92 93 ** GenCircle( out Circle: X; Row, Column, Radius); 94 说明, gen_circle,创建一个圆周。 95 96 ** GenCircleContourXld( out ContCircle: X; Row, Column, Radius, StartPhi, EndPhi, PointOrder, Resolution); 97 98 ** GenEllipse( out Ellipse: X; Row, Column, Phi, Radius1, Radius2); 99 说明, gen_ellipse,创建一个椭圆。 100 101 ** GenEllipseContourXld( out ContEllipse: X; Row, Column, Phi, Radius1, Radius2, 102 103 ** GenGridRectificationMap( Image: X; ConnectingLines: X; out Map: X; out Meshes: X; GridSpacing, Rotation, Row, Column, MapType); 104 说明, gen_grid_rectification_map,计算扭曲图像与基于规律的网格的正确的图像的映射。 105 106 ** GenRegionHline( out Regions: X; Orientation, Distance); 107 说明, gen_region_hline,将Hesse正规形状中描述的输入线存储为区域。 108 109 ** GenRegionLine( out RegionLines: X; BeginRow, BeginCol, EndRow, EndCol); 110 说明, gen_region_line,将输入线以区域形式存储。 111 112 ** Get1DBarCodeScanline( BarCodeRegion: X; BarCodeDescr, GenericName, GenericValue, Orientation, StopIfFound, out BarCodeElements, out ScanlineNumPoints, out ScanlineDecoded, out ScanlinePointsRow, out ScanlinePointsColumn); 113 说明, get_1d_bar_code_scanline,提取一个条形码区域中元素的宽度。 114 115 ** GetCirclePose( Contour: X; CameraParam, Radius, out putType, out Pose1, out Pose2); 116 说明, get_circle_pose,从一个圆周相应的二维投射中决定它的三维模式。 117 118 ** GetLineApprox( WindowHandle, out Approximation); 119 说明, get_line_approx,获取轮廓显示的现在近似误差。 120 121 ** GetLineOfSight( Row, Column, CameraParam, out Px, out Py, out Pz, out Qx, out Qy, out Qz); 122 说明, get_line_of_sight,计算相应于图像中一个点的视线。 123 124 ** GetLineStyle( WindowHandle, out Style); 125 说明, get_line_style,获取轮廓的现在图解模式。 126 127 ** GetLinesXld( Polygon: X; out BeginRow, out BeginCol, out EndRow, out EndCol, out Length, out Phi); 128 说明, get_lines_xld,返回一个XLD多边形(polygon)数据。 129 130 ** GetLineWidth( WindowHandle, out Width); 131 说明, get_line_width,获取轮廓显示的现在线宽。 132 133 ** GetPointsEllipse( Angle, Row, Column, Phi, Radius1, Radius2, out RowPoint, out ColPoint); 134 135 ** HoughCircles( RegionIn: X; out RegionOut: X; Radius, Percent, Mode); 136 说明, hough_circles,特定半径的圆周的中心。 137 138 ** HoughCircleTrans( Region: X; out HoughImage: X; Radius); 139 说明, hough_circle_trans,返回指定半径的圆周的Hough变换。 140 141 ** HoughLines( RegionIn: X; AngleResolution, Threshold, AngleGap, DistGap, out Angle, out Dist); 142 说明, hough_lines,借助Hough变化查询图像中的线,并将其返回到HNF中。 143 144 ** HoughLinesDir( ImageDir: X; out HoughImage: X; out Lines: X; DirectionUncertainty, AngleResolution, Smoothing, FilterSize, Threshold, AngleGap, DistGap, GenLines, out Angle, out Dist); 145 说明, hough_lines_dir,借助采用局部方向梯度的Hough变换查询图像中的线,并将它们以正常形式返回。 146 147 ** HoughLineTrans( Region: X; out HoughImage: X; AngleResolution); 148 说明, hough_line_trans,对区域中的线进行Hough变换。 149 150 ** HoughLineTransDir( ImageDir: X; out HoughImage: X; DirectionUncertainty, AngleResolution); 151 说明, hough_line_trans_dir,利用局部方向梯度对线进行Hough变换。 152 153 ** InnerCircle( Regions: X; out Row, out Column, out Radius); 154 说明, inner_circle,一个区域内部最大的圆周。 155 156 ** IntersectionCircleContourXld( Contour: X; CircleRow, CircleColumn, CircleRadius, CircleStartPhi, CircleEndPhi, CirclePointOrder, out Row, out Column); 157 说明, 计算xld圆形对象交集。 158 159 ** IntersectionCircles( Circle1Row, Circle1Column, Circle1Radius, Circle1StartPhi, Circle1EndPhi, Circle1PointOrder, Circle2Row, Circle2Column, Circle2Radius, Circle2StartPhi, Circle2EndPhi, Circle2PointOrder, out Row, out Column, out IsOverlapping); 160 说明, 计算圆形对象交集。 161 162 ** IntersectionLineCircle( LineRow1, LineColumn1, LineRow2, LineColumn2, CircleRow, CircleColumn, CircleRadius, CircleStartPhi, CircleEndPhi, CirclePointOrder, out Row, out Column); 163 说明, 计算直线-圆形对象交集。 164 165 ** IntersectionLineContourXld( Contour: X; LineRow1, LineColumn1, LineRow2, LineColumn2, out Row, out Column, out IsOverlapping); 166 说明, 计算直线-轮廓对象交集。 167 168 ** IntersectionLines( Line1Row1, Line1Column1, Line1Row2, Line1Column2, Line2Row1, Line2Column1, Line2Row2, Line2Column2, out Row, out Column, out IsOverlapping); 169 说明, 计算直线-直线对象交集。 170 171 ** IntersectionSegmentCircle( SegmentRow1, SegmentColumn1, SegmentRow2, SegmentColumn2, CircleRow, CircleColumn, CircleRadius, CircleStartPhi, CircleEndPhi, CirclePointOrder, out Row, out Column); 172 说明, 计算圆形分段对象交集。 173 174 ** IntersectionSegmentLine( SegmentRow1, SegmentColumn1, SegmentRow2, SegmentColumn2, LineRow1, LineColumn1, LineRow2, LineColumn2, out Row, out Column, out IsOverlapping); 175 说明, 计算直线分段对象交集。 176 177 ** IntersectLinesOfSight( CamParam1, CamParam2, RelPose, Row1, Col1, Row2, Col2, out X, out Y, out Z, out Dist); 178 说明, 计算直线的交集。 179 180 ** LinearTransColor( Image: X; out ImageTrans: X; TransMat); 181 说明, linear_trans_color,计算多通道图像的颜色值的一个仿射转换。 182 183 ** LineOrientation( RowBegin, ColBegin, RowEnd, ColEnd, out Phi); 184 说明, line_orientation,计算线的方位。 185 186 ** LinePosition( RowBegin, ColBegin, RowEnd, ColEnd, out RowCenter, out ColCenter, out Length, out Phi); 187 说明, line_position,计算一条线的重心、长度和方位。 188 189 ** LinesColor( Image: X; out Lines: X; Sigma, Low, High, ExtractWidth, CompleteJunctions); 190 说明, lines_color,检测色线和它们的宽度。 191 192 ** LinesFacet( Image: X; out Lines: X; MaskSize, Low, High, LightDark); 193 说明, lines_facet,使用面模型检测线。 194 195 ** LinesGauss( Image: X; out Lines: X; Sigma, Low, High, LightDark, ExtractWidth, LineModel, CompleteJunctions); 196 197 ** MergeContLineScanXld( CurrConts: X; PrevConts: X; out CurrMergedConts: X; out PrevMergedConts: X; ImageHeight, Margin, MergeBorder, MaxImagesCont); 198 说明, merge_cont_line_scan_xld,合并连续线扫描图像中的XLD轮廓,。 199 200 ** MergeRegionsLineScan( CurrRegions: X; PrevRegions: X; out CurrMergedRegions: X; out PrevMergedRegions: X; ImageHeight, MergeBorder, MaxImagesRegion); 201 说明, merge_regions_line_scan,从行扫描图像合并区域。 202 203 ** NewLine( WindowHandle); 204 说明, new_line,设置下一行的开始文本光标的位置。 205 206 ** OpenFramegrabber( Name, HorizontalResolution, VerticalResolution, ImageWidth, ImageHeight, StartRow, StartColumn, Field, BitsPerChannel, ColorSpace, Generic, ExternalTrigger, CameraType, Device, Port, LineIn, out AcqHandle); 207 说明, open_framegrabber,打开并配置一个图像获取设备。 208 209 ** OpeningCircle( Region: X; out RegionOpening: X; Radius); 210 说明, opening_circle,打开一个圆形结构基础的一个区域。 211 212 ** PartitionLines( RowBeginIn, ColBeginIn, RowEndIn, ColEndIn, Feature, Operation, Min, Max, out RowBeginOut, out ColBeginOut, out RowEndOut, out ColEndOut, out FailRowBOut, out FailColBOut, out FailRowEOut, out FailColEOut); 213 说明, partition_lines,通过各种标准区分线。 214 215 ** QueryLineWidth( out Min, out Max); 216 说明, query_line_width,查询可能的线宽。 217 218 ** SegmentCharacters( Region: X; Image: X; out ImageForeground: X; out RegionForeground: X; Method, EliminateLines, DotPrint, StrokeWidth, CharWidth, CharHeight, ThresholdOffset, Contrast, out UsedThreshold); 219 说明, segment_characters,将图像给定区域的字符分割。 220 221 ** SelectCharacters( Region: X; out RegionCharacters: X; DotPrint, StrokeWidth, CharWidth, CharHeight, Punctuation, DiacriticMarks, PartitionMethod, PartitionLines, FragmentDistance, ConnectFragments, ClutterSizeMax, StopAfter); 222 说明, select_characters,从一个给定区域中选择字符。 223 224 ** SelectLines( RowBeginIn, ColBeginIn, RowEndIn, ColEndIn, Feature, Operation, Min, Max, out RowBeginOut, out ColBeginOut, out RowEndOut, out ColEndOut); 225 说明, select_lines,通过各种标准选择线。 226 227 ** SelectLinesLongest( RowBeginIn, ColBeginIn, RowEndIn, ColEndIn, Num, out RowBeginOut, out ColBeginOut, out RowEndOut, out ColEndOut); 228 说明, select_lines_longest,选择最长输入线。 229 230 ** SelectMatchingLines( RegionIn: X; out RegionLines: X; AngleIn, DistIn, LineWidth, Thresh, out AngleOut, out DistOut); 231 说明, select_matching_lines,选取HNF中线的集合中匹配区域最好的线。 232 233 ** SetLineApprox( WindowHandle, Approximation); 234 说明, set_line_approx,定义输出显示的近似误差。 235 236 ** SetLineStyle( WindowHandle, Style); 237 说明, set_line_style,定义一个轮廓输出模式。 238 239 ** SetLineWidth( WindowHandle, Width); 240 说明, set_line_width,定义区域轮廓输出的线宽。 241 242 ** SmallestCircle( Regions: X; out Row, out Column, out Radius); 243 说明, smallest_circle,一个区域的最小周长。 244 245 ** SmallestCircleXld( XLD: X; out Row, out Column, out Radius); 246 说明, smallest_circle_xld,轮廓,或多边形(polygon)的最小封闭圆。 247 248 ** SplitSkeletonLines( SkeletonRegion: X; MaxDistance, out BeginRow, out BeginCol, out EndRow, out EndCol); 249 250 ** SplitSkeletonRegion( SkeletonRegion: X; out RegionLines: X; MaxDistance); 251 252 ** TextLineOrientation( Region: X; Image: X; CharHeight, OrientationFrom, OrientationTo, out OrientationAngle); 253 说明, text_line_orientation,决定一个文本行或段落的定向(定位)。 254 255 ** TextLineSlant( Region: X; Image: X; CharHeight, SlantFrom, SlantTo, out SlantAngle); 256 说明, text_line_slant,决定一个文本行或段落的字符的倾斜。 257 258 ** UnionCollinearContoursExtXld( Contours: X; out UnionContours: X; MaxDistAbs, MaxDistRel, MaxShift, MaxAngle, MaxOverlap, MaxRegrError, MaxCosts, WeightDist, WeightShift, WeightAngle, WeightLink, WeightRegr, Mode); 259 260 ** UnionCollinearContoursXld( Contours: X; out UnionContours: X; MaxDistAbs, MaxDistRel, MaxShift, MaxAngle, Mode); 261 262 ** UnionStraightContoursHistoXld( Contours: X; out UnionContours: X; out SelectedContours: X; RefLineStartRow, RefLineStartColumn, RefLineEndRow, RefLineEndColumn, Width, MaxWidth, FilterSize, out HistoValues); 263 说明, union_straight_contours_histo_xld,合并到给定线有相似距离的相邻直线轮廓,。
时间: 2024-10-29 19:12:08