Machine Vision Preliminary 5: Introduction to Related Technologies and Principles of Image Preprocessing

In the field of machine vision, image preprocessing is a very important technology. It refers to a series of operations on the original image before the image is further processed to improve image quality, reduce noise, and enhance image features . This article will introduce some commonly used image preprocessing techniques, and help beginners better understand these techniques through illustrations.

1. Image denoising (smoothing)

insert image description here

Image denoising is one of the most common tasks in image preprocessing. Noise is introduced due to various factors in the image acquisition process, such as sensor noise, signal interference, etc. Commonly used image denoising methods include mean filtering, median filtering and Gaussian filtering .

1.1 Mean filtering

Mean filtering is a simple filtering method that replaces each pixel in an image with the average of its surrounding pixels. This effectively smoothes the image and reduces the effect of noise.

Advantages and disadvantages:
The mean filter is characterized by simple algorithm and fast calculation speed. The disadvantage is that it removes a lot of details while denoising, blurring the image.

On the left I added white noise, and on the right is what it looks like after restoration.

1.2 Median filtering

Median filtering replaces each pixel in the image with the median value of its surrounding pixels. Compared with mean filtering, median filtering is more suitable for removing outliers such as salt and pepper noise1 .

insert image description here

1.3 Gaussian filtering

Gaussian filtering is to use Gaussian function to filter the image, which can better retain the detailed information of the image.

2. Image Enhancement

Image enhancement is through a series of operations to make the image visually clearer, brighter, and with stronger contrast. Common image enhancement methods include histogram equalization, contrast stretching, and sharpening .
insert image description here

2.1 Histogram equalization

Histogram equalization is a method of adjusting the distribution of image pixels to make them more uniform. It enhances the contrast of the image by counting the pixel values ​​of the image and then remapping the pixel values ​​to make the histogram of the image flatter.

2.2 Contrast stretching

Contrast stretching is a simple enhancement method that maps the pixel values ​​of an image to a larger range through a linear transformation, thereby enhancing the contrast of the image.

2.3 Sharpening

Sharpening is to make the image clearer by enhancing the edge information of the image. The commonly used sharpening methods are Laplacian operator and Sobel operator.

3. Image resizing

Image resizing is to adjust the size of an image to a specified size, which is often used for image scaling, cropping and other operations. Commonly used image resizing methods include nearest neighbor interpolation, bilinear interpolation and bicubic interpolation.
insert image description here

3.1 Nearest Neighbor Interpolation

Nearest neighbor interpolation is a simple interpolation method that sets the value of the target pixel to the value of the closest original pixel.

3.2 Bilinear interpolation

Bilinear interpolation is to calculate the value of the target pixel by weighting the four original pixels around the target pixel.

3.3 Bicubic interpolation

Bicubic interpolation is based on bilinear interpolation, further considering more original pixels, so as to obtain higher quality interpolation results.

4. Image rotation

Image rotation is to rotate the image according to the specified angle. Commonly used image rotation methods include nearest neighbor interpolation, bilinear interpolation and bicubic interpolation .
insert image description here

4.1 Nearest Neighbor Interpolation Method

Nearest neighbor interpolation is a simple interpolation method that sets the value of the destination pixel to the value of the closest original pixel.

4.2 Bilinear interpolation method

The bilinear interpolation method calculates the value of the target pixel by weighting the four original pixels around the target pixel.

4.3 Bicubic interpolation method

The bicubic interpolation method is based on the bilinear interpolation method, and further considers more original pixels, so as to obtain higher-quality interpolation results.

Through the above introduction, we have learned about some commonly used image preprocessing techniques and their principles. These technologies play an important role in the field of machine vision, which can improve image quality, reduce noise, enhance image features, etc. Beginners can gradually master the basic principles and methods of image preprocessing by learning and practicing these techniques, and lay a solid foundation for subsequent image processing tasks.

Subsequent articles will delve into one by one, from mathematical principles to algorithm implementation, starting with opencv and halcon respectively, and making more detailed introductions.


  1. Salt and pepper noise is a common type of image noise, which randomly appears black and white pixels in the image, similar to salt and pepper particles. This kind of noise is usually caused by interference during image acquisition or transmission, such as a malfunction of the camera sensor or interference in signal transmission, such as the white noise in the piggy picture on the right in the figure below. ↩︎

Guess you like

Origin blog.csdn.net/KHASIX/article/details/131265262