A method for eliminating false color at edges of a color image

By performing image difference and threshold segmentation in HSV space, the false color correction area is determined and the pixel value is adjusted, which solves the problem of false color at the edge of color images, improves image quality and applicability, and is suitable for a variety of devices.

CN115439356BActive Publication Date: 2025-12-12BEIJING DAHENG IMAGE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211033362.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-26
Publication Date
2025-12-12
Estimated Expiration
2042-08-26

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively eliminate edge false color phenomena caused by optical system structure in color images, affecting image quality and edge positioning accuracy. Furthermore, correction methods rely on specific camera lens combinations and are not applicable to different devices.

Method used

By converting the image to HSV space, performing saturation and intensity difference operations, using threshold segmentation and intersection to determine the pseudo-color correction area, and adjusting the image pixel values ​​through correction coefficients, a corrected RGB image is generated.

Benefits of technology

It achieves false color elimination without the need for specific calibration scenarios, improves the edge quality of color images, conforms to human visual intuition, is applicable to a variety of devices, and only corrects false color areas without affecting the colors of other areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115439356B_ABST
    Figure CN115439356B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of color image edge false color elimination method, comprising the following steps: step 1, determine design parameter, and the image to be corrected is converted to HSV space, obtain H, S, V each channel image;Step 2, carry out gray scale corrosion operation to saturation S channel, and the image after corrosion and saturation difference graph;Step 3, saturation difference graph carries out threshold segmentation, obtains saturation correction area;Step 4, minimum intensity graph is extracted from the image to be corrected;Step 5, intensity correction area is extracted from minimum intensity graph;Step 6, false color correction area is determined from intensity correction area and saturation correction area, and false color correction is carried out.The false color elimination method provided by the present application can slow down / remove the false color generated when color image is shot "black and white" high contrast edge, improve color image edge quality, be conducive to subsequent image processing, also more in line with eye viewing intuition.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of pseudo-color correction, in particular to a color image edge pseudo-color elimination method. BACKGROUND

[0002] Automatic optical inspection is an effective detection method for industrial automation. Machine vision using an industrial camera as a platform is used as a standard detection technology and is widely used in manufacturing fields such as printing and packaging quality control, PCB detection, rapid prototyping, etc. Taking printing and packaging quality control as an example, the system collects image information of the output printed matter surface through an industrial camera and a lens, and controls the quality of the printed matter through positioning, identification, classification and other image processing.

[0003] For industries such as medical treatment, clothing and printing that have high requirements on color, the image quality collected by the number of visual components is also increasingly high. Due to the structure and performance of the optical system, when a color camera captures the edge features of "black and white" over, a "blue-yellow" or "red-cyan" pseudo-color phenomenon will occur at the edge. For example, the text of printed matter, or the black and white texture on clothing, etc. This pseudo-color will distort the intuitive perception of the image on the one hand, and will also cause errors in edge positioning, increasing the difficulty of post-image processing, and also increasing the false detection and missed detection of defects, which has a negative impact on the robustness of the system.

[0004] In the publication CN113870146A, a pseudo-color correction system based on a camera light path model is introduced. First, a calibration object is captured using the required camera and lens, and then the appropriate equation is calculated using the obtained calibration image and the calibration object itself. Then, the offset of the current pixel is calculated for each pixel position using the obtained equation. Finally, the offset is used to polar interpolation in the image, and the gray value obtained by interpolation is output as the corrected data, thereby eliminating / reducing the pseudo-color. The advantage of this scheme is that the deviation of the light path is calculated through the physical model, and the correction effect conforms to the real sense. After calibration, the correction process can be completed in the camera hardware, and the real-time performance is good. However, the calibration effect depends on the similarity between the correction equation and the real physical model, i.e. the design difficulty of the equation is relatively large. On the other hand, the result of each calibration can only be used for a specific combination of camera and lens, otherwise it needs to be recalibrated. Moreover, for images that already have pseudo-color, the correction cannot be done without the camera. SUMMARY

[0005] The present application provides a color image edge pseudo-color elimination method, characterized in that the color image edge pseudo-color elimination method comprises the following steps:

[0006] Step 1: Determine the design parameters and convert the image to be corrected to HSV space to obtain the channel images H, S and V.

[0007] Step 2, gray scale erosion operation is performed on the saturation S channel to obtain an eroded image and a saturation difference image;

[0008] Step 3, threshold segmentation is performed on the saturation difference image to obtain a saturation correction region;

[0009] Step 4, a minimum intensity image is extracted from the image to be corrected;

[0010] Step 5, an intensity correction region is extracted from the minimum intensity image;

[0011] Step 6, a pseudo-color correction region is determined from the intensity correction region and the saturation correction region, and pseudo-color correction is performed.

[0012] Further, in Step 2, the saturation difference image is:

[0013] S d = S - S e

[0014] wherein S d denotes the saturation difference image, S denotes the saturation S channel image, S e denotes the eroded image S e .

[0015] Further, in Step 3, the saturation difference image S S is threshold segmented using a saturation threshold T d , and the image threshold greater than T S is taken as the saturation correction region O S .

[0016] Further, in Step 4, the image to be corrected is converted to the RGB space, and R, G, and B channel images are further obtained;

[0017] The robinson equal edge extraction operator is used to respectively perform convolution operation on the three R, G, and B channel images to obtain edge intensity images R I , G I , and B I .

[0018] According to R I , G I , and B I , the minimum value between channels for each corresponding pixel is calculated, which constitutes a minimum intensity image I min , i.e.:

[0019] I min = min(R I , G I , B I )

[0020] where I min represents the minimum intensity image, R I , G I , and B I represent the R, G, and B channel edge intensity images respectively.

[0021] Further, in step 5, a gray scale erosion operation is performed on the image I min to obtain the minimum intensity image I e ;

[0022] Further, the intensity difference image I d is obtained:

[0023] I d = I min - I e

[0024] I min represents the minimum intensity image, I e represents the minimum intensity image I e ;

[0025] The image I d is threshold segmented by the intensity threshold T I , and the image threshold greater than T I is taken as the intensity correction region O I .

[0026] Further, in step 6, the intersection of the intensity correction region O I and the saturation correction region O S is taken as the pseudo-color correction region O C ;

[0027] The pixel area of the region O C is calculated, and if the area is 0, it means that there is no pseudo-color feature in the current image, and no correction is performed, otherwise, the pseudo-color correction is performed;

[0028] A single channel floating point image with the same size as the original image is generated, and if the pixel coordinates are in the correction region O C , the pixel is marked as 1.0, otherwise, the pixel is marked as 0.0, and the marked image M c is generated;

[0029] The mean filter and the smoothing processing are simultaneously used on M c to smooth the marked excessive region;

[0030] The anti-marked image M c is generated according to the marked image M c , and the generation principle is:

[0031]

[0032] By marking image M c Combined with correction coefficient alpha, coefficient adjustment is carried out to obtain the corrected marking map M α , and the formula is as follows:

[0033] M α = alpha x M c

[0034] Calculate the corrected saturation image S c , and the calculation formula is as follows:

[0035]

[0036] Wherein, represents the inverse marking map, S represents the saturation S channel image, M α represents the corrected marking map;

[0037] According to the corrected saturation image S c , the hue image H and the luminance image V, conversion to the RGB space is carried out, and the obtained RGB image is the corrected image.

[0038] The beneficial effects achieved by the present application are:

[0039] The pseudo-color elimination method provided by the present application can slow down / remove the pseudo-color generated by the color image when shooting high-contrast edges such as "black and white", improve the edge quality of the color image, is conducive to subsequent image processing, and is more in line with the intuition of eye observation.

[0040] The pseudo-color elimination method provided by the present application corrects by using the pixel characteristics of the image itself, and has the advantages of not needing to construct a specific calibration scene and not relying on a camera lens.

[0041] The pseudo-color elimination method provided by the present application can adjust the degree of removing pseudo-color through three setting parameters, and adjust the best effect according to the actual pseudo-color characteristics.

[0042] The pseudo-color elimination method provided by the present application only processes the area where the pseudo-color exists, and will not cause changes in color, etc. in other areas. BRIEF DESCRIPTION OF DRAWINGS

[0043] Figure 1 is a flowchart of a color image edge pseudo-color elimination method in an embodiment of the present application;

[0044] Figure 2 is an original image to be corrected in an embodiment of the present application;

[0045] Figure 3 is a pseudo-color corrected image in an embodiment of the present application;

[0046] Figure 4is a pseudo-color region map in the embodiment of the present application;

[0047] Figure 5 is a revised mark map in the embodiment of the present application;

[0048] Figure 6 is a reverse mark map in the embodiment of the present application. DETAILED DESCRIPTION

[0049] The technical solutions of the present application will be described in more detail below with reference to the accompanying drawings. The present application includes but is not limited to the following embodiments.

[0050] As shown in the accompanying Figure 1 , the present application proposes a color image edge pseudo-color elimination method, including the following steps:

[0051] Step 1, determine the design parameters, and convert the image to be corrected to HSV space to obtain the H, S, V channel images;

[0052] Determine the parameters required for the corrected image, including the saturation threshold T S , the intensity threshold T I , and the correction coefficient a;

[0053] The saturation threshold is used to screen the regions with saturation greater than the threshold for correction;

[0054] The intensity threshold is used to screen the regions with edge "black and white" component intensity greater than the threshold for correction;

[0055] The correction coefficient is used to suppress the edge pseudo-color, and the value range is [0, 1], and the smaller the setting is, the greater the suppression degree of the edge pseudo-color is.

[0056] Convert the image to be corrected as shown in the accompanying Figure 2 to HSV space (any luminance and color space can also be used, for example, HSL, YUV, etc.), and further obtain the H, S, V channel images;

[0057] Step 2, perform a gray scale erosion operation on the saturation S channel to obtain the eroded image and the saturation difference image;

[0058] Select the saturation S channel to perform a gray scale erosion operation. The gray scale erosion operation updates the center pixel value by selecting the minimum gray scale value in the center neighborhood of the pixel to obtain the eroded image S e ;

[0059] Calculate the saturation difference image S d :

[0060] S d = S-S e

[0061] Wherein, S represents the saturation S channel image, S e represents the image S after erosion e .

[0062] Step 3, the saturation difference image is threshold segmented to obtain the saturation correction region;

[0063] The saturation threshold T S is used to threshold segment the saturation difference image S d , and the image threshold greater than T S is taken as the saturation correction region O S

[0064] Step 4, the minimum intensity image is extracted from the image to be corrected;

[0065] The image to be corrected is converted to the RGB space, and R, G, B channel images are further obtained;

[0066] The robinson edge extraction operator (other common edge extraction operators such as sobel, frei, etc. can also be selected, and the robinson is relatively best through experimental test) is used to respectively perform convolution operation on the R, G, B channel three images, and the edge intensity images R I , G I , B I of each channel are obtained;

[0067] According to R I , G I , B I , the minimum value between channels of each corresponding pixel is calculated, which constitutes the minimum intensity image I min , that is:

[0068] I min = min(R I , G I , B I )

[0069] Step 5, the intensity correction region is extracted from the minimum intensity image;

[0070] The image I min is subjected to a gray erosion operation to obtain the minimum intensity image I e after erosion;

[0071] The intensity difference image I d is further obtained:

[0072] I d = I min - I e

[0073] I minRepresents the minimum intensity map, I e This represents the image after corrosion at minimum intensity.

[0074] Through the intensity threshold T I For image I d Perform threshold segmentation, and segment the data that is greater than T. I Image threshold as intensity correction region O I .

[0075] Step 6: Determine the pseudo-color correction region from the intensity correction region and the saturation correction region, and perform pseudo-color correction;

[0076] As attached Figure 3 As shown, the intensity correction region O is selected. I and saturation correction region O S The intersection of these points serves as the pseudo-color correction region O. C ;

[0077] Computational region O C The pixel area is calculated. If the area is 0, it means that there are no false color features in the current image, and no correction is performed; otherwise, false color correction is performed.

[0078] As attached Figure 4 As shown, for the correction region O C The labeled image M is generated by processing it in the following way. c ;

[0079] Generate a single-channel floating-point image with the same dimensions as the original image, where the pixel coordinates are within the correction region O. C If a pixel is marked as 1.0, then the pixel is marked as 0.0, and a labeled image M is generated. c ;

[0080] Simultaneously, mean filtering and M are employed. c Smoothing is applied to smooth out transitional areas of the marker.

[0081] As attached Figure 5 As shown, based on the labeled image M c Generate inverse marker map The principle of generation is:

[0082]

[0083] By labeling image M c By combining the correction factor α, the coefficients are adjusted to obtain the corrected label map M. α The formula is as follows:

[0084] M α =α×M c

[0085] The corrected saturation image S is calculated c The calculation formula is as follows:

[0086]

[0087] Wherein, The anti-mark image is represented by S, the saturation S channel image is represented by S, and the mark image is represented by M α The corrected mark image is represented by S.

[0088] As shown in the accompanying drawings Figure 6 According to the corrected saturation image S c , the hue image H, and the brightness image V, the RGB image obtained by conversion to the RGB space is the corrected image.

[0089] The present application is not limited to the above-mentioned specific embodiments, and those skilled in the art can implement the present application by using other various specific embodiments according to the content disclosed in the embodiments and the drawings, therefore, any design falling within the scope of the present application is included in the protection scope of the present application.

Claims

1. A method of false color elimination at edges of a color image, characterized by, The color image edge false color elimination method comprises the following steps: Step 1, determine the design parameters, and convert the image to be corrected to HSV space to obtain channel images H, S and V; Step 2, perform a gray scale corrosion operation on the saturation S channel to obtain a saturated image and a saturation difference image; Step 3, perform threshold segmentation on the saturation difference image to obtain a saturation correction region; Step 4, extract a minimum intensity image from the image to be corrected; Step 5, extract an intensity correction region from the minimum intensity image; Step 6, determine a false color correction region from the intensity correction region and the saturation correction region, and perform false color correction.

2. The method of claim 1, wherein the color image edge false color elimination method is characterized by, In step 2, the saturation difference image is: S d = S - S e where S d represents a saturation difference map, S represents a saturation S channel image, S e represents an eroded image S e .

3. The method for eliminating false color at the edges of a color image according to claim 2, characterized in that, In step 3, the saturation threshold T is used S The saturation difference map S is obtained d Threshold segmentation is performed, and the image threshold greater than T S is taken as the saturation correction region O S .

4. The method of claim 3, wherein the step of determining the color of the pixel is performed by: determining a color of the pixel based on the color of the pixel in the color image and the color of the pixel in the edge image. In step 4, convert the image to be corrected to RGB space, and further obtain R, G and B channel images; The robinson edge extraction operator is used to respectively perform convolution operation on three images of R, G and B channels to obtain edge intensity maps R I ,G I ,B I ; According to R I ,G I ,B I , the inter-channel minimum value of each corresponding pixel is calculated, which constitutes the minimum intensity map I min , that is: I min = min(R I ,G I ,B I ) where I min represents the minimum intensity map, R I ,G I ,B I represent the R, G, B channel edge intensity maps, respectively.

5. The method of claim 4, wherein the step of determining the color of the pixel is performed by: determining a color of the pixel based on the color of the pixel in the color image and the color of the pixel in the edge image. In step 5, a gray scale erosion operation is performed on the image I min to obtain a minimum intensity map eroded image I e ; Further, the intensity difference image I is calculated as follows: d : I d = I min - I e I min denotes the minimum intensity map, I e denotes the minimum intensity map eroded image; By an intensity threshold T I On the image I d Threshold segmentation is performed, and the image threshold greater than T I is taken as the intensity correction region O I .

6. The method for eliminating false color at edges of a color image according to claim 5, wherein, In step 6, the intersection of the intensity correction region O I and the saturation correction region O S is selected as the pseudo-color correction region O C ; Computing region O C pixel area, if the area is 0, it means that there is no pseudo-color feature in the current image, no correction is performed, otherwise, pseudo-color correction is performed; A single channel float image of the same size as the original is generated, with each pixel coordinate marked 1.0 if it is in the correction area O C , otherwise the pixel is marked 0.0, generating a marked image M c ; At the same time, mean filtering and M c Smoothing processing is performed for the over-marked region. According to the marked image M c Generating an anti-marked image The principle of the generation is: By marking the image M c In combination with the correction coefficient α, the coefficient adjustment is performed to obtain the corrected marking map M α The formula is as follows: M α = a x M c calculating a corrected saturation image S c The calculation formula is as follows: wherein denotes the inverse marker map, S denotes the saturation S channel image, M α denotes the corrected marker map; According to the corrected saturation image S c , the hue image H and the brightness image V, the RGB image obtained by conversion to the RGB space is the corrected image.

Citation Information

Patent Citations

  • Color camera image edge pseudo color correction method

    CN113870146A

  • Image processing method and device, electronic equipment and readable storage medium

    CN114782261A