VisionPro CogIPOneImageTool工具 單幅圖像處理工具


CogIPOeImageTool工具的功能原理

CogIPOneImageTool工具主要用來對單張圖像進行算法處理操作,其內部封裝許多圖像處理算法。

1、加減常量

此算法為圖像中的每一個像素點的像素值加上一個常量,創建一個新的圖像,對於彩色圖像,需要對每一個圖層單獨執行加鹼操作。

2、3x3卷積運算

利用3X3核對圖像執行卷積運算。

3、NxM卷積運算

利用NxM核對圖像執行卷積運算,N、M可以任意設置。

4、均衡

對連續獲得的圖像進行重新映射,以使圖像具有相同的灰度值,此算法主要用再光線有輕微變換時候,可以幫助你確保不相干的環境變換不會對系統的整體結果產生影響。

5、擴展

此算法可以通過放大系數對圖像或圖像一部分進行擴展,可以單獨對X軸或Y軸進行擴展。

6、反轉/旋轉

此算法對圖像或圖像的一部分進行水平翻轉或順時針方向旋轉。

7、高斯采樣

對輸入圖像進行二次采樣,使輸出的圖像只包含源圖像的一部分像素,可以起到平滑圖像的作用。

8、灰度形態調整

利用3x3核對輸入圖像進行灰度形態調整,根據特征的尺寸和方向有選擇地增強或減弱模型特征。

9、NxM灰度形態調整

利用NxM核對圖像進行灰度形態調整。

10、高通過濾

此算法先執行高斯平滑運算,然后用源圖像減去高斯平滑后的圖像,可以用此算法來增強圖像中的重要特征。

11、3x3中值操作

3x3中值操作可以用來消除圖像中的噪聲,關於3x3中值操作的詳細原理請參考相關書籍。此操作步需要設置任何參數,但要注意,此操作會減小圖像的尺寸,每執行一次此操作,圖像會減小2行2列。

12、丟失像素

將一些未知像素用固定的像素值替代,或根據對周圍像素的分析確定一個替代值。

13、乘以常數

圖像中的每一個像素點的像素值都乘以一個常數,如果常數值在0和1之間,則相對於除以一個大於1的值。如果是彩色圖像,可以單獨對每一個圖層乘以常數。

14、量化

量化操作可以將具有相同灰度值的特征獨立出來,或者是將想要的特征減小為某一個單獨的像素值。

15、采樣卷積

同時進行采樣和卷積操作,可以起到平滑圖像的作用。

 

Image Processing Operations

 

The Image Processing One Image tool edit control allows you to choose the following image processing operations:

Image Processing Operations
Operator Description

Add/Subtract Constant

Add a positive or negative value to the grey value of each pixel in the greyscale image, generating an image that is artificially lighter or darker than the original. For input images of type CogImage24PlanarColor, values are added to Plane 0 (red), Plane 1 (green), and Plane 2 (blue). You might add a value so that the output image contains only the darkest features from the input image, as shown in the following example:

 

 

 

 

The following figure shows an example where the red component has been reduced by a high constant value:

 

 

 

 

You must also choose whether pixel values that fall below 0 or exceed 255 after the operation are allowed to wrap or be clamped to these limits. For example, in the case of a greyscale image, if you allow the values to wrap then a pixel with a grey value of 200 that has the value 100 added to it has the new value of 45 (200 + 100 - 255). If you choose to clamp the values then the same pixel does not exceed the value 255 after the operation.

Convolve 3x3

Convolve the input image with a 3x3 kernel of floating-point values. You can use this function, in conjunction with other image processing operators, to implement custom image processing operations, as shown in the following example:

 

 

 

 

Note that this operator always wraps output values rather than clamping them.

ConvolveNxM

Processing the image with a kernel of floating-point values of a size you specify. Use the NxM filter to perform a variety of image processing operations such as edge sharpening, edge detection, and edge softening, as shown in the following example:

 

 

 

 

Equalize Remap the pixels in the image so that successive acquired images have similar grey values. Use an equalize operation when the lighting in your production environment can vary slightly from one image to the next, or when some aspect of the objects you are inspecting, such as color, are allowed to vary slightly. The equalize operation helps to ensure that irrelevant changes in your production environment do not impact the overall result of the vision application.

Expand

Enlarge the entire image, or a portion of the entire image, by a magnification factor that you specify. The operation accepts separate parameters for enlarging the image along the x-axis and the y-axis, so you can use the operation to magnify the input image along one direction only. For example, the following figure shows an input image and the image after it has been magnified by a factor of 5:

 

 

 

 

Flip/Rotate

Perform a horizontal flip or a clockwise rotation on all or some portion of the input image. The following figure shows how a portion of an input image has been rotated 180 degrees:

 

 

 

 

You might need to flip or rotate an image so a vision tool analyzes the correct features each time the application executes, or to use the previously trained font characters of an OCV tool.

Gauss Sampler

Take a subsample of the input image so that the output image contains only a fraction of the original pixels, and smooth the input image by reducing the amount of contrast caused by frequent changes of light and dark pixels. For example, the following figure shows an image that has undergone a subsampling and smoothing operation:

 

 

 

 

Use a sampling operation when the vision tools you use work just as effectively on the reduced image and you want to increase the speed of your application. Use a smoothing operation to lessen the effect of liabilities such as texture, signal noise, or fine print in your images.

In addition to sampling and smoothing, this operation allows you to include a magnitude shift factor for the output image, with a range of -7 through 7. Using negative values for the shift factor produces darker output images, while using positive values produces lighter output images.

Grey Morphology

Perform grey scale morphology on the input image, selectively enhancing or reducing image features based on their size and orientation. See the section Grey-Scale Morphology for background information on this extensive image-processing operation. The following figure shows an image that has undergone a morphological operation:

 

 

 

 

Grey Morphology NxM Perform grey scale morphology on the input image with a kernel of size NxM, selectively enhancing or reducing image features based on their size and orientation. See the section Grey-Scale Morphology for background information on this extensive image-processing operation.

High Pass Filter

You can perform a Gaussian, Mean or Median smoothing operation and then subtract the resulting image from the input image. The following figure shows an image after a High Pass filter has been applied:

 

 

 

 

Use a High Pass filter to accentuate fine features in the input image.

Median 3x3

Reduce the effect of image noise in the input image by examining the 3x3 matrix of pixels around each original pixel, ranking them by order of grey values, and then taking the fifth, or middle grey value, for the output image. The following figure shows the effect of the median 3x3 operation:

 

 

 

 

The 3x3 Median operation takes no parameters. Be aware, however, that this operation reduces the size of the input image by 2 rows and 2 columns, or what is effectively a one-pixel strip around the border of the input image. If you use multiple 3x3 Median operations on the same image, the effect of this reduction multiplies. For example, if you use five 3x3 Median operations on an image, the output image will be 10 rows and 10 columns smaller than the original image.

NxM Median

Reduce the effect of image noise in the input image by examining the matrix of pixels around each original pixel using a kernel of custom size. Larger kernels have a greater effect at reducing image noise but can reduce the quality of features in the image.

The NxM Median filter supports a masking kernel of Care and Don't Care pixels, allowing you to specify which elements of the matrix are not considered when generating the new grey value for the output image. Care pixels are enabled as shown in the following figure:

 

 

 

 

Missing Pixel

Substitute pixels of unknown value with pixels of a fixed value or pixels whose values are based on the analysis of the surrounding pixels. Pixel values can be unknown based on how they are acquired. For example, range images from a DS1000 series sensor can contain missing pixels.

 

 

 

 

Multiply Constant

Multiply the grey value of each pixel in the greyscale image by a constant value. For input images of type CogImage24PlanarColor, the values of Plane 0 (red), Plane 1 (green), and Plane 2 (blue) are multiplied by the multipliers you specify. If you specify a value between 0.0 and 1.0, it has the effect of dividing each pixel by a constant value, as shown in the following figure:

 

 

 

 

The following figure shows an example where the red component has been multiplied by a high value:

 

 

 

 

You must also choose whether resulting pixel values that fall below 0 or exceed 255 after the operation are allowed to wrap or be clamped to these limits. For example, if you allow the values to wrap then a pixel with a grey value of 200 that is multiplied by 2 has the new value of 145 (2 * 200 - 255). If you choose to clamp the values then the same pixel does not exceed the value 255 after the operation.

Pixel Map

 

Apply a pixel map to the input image. For greyscale input images, each pixel in the input image is replaced by a pixel with the value from the pixel map at the index that is equal to the input image pixel value. For images of type CogImage24PlanarColor, you can specify the individual pixel maps for Plane 0 (red), Plane 1 (green), and Plane 2 (blue). For example, if a greyscale input image pixel has a value of 73, it would be replaced by the value of the 73rd element of the pixel map. The following figure shows the effect of applying an inverted pixel map, where the pixel map contains values from 255 to 0:

 

 

 

 

The following figure shows the effect of applying an inverted Plane 0 (red) pixel map, where the Plane 0 pixel map contains values from 255 to 0:

 

 

 

Common applications for a pixel map include constructing mask images and performing customized image equalization.

Quantize

Reduce the number of discrete grey values in the input image. Performing a quantize operation can help separate individual features that have similar grey values, or reduce desired features to a single grey value, which can make them easier to analyze with other vision tools. The following figure shows the effect of the quantize operation:

 

 

 

 

When you select the quantize operation you must choose the number of discrete grey values the output image will contain.

Sample Convolve

Perform simultaneous separable convolution and sampling. A common use of this is downsampling with Gaussian smoothing. The following figure shows an image that has undergone a smoothing operation:

 

 

 

 

Subsampler

Generate an output image where the input image has been reduced in resolution and size. Subsampling can allow other vision tools to operate faster on the reduced image, although reducing the image size can result in less accuracy. The Subsampler operation provides two types of algorithms for generating the output image. The first algorithm divides the input image into blocks of pixels and copies the pixel at the center of the block into the output image. If the block contains an even number of rows or columns, the operation copies the upper-left pixel closest to the center of the block. The following figure demonstrates subsampling with a 3x3 block:

 

 

 

 

The second algorithm the Subsampler operation offers is spatial averaging, which divides the input image into blocks of pixels, determines the average grey value of the pixels in each block, and places that average into the output image. The following figure demonstrates spatial averaging with a 2x2 block:

 

 

 

 

Between the two algorithms, the subsampling operation executes faster, but the spatial averaging algorithm offers a higher degree of accuracy.

Note: If you specify an even number for the subsampling rate and you do not use spatial averaging, the tool selects the pixel above and to the left of the center of the sampling area. This introduces a one-half pixel shift in the locations of features in the sampled image. The tool automatically adjusts the output image coordinate space tree by shifting the coordinate space by one-half pixel. Because spatial averaging averages pixel values evenly across the sampling area regardless of its size, no such adjustment is performed when spatial averaging is enabled.

No Operations The tool can also be configured to use no image processing operations at all. In this case it simply applies the input region to the input image to produce an output image. This can be useful if you want to affine transform a region of pixels, or want to create a rectangular image this is a copy of some portion of the original input image.
Supported Image Types

 

The following table summarizes the input image types the Image Processing One Image tool supports. The type of the output image will be the same as that of the input image.

Supported Image Types
Operation Method CogImage8Grey CogImage16Grey CogImage16Range CogImage24PlanarColor
Add/Subtract Constant    
Convolve3x3      
Convolve NxM      
Equalize      
Expand    
Flip/Rotate    
Gauss Sampler      
Grey Morphology        
NxM Grey Morphology        
High Pass Filter          
  Gauss  
  Mean
  Median
3x3 Median        
Median NxM    
Missing Pixel        
Multiply Constant    
Pixel Map      
Quantize      
Sample Convolve      
Subsampler    
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM