一直想写一篇关于数据增强的文章,奈何做的项目比较少,导致部分内容存在纸上谈兵的嫌疑,刚好,最近一年在缺陷检测及尺寸测量上有了一定想项目经验,特此写下本篇博客,希望对各位博友有所帮助
1、滤波网络
常用的滤波网络包括:高通滤波、低通滤波、中值滤波网络等,上述常用的网络其实在现实的应用场景中用的比较少,除了上述网络外还有高斯滤波,均值滤波等,这种网络有利于除去图像中的噪点,
高通滤波
highpass_image (Image, Highpass, 9, 9)
对比如下:
低通滤波
lowlands (Image, Lowlands)
带通滤波
bandpass_image (Image, ImageBandpass, 'lines')
高斯滤波
gauss_filter (Image, ImageGauss, 5)
均值滤波
mean_image (Image, ImageMean, 9, 9)
2、图像增强
Halcon自带图像增强
Halcon自带的图像增强算法效果还是比较好的
emphasize (Image, ImageEmphasize, 7, 7, 2)
图像乘法
scale_image (Image, ImageScaled, 10, 0)
图像加法
add_image (Image, ImageEmphasize, ImageResult, 0.5, 0)
对数变换
log_image (Image, LogImage, 'e')
指数变换
exp_image (Image, ExpImage, 'e')
图像取反
invert_image (Image, ImageInvert)

拉普拉斯核
拉普拉斯核常用在边沿提取上,一般为对称矩阵,能突出图像中的急剧灰度变化,抑制灰度缓慢变化区域,往往会产生暗色背景下的灰色边缘和不连续图像。将拉普拉斯图像与原图叠加,可以得到保留锐化效果的图像
laplace_of_gauss (Image, ImageLaplace, 2)
卷积网络
所提卷积为传统算法中的一种滤波网络,与深度学习中的卷积网络有所不同,卷积核亦不同。当然其原理是相似的,都是一种滤波器。
sobelXright := [3,3,1, \
-1,0,1, \
-2,0,2, \
-1,0,1 ]
* 看kernel结构,我们可以推断出,将检测出图像中X方向由暗到亮的边缘
convol_image (Image, ImageResultxright, sobelXright, 'mirrored')
快速傅里叶变换
rft_generic (Image, ImageFFT, 'to_freq', 'sqrt', 'complex', 16)