开启左侧

玻璃气泡检测

[复制链接]
extjs520 发表于 2020-9-2 19:08:56 | 显示全部楼层 |阅读模式
最近项目中遇到个难题,检测玻璃中的气泡,如图,有哪位大神帮帮忙 给个思路,能有代码过程最好,
未命名.jpg
mediation 发表于 2020-9-3 10:39:27 | 显示全部楼层
雾里看花 发表于 2020-9-3 08:42
AI轻松解决,,,,,,,,,,,,,

现在做什么都是用深度学习了。。。。。。。。。不过深度学习确实牛
小风风 发表于 2020-9-23 10:57:33 | 显示全部楼层
read_image (Image190809izmjvng46uw16jzu, 'G:/Desktop/190809izmjvng46uw16jzu.jpg')
rgb1_to_gray (Image190809izmjvng46uw16jzu, Image190809izmjvng46uw16jzu)
gen_rectangle1 (ROI_0, 2.91772, 6.26725, 657.095, 892.871)
reduce_domain (Image190809izmjvng46uw16jzu, ROI_0, ImageReduced)
crop_domain (ImageReduced, ImagePart)

median_image (ImagePart, ImageMedian, 'circle', 3, 'mirrored')
mult_image (ImageMedian, ImageMedian, ImageResult, 0.01, 0)
gray_erosion_rect (ImageResult, ImageMin, 11, 11)
mean_image (ImageMin, ImageMean, 9, 9)
dyn_threshold (ImageMin, ImageMean, RegionDynThresh, 7, 'dark')
opening_rectangle1 (RegionDynThresh, RegionOpening, 3, 3)


get_image_size (ImagePart, Width, Height)
rft_generic (ImagePart, ImageFFT, 'to_freq', 'none', 'complex', Width)
gen_gauss_filter (ImageGauss, 100, 100, 0, 'n', 'rft', Width, Height)
convol_fft (ImageFFT, ImageGauss, ImageConvol)
rft_generic (ImageConvol, ImageFFT1, 'from_freq', 'none', 'byte', Width)
sub_image (ImagePart, ImageFFT1, ImageSub, 2, 100)

calculate_lines_gauss_parameters (10, [20,10], Sigma, Low, High)
lines_gauss (ImageReduced, Lines, Sigma, Low, High, 'dark', 'true', 'gaussian', 'true')
   

翱翔 发表于 2020-9-24 10:46:58 | 显示全部楼层
halcon的深度学习目标检测或语义分割很好解决这种特征
zxyyy 发表于 2020-11-10 09:22:50 | 显示全部楼层
dev_set_draw('margin')

read_image (Image190809izmjvng46uw16jzu, 'C:/Users/zhangxueying7/Desktop/190809izmjvng46uw16jzu.jpg')
emphasize(Image190809izmjvng46uw16jzu, ImageEmphasize, 11, 11, 1)
invert_image(ImageEmphasize, ImageInvert)
threshold(ImageInvert, Region, 130, 255)
remove_noise_region(Region, OutputRegion, 'n_8')
closing_circle(OutputRegion, RegionClosing, 3.5)
connection(RegionClosing, ConnectedRegions)
shape_trans(ConnectedRegions, RegionTrans, 'convex')
select_shape(RegionTrans, SelectedRegions, ['circularity','outer_radius'], 'and', [0.6,5], [1,999])
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表