halcon常用算法

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1、read_image(Image,'F:/image/001.bmp')读入图像2、threshold(Image,region,100,200)阈值分割,获取区域3、dev_close_window()关闭当前图形窗口4、dev_open_window(0,0,640,480,'black',WindowHandle)打开一个新的图像窗口5、decompose3(Image,Red,Green,Blue)三通道图像转换成三幅单通道图像5.5、compose3(Red,Green,Blue,Image)三幅单通道图像组合为三通道图像6、connection(Region,ConnectedRegions)将像素有相连的区域合并成一个元素element7、count_obj(ConnectedRegions,Number)计算元素element的个数8、select_shape(Regions,SelectedRegions,Features,Operation,Min,Max)select_shape(ConnectedRegions,SelectedRegions,['area','anisometry'],'and',[500,1.0],[50000,1.7])连通域形状的选择circularity:表示环状;充实度roundness:圆度9、dev_set_color('red')设定输出的颜色10、dev_set_draw('margin')或者dev_set_draw('fill')确定区域填充模式11、get_image_size(Image,Width,Height)得到图像的宽度和高度12、get_image_pointer1(Image_slanted,Pointer,Type,Width,Height)设定Pointer指向Image_slanted的起点位置。13、dev_set_part(0,0,Height-1,Width-1)设定图像需要显示的范围14、dev_display(Image_slanted)显示图像15、disp_continue_message(WindowHandle,'blue','false')等待用户操作是否继续stop()16、projective_trans_image(Image_slanted,Image_rectified,HomMat2D,'bilinear','false','false')将投影变换应用于一幅图像中。17、dev_set_line_width(5)为区域轮廓线设定线宽18、disp_message(WindowHandle,'Decodedstring:','window',-1,-1,'black','true')程序写一个文本信息19、union_collinear_contours_xld合并在同一直线的XLDunion_cocircular_contours_xld合并在同圆的XLDunion_adjacent_contours_xld合并邻近的XLD20、fit_line_contour_xld拟合直线21、trans_from_rgb(Rimage,Gimage,Bimage,Image1,Image2,Image3,'hsv')rgb颜色空间图像转换到hsv颜色空间图像22、trans_to_rgb(Image1,Image2,Image3,ImageRed,ImageGreen,ImageBlue,'hsv')hsv颜色空间图像转换到rgb颜色空间图像23、set_display_font(WindowID,20,'mono','true','false')设置字体(bottle.hdev)24、fill_up_shape(RawSegmentation,RemovedNoise,'area',1,5)根据给定的形状特征填补区域中的不足25、opening_circle(RemovedNoise,ThickStructures,2.5)以半径为2.5像素先腐蚀再膨胀,开运算去除小区域。26、fill_up(ThickStructures,Solid)填补区域中的空洞27、intersection(ConnectedPatterns,ThickStructures,NumberCandidates)求两个区域的交集然后输出,求ConnectedPatterns区域和ThickStructures区域的交集,输出NumberCandidates28、dev_set_shape('rectangle1')设置外接矩形29、distance_lr(SelectedRegions,Row1,Col1,Row2,Col2,DistanceMin,DistanceMax)计算直线和区域之间的距离,出现最小距离和最大距离30、disp_line(WindowID,Row1,Col+100,Row2,Col)绘制直线段(Col+100,Row1)为起点,(Col,Row2)为终点30.5、disp_circle(WindowID,RowPoint,ColPoint,10)在指定点(ColPoint,RowPoint)绘制直接为10的圆注意:y1=Row1,x1=Col+100.y2=Row2,x2=Col.先y后x的值(distance_lr.hdev)31、distance_pc(Hole,Row,Column,DistanceMin,DistanceMax)计算点到轮廓之间的最大距离和最小距离,其中(Column,Row)为规定的点。32、edges_sub_pix(Rim,Edges,'lanser2',0.3,10,40)使用Deriche,Lanser,Shen,orCannyfilters等算子提取精确的亚像素边缘。33、sort_contours_xld(Holes,Holes,'upper_left','true','row')根据相对位置选择轮廓34、smallest_circle_xld(Holes,Row,Column,Radius)确定完整的圆35、disp_cross(WindowID,Row[i-1],Column[i-1],6,0)在指定点的位置绘制一个十字标记36、get_region_contour(SelectedRegions,Rows,Columns)访问一个已经确定区域的轮廓37、distance_pl(Rows[i],Columns[i],RowLine1,ColLine1,RowLine2,ColLine2,Distance)点到直线的距离38、distance_ss(Rows,Columns,Rows+n,Columns+n,RowLine1,ColLine1,RowLine2,ColLine2,DistanceMin,DistanceMax)计算两线段之间的距离(distance_ss)39、distance_pp(RowPoint,ColPoint,Rows[i],Columns[i],Distance)计算一个点(ColPoint,RowPoint)到另一个点(Columns[i],Rows[i])直接的距离。40、distance_sr(SelectedRegions,Row1+n,Col,Row2-n,Col+100,DistanceMin,DistanceMax)计算直线段到区域之间的距离(distance_sr)41、auto_threshold(Image,Regions,4)由直方图确定的阈值以分割图像42、tuple_rad(degree,radian)角度转换为弧度43、dilation_circle(SelectedRegions,RegionDilation,3.5)以半径为3.5的圆扩展给定区域44、erosion_circle(RegionFillUp,RegionErosion,3.5)以半径为3.5的圆腐蚀给定区域45、fill_up_shape(RegionDilation,RegionFillUp,'area',1,300)按照给定的形状特征填充区域中的空洞46、fill_up(RegionErosion,RegionFillUp2)直接填充区域中的空洞47、difference(RegionFillUp2,RegionErosion,RegionDifference)计算两者区域的不同48fit_ellipse_contour_xld(Contours1,'fitzgibbon',-1,0,0,200,3,2,Row1,Column1,Phi1,Radius1,Radius2,StartPhi,EndPhi,PointOrder)使用椭圆和椭圆弧近似XLD轮廓线49gen_ellipse_contour_xld(ContEllipse1,Row1,Column1,Phi1,Radius1,Radius2,0,6.28318,'positive',1.5)相关于椭圆弧创建一个XLD轮廓50gen_measure_rectangle2(Row,Column,Phi,Length1,Length2,Width,Height,Interpolation,MeasureHandle)51measure_pairs(Image,MeasureHandle,Sigma,Threshold,Transition,Select,RowEdgeFirst,ColumnEdgeFirst,AmplitudeFirst,RowEdgeSecond,ColumnEdgeSecond,AmplitudeSecond,IntraDistance,InterDistance)

1 / 2
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功