勇哥的实验,常见halcon图像过滤器的测试:主要图像滤波器介绍(按功能分类)

勇哥注:

图片过滤器是一切缺陷检测、边缘提取、图片分割前处理、分类器应用等等的基础。有很重要的研究意义。

因此勇哥会写成一个系列贴子以和大家一起分享。


-正文---------------------------------------------------------------------

下面是官方文档,勇哥把它编辑了一下做为本系列贴子的第一篇。

它先介绍一下halcon的过滤器使用reduce_domain图像要注意的问题。
最后再介绍halcon的全部常见的过滤器(按功能分类)


像过滤器应用reduce domain图像的问题


过滤器几乎是每个机器视觉应用程序的重要组成部分。例如,mean_image可用于平滑图像, edges_sub_pix提取子像素的精确边缘以及fft_image 计算图像的快速傅立叶变换。 

在下面的内容中,我们将仔细研究特殊情况:将具有reduce domain的图像用作滤镜的输入,以及由图像域外部的灰度值引起的问题。

图像滤镜,蒙版和reduced domain缩小域

如果将使用蒙版的滤镜应用于reduced domain的图像,则沿域边界的结果可能会令人吃惊,因为位于边界外部的灰度值用作滤波过程的输入。要理解这一点,您必须在以下情况下考虑域的定义:对于过滤器,域定义了必须为哪些输入像素计算输出像素。但是可以将域外的像素(位于图像矩阵内)用于处理。

由Image域外部的灰度值引起的问题

将图像作为输出的运算符(大多数过滤器运算符)仅返回输入域中包含的像素的结果。

出于性能原因,位于图像域之外的像素将变为“未定义”。这些未定义的像素可能因系统而异,例如,是否激活并行化。如果在具有相同配置的系统上重复执行该程序,则仅保证值是一致的。在某些情况下,这些“未定义”像素可能会导致问题。使用命令full_domain将生成的图像扩展到整个域会导致伪像出现在先前的图像域之外。


导致问题的另一个原因是,如果连续应用两个或多个过滤器,则域外的未定义值也会被应用,因为这些过滤器也会将未定义值视为靠近域边界。这意味着从后面到中间,每个后续过滤器的误差都会增加。


在下文中,提出了解决这些问题的四种策略。

image.png

应用两个连续的过滤器后,在域边界的伪影。


例如,通过选择一个比实际需要的图像部分大很多的域,可以轻松地防止由未定义像素引起的错误。过滤器应用后,可以将图像域缩小到其原始大小(例如,使用erosion_rectangle1reduce_domain)。这样做会切除图像中包含不正确值的那些部分,因此不会增加下一个滤镜操作的误差。 

另一个选择是将域完全设置为图像中感兴趣部分的大小,然后在应用滤镜之前调用运算符expand_domain_gray 。此运算符将边界内的像素复制到边界外,因此避免了由域外未定义的像素引起的错误。随后,可以再次将域减小到其原始大小。接下来的每个过滤器操作都应重复此过程。但是请注意,此选项会大大增加运行时间。 


image.png

看起来 expand_domain_gray的结果就像边界被多次复制并在外部添加一样。 


1. 如果运行时不是问题,则可以在将第一个过滤器应用于图像之前调用full_domain运算符。这样,整个图像被定义为域,并且完全避免了未定义的像素。 

2. 获得没有未定义像素的图像的另一种可能性是通过在应用滤镜之前调用crop_domaincrop_domain运算符。操作员将图像裁剪为域的大小,这意味着域将覆盖完整的较小图像。但是请注意,对于裁剪后的图像,坐标系相对于原始图像已更改,这将影响所有后续应用程序,具体取决于图像坐标系(例如,计算重心)。 





halcon的常见过滤器(按功能分类)

(一)Arithmetic    (算术

  • abs_image

  • Calculate the absolute value (modulus) of an image.

  • exp_image

  • Calculate the exponentiation of an image.

  • gamma_image

  • Perform a gamma encoding or decoding of an image.

  • log_image

  • Calculate the logarithm of an image.

  • max_image

  • Calculate the maximum of two images pixel by pixel.

  • min_image

  • Calculate the minimum of two images pixel by pixel.


(二)Bit         (

  • bit_and

  • Bit-by-bit AND of all pixels of the input images.

  • bit_mask

  • Logical “AND” of each pixel using a bit mask.

  • bit_not

  • Complement all bits of the pixels.

  • bit_or

  • Bit-by-bit OR of all pixels of the input images.

  • bit_xor

  • Bit-by-bit XOR of all pixels of the input images.


(三)Color    (颜色

  • cfa_to_rgb

  • Convert a single-channel color filter array image into an RGB image.

  • create_color_trans_lut

  • Creates the look-up-table for transformation of an image from the RGB color space to an arbitrary color space.

  • linear_trans_color

  • Compute an affine transformation of the color values of a multichannel image.

  • principal_comp

  • Compute the principal components of multichannel images.

  • trans_from_rgb

  • Transform an image from the RGB color space to an arbitrary color space.

  • trans_to_rgb

  • Transform an image from an arbitrary color space to the RGB color space.



(四)Edges    (边缘

  • close_edges

  • Close edge gaps using the edge amplitude image.

  • edges_color

  • Extract color edges using Canny, Deriche, or Shen filters.

  • edges_image

  • Extract edges using Deriche, Lanser, Shen, or Canny filters.

  • edges_sub_pix

  • Extract sub-pixel precise edges using Deriche, Lanser, Shen, or Canny filters.

  • frei_amp

  • Detect edges (amplitude) using the Frei-Chen operator.

  • frei_dir

  • Detect edges (amplitude and direction) using the Frei-Chen operator.

  • kirsch_amp

  • Detect edges (amplitude) using the Kirsch operator.

  • kirsch_dir

  • Detect edges (amplitude and direction) using the Kirsch operator.

  • laplace

  • Calculate the Laplace operator by using finite differences.

  • prewitt_amp

  • Detect edges (amplitude) using the Prewitt operator.

  • prewitt_dir

  • Detect edges (amplitude and direction) using the Prewitt operator.

  • roberts

  • Detect edges using the Roberts filter.

  • robinson_amp

  • Detect edges (amplitude) using the Robinson operator.

  • robinson_dir

  • Detect edges (amplitude and direction) using the Robinson operator.

  • sobel_amp

  • Detect edges (amplitude) using the Sobel operator.

  • sobel_dir

  • Detect edges (amplitude and direction) using the Sobel operator.



(五)Enhancement    (增强功能

  • scale_image_max

  • Maximum gray value spreading in the value range 0 to 255.



(六)FFT    (快速傅立叶变换

  • convol_fft

  • Convolve an image with a filter in the frequency domain.

  • convol_gabor

  • Convolve an image with a Gabor filter in the frequency domain.

  • correlation_fft

  • Compute the correlation of two images in the frequency domain.

  • fft_generic

  • Compute the fast Fourier transform of an image.

  • fft_image

  • Compute the fast Fourier transform of an image.

  • fft_image_inv

  • Compute the inverse fast Fourier transform of an image.

  • phase_deg

  • Return the phase of a complex image in degrees.

  • phase_rad

  • Return the phase of a complex image in radians.

  • power_byte

  • Return the power spectrum of a complex image.

  • power_ln

  • Return the power spectrum of a complex image.

  • power_real

  • Return the power spectrum of a complex image.

  • rft_generic

  • Compute the real-valued fast Fourier transform of an image.



(七)Geometric Transformations    (几何变换


(八)Inpainting    (修补) 


  

(九)Lines    (线



(十)Match    (匹配)

  • monotony

  • Calculating the monotony operation.



(十一)Misc    (杂项

  • convol_image

  • Calculate the correlation between an image and an arbitrary filter mask

  • deviation_n

  • Calculate standard deviation over several channels.

  • expand_domain_gray

  • Expand the domain of an image and set the gray values in the expanded domain.

  • gray_inside

  • Calculate the lowest possible gray value on an arbitrary path to the image border for each point in the image.

  • lut_trans

  • Transform an image with a gray-value look-up-table

  • symmetry

  • Symmetry of gray values along a row.



(十二)Noise    (噪声



(十三)Optical Flow    (光流



(十四)Points    (

  • points_harris

  • Detect points of interest using the Harris operator.



(十五)Scene Flow    (场景流

  • scene_flow_calib

  • Compute the calibrated scene flow between two stereo image pairs.



(十六)Smoothing    (平滑处理

  图像平滑介绍

  • eliminate_sp

  • Replace values outside of thresholds with average value.

  • mean_n

  • Average gray values over several channels.

  • mean_sp

  • Suppress salt and pepper noise.

  • median_rect

  • Compute a median filter with rectangular masks.

  • midrange_image

  • Calculate the average of maximum and minimum inside any mask.

  • rank_image

  • Compute a rank filter with arbitrary masks.

  • rank_n

  • Return gray values with given rank from multiple channels.

  • rank_rect

  • Compute a rank filter with rectangular masks.


(十七)Texture Inspection    (纹理检查

  • deviation_image

  • Calculate the standard deviation of gray values within rectangular windows.

  • entropy_image

  • Calculate the entropy of gray values within a rectangular window.



(十八)Wiener Filter    (维纳过滤器)

  • gen_psf_defocus

  • Generate an impulse response of an uniform out-of-focus blurring.

  • gen_psf_motion

  • Generate an impulse response of a (linearly) motion blurring.




本文出自勇哥的网站《少有人走的路》wwww.skcircle.com,转载请注明出处!讨论可扫码加群:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

会员中心
搜索
«    2024年4月    »
1234567
891011121314
15161718192021
22232425262728
2930
网站分类
标签列表
最新留言
    热门文章 | 热评文章 | 随机文章
文章归档
友情链接
  • 订阅本站的 RSS 2.0 新闻聚合
  • 扫描加本站机器视觉QQ群,验证答案为:halcon勇哥的机器视觉
  • 点击查阅微信群二维码
  • 扫描加勇哥的非标自动化群,验证答案:C#/C++/VB勇哥的非标自动化群
  • 扫描加站长微信:站长微信:abc496103864
  • 扫描加站长QQ:
  • 扫描赞赏本站:
  • 留言板:

Powered By Z-BlogPHP 1.7.2

Copyright Your skcircle.com Rights Reserved.

鄂ICP备18008319号


站长QQ:496103864 微信:abc496103864