图像增强可以有很多种理解,但是作者认为无论是什么形式的增强其实它的本质都是图像加有效信息的操作,它的目的都是获取特征更为明显的图像。简单的说,图像增强大致可以分为三种1、分辨率增强 2、对比度及灰度增强 3、特征增强
- 1、图像增强之降噪
Halcon中提供了很多种降噪方式主要可以分为以下几种:
a、基于图像处理的降噪
常见的降噪方法有:高斯滤波、中值滤波、均值滤波、低通滤波、高通滤波、双边带滤波等
morphKernel := 15
gen_rectangle1 (ModelRegion, 410, 1000, 2450, 3500)
reduce_domain (src, ModelRegion, TemplateImage)
binary_threshold (src, StepRegion, 'smooth_histo', 'light', UsedThreshold)
*高通
highpass_image (src, Highpass, 9, 9)
*带通
bandpass_image (src, ImageBandpass, 'lines')
*低通
lowlands (src, Lowlands)
*高斯
gauss_filter (src, ImageGauss, 5)
b、基于特征处理的降噪
一般基于特征的降噪方式并不是一种统称,这里主要的方法有:角点增强、灰度值过滤等
morphKernel := 15
gen_rectangle1 (ModelRegion, 410, 1000, 2450, 3500)
reduce_domain (src, ModelRegion, TemplateImage)
binary_threshold (src, StepRegion, 'smooth_histo', 'light', UsedThreshold)
*划定ROI进行增强
emphasize (TemplateImage, ImageEmphasize, 7, 7, 1)
灰度增强的话要看场景,在有些场景下binary_threshold是个不错的选择,但是大多数情况下都采用动态阈值。当然,也可以采用灰度增强算子
morphKernel := 15
gen_rectangle1 (ModelRegion, 410, 1000, 2450, 3500)
reduce_domain (src, ModelRegion, TemplateImage)
binary_threshold (src, StepRegion, 'smooth_histo', 'light', UsedThreshold)
*特定灰度值增强
scale_image_range (TemplateImage, ImageScaled1, 100, 200)
*最大灰度值增强
scale_image_max (TemplateImage, ImageScaleMax)
*灰度值增强
scale_image (TemplateImage, ImageScaled, 0.01, 0)
- 2、图像增强之补偿
Halcon中常用的补偿方式为Ephasize、illuminate
morphKernel := 15
gen_rectangle1 (ModelRegion, 410, 1000, 2450, 3500)
reduce_domain (src, ModelRegion, TemplateImage)
binary_threshold (src, StepRegion, 'smooth_histo', 'light', UsedThreshold)
*划定ROI进行增强
emphasize (TemplateImage, ImageEmphasize, 7, 7, 1)
*对比度增强
illuminate (TemplateImage, ImageIlluminate, 101, 101, 0.7)
- 3、图像增强之均衡
直方图均衡
equ_histo_image (TemplateImage, ImageEquHisto)
- 4、其它
*1、一致性差异增强
coherence_enhancing_diff (TemplateImage, ImageCED, 0.5, 3, 0.5, 10)
*2、曲率平滑
mean_curvature_flow (Image, ImageMCF, 0.5, 0.5, 10)