商品房合同备案查询,优化设计答案四年级上册语文,wordpress连接sql,平凉市住房和城乡建设局网站文章目录处理要求处理方法一源码效果方法二源码效果博主写作不容易#xff0c;孩子需要您鼓励 万水千山总是情 , 先点个赞行不行
处理要求
查找纸箱内瓶子个数
处理方法一
源码
dev_clear_window ()
dev_open_window (0, 0, 640*1.5, 512*1.5, black, WindowHandle…
文章目录处理要求处理方法一源码效果方法二源码效果博主写作不容易孩子需要您鼓励 万水千山总是情 , 先点个赞行不行
处理要求
查找纸箱内瓶子个数
处理方法一
源码
dev_clear_window ()
dev_open_window (0, 0, 640*1.5, 512*1.5, black, WindowHandle)
* Image Acquisition 01: Code generated by Image Acquisition 01
list_files (F:/HALCON/瓶盖识别/1, [files,follow_links], ImageFiles)
tuple_regexp_select (ImageFiles, [\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima|hobj)$,ignore_case], ImageFiles)
for Index : 0 to |ImageFiles| - 1 by 1read_image (Image, ImageFiles[Index])* Image Acquisition 01: Do somethingmean_image (Image, ImageMean, 19, 19)sub_image (ImageMean, Image, ImageSub, 1, 1)mean_image (ImageSub, ImageMean1, 19, 19)dyn_threshold (ImageSub, ImageMean1, RegionDynThresh, 4, light)connection (RegionDynThresh, ConnectedRegions)select_shape (ConnectedRegions, SelectedRegions, area, and, 711.57, 20000) select_shape (SelectedRegions, SelectedRegions1, [width,height], and, [0,0], [200,200])union1 (SelectedRegions1, RegionUnion)closing_circle (RegionUnion, RegionClosing, 20)fill_up (RegionClosing, RegionFillUp)difference (RegionFillUp, RegionClosing, RegionDifference)connection (RegionDifference, ConnectedRegions1) count_obj (ConnectedRegions1, Number)dev_display (Image)dev_display (ConnectedRegions1)set_display_font (WindowHandle, 50, mono, true, false)disp_message (WindowHandle, [箱内有瓶][Number], image, 30, 30, [blue], false) stop()endfor效果 方法二
源码
list_files (F:/HALCON/瓶盖识别/2, [files,follow_links], ImageFiles)
tuple_regexp_select (ImageFiles, [\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima|hobj)$,ignore_case], ImageFiles)
for Index : 0 to |ImageFiles| - 1 by 1read_image (Image, ImageFiles[Index])smooth_image(Image, ImageSmooth, deriche2, 0.5)edges_color_sub_pix(ImageSmooth, Edges, canny, 2, 10, 20)segment_contours_xld(Edges, ContoursSplit, lines_circles, 5, 5, 3)union_cocircular_contours_xld(ContoursSplit, UnionContours, 0.5, 0.1, 0.2, 30, 10, 10, true, 1)select_shape_xld (UnionContours, SelectedXLD1, [ra,rect2_len1,circularity], and, [15,30,0.3], [50,65,1])fit_circle_contour_xld(SelectedXLD1, algebraic, -1, 0, 0, 3, 2, Row, Column, Radius, StartPhi, EndPhi, PointOrder)gen_circle_contour_xld(ContCircle, Row, Column, Radius, 0, 6.28318, positive, 1)select_shape_xld (ContCircle, SelectedXLD, [ra,area], or, [36,3200], [50,5000])dev_display(Image)dev_display(SelectedXLD)stop()
endfor效果 ------------------------------------------------------------------------------------------分割线
------------------------------------------------------------------------------------------博主简介工业自动化上位机软件工程师、机器视觉算法工程师、运动控制算法工程师。目前从业于智能制造自动化行业。 博主邮箱2296776525qq.com 帮忙点个赞吧。哈哈。