Image processing method and apparatus for eliminating purple fringing

By converting the image from RGB mode to LAB mode, performing Gaussian blur processing and subtraction to identify the purple edge area, and reassigning the value according to the neighborhood chromaticity, the problem of purple edge phenomenon in consumer-grade camera imaging systems is solved, achieving efficient and accurate purple edge elimination and image quality improvement.

WO2025175596A1PCT designated stage Publication Date: 2025-08-28SHENZHEN KANDAO TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/079061
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-21
Filing Date
2024-02-28
Publication Date
2025-08-28

AI Technical Summary

Technical Problem

In the prior art, consumer-grade camera imaging systems are prone to purple edge phenomena when collecting digital images, affecting image quality and effect.

Method used

By converting the image from RGB mode to LAB mode, subtracting it after Gaussian blurring to identify the purple edge area, and reassigning the value according to the neighborhood chromaticity to eliminate the purple edge.

Benefits of technology

Accurately identify and eliminate purple edge areas, improve image processing effects, obtain more natural image restoration, and improve image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024079061_28082025_PF_FP_ABST
    Figure CN2024079061_28082025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention is an image processing method for eliminating purple fringing, comprising: acquiring a target image to be processed; converting the target image from an RGB mode into an LAB mode to obtain an initially converted image; performing Gaussian blur processing on the image of the LAB mode to obtain a Gaussian blurred image; subtracting the Gaussian blurred image from the initially converted image to obtain a chromatic edge image; on the basis of the intensity value of the chromatic edge image, determining a target purple fringing region to be eliminated; on the basis of the neighborhood chromaticity of the target purple fringing region, reassigning the chromaticity of the target purple fringing region; and converting the reassigned initially converted image from the LAB mode into the RGB mode to obtain a processed image.
Need to check novelty before this filing date? Find Prior Art

Description

Image processing method and device for eliminating purple fringing Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image processing method and device for eliminating purple fringing. Background Art

[0002] When capturing digital images, the imaging system of consumer cameras experiences dispersion due to the varying refractive indices of different colors of light in the material. This causes the focal points of the lens assembly to diverge along the optical axis, causing dispersion. Dispersed light cannot converge precisely on the sensor, resulting in the appearance of purple or green edges around white surfaces, a phenomenon known as purple fringing. Purple fringing typically occurs around high-contrast white surfaces and severely impacts image quality.

[0003] Summary of the Invention

[0004] The main purpose of the present invention is to provide an image processing method and device for eliminating purple fringing, aiming to solve the problem of purple fringing in images and poor image processing quality and effect in the prior art.

[0005] To achieve the above object, the present invention provides an image processing method for eliminating purple fringing, the image processing method for eliminating purple fringing comprising:

[0006] Obtain the target image to be processed;

[0007] Convert the target image from RGB mode to LAB mode to obtain an initial converted image;

[0008] Perform Gaussian blur processing on the LAB mode image to obtain a Gaussian blurred image;

[0009] Subtracting the initial conversion image from the Gaussian blurred image to obtain a chroma edge image;

[0010] Determining a target purple-fringe area to be eliminated according to the intensity value of the chromaticity edge image;

[0011] Reassigning the chromaticity of the target purple-fringed area according to the chromaticity of the neighborhood of the target purple-fringed area;

[0012] The reassigned initial conversion image is converted from LAB mode to RGB mode to obtain a processed image.

[0013] To achieve the above object, the present invention further provides an image processing device for eliminating purple fringing, the image processing device comprising:

[0014] An acquisition module, used for acquiring a target image to be processed;

[0015] A first conversion module is used to convert the target image from RGB mode to LAB mode to obtain an initial converted image;

[0016] A Gaussian blur processing module is used to perform Gaussian blur processing on the LAB mode image to obtain a Gaussian blurred image;

[0017] An image subtraction module, configured to subtract the initial converted image from the Gaussian blurred image to obtain a chroma edge image;

[0018] a determination module, configured to determine a target purple-fringe area to be eliminated according to the intensity value of the chromaticity edge image;

[0019] an assignment module, configured to reassign the chromaticity of the target purple-fringed region according to the chromaticity of the neighborhood of the target purple-fringed region;

[0020] The second conversion module is used to convert the re-assigned initial conversion image from the LAB mode to the RGB mode to obtain a processed image.

[0021] The image processing method and device for eliminating purple fringing provided by the present invention have the following advantages over the prior art: obtaining a target image to be processed, first converting the target image from RGB mode to LAB mode to obtain an initial converted image, more accurately determining the chromaticity discrimination condition based on the A / B channel and avoiding brightness interference; performing Gaussian blur processing on the LAB mode image to obtain a Gaussian blurred image; subtracting the initial converted image from the Gaussian blurred image to obtain a chromaticity edge image; determining the target purple fringing region to be eliminated based on the intensity value of the chromaticity edge image; identifying regions with abrupt chromaticity in the image based on the chromaticity gradient of the image, and using this as a purple fringing identification condition, efficiently and accurately identifying the purple fringing region; reassigning the chromaticity of the target purple fringing region based on the chromaticity of its neighborhood; converting the reassigned initial converted image from LAB mode to RGB mode to obtain a processed image; and reassigning the chromaticity of the purple fringing region based on the chromaticity of the surrounding areas of the purple fringing region. This not only achieves the effect of eliminating the purple fringing region, but also makes the processed image more natural, achieves better restoration, and improves image processing effects and image quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] FIG1 is a schematic diagram of the system structure of the hardware operating environment involved in the embodiment of the present invention;

[0023] FIG2 is a flow chart of an embodiment of an image processing method for eliminating purple fringing according to the present invention;

[0024] FIG3 is a diagram showing the effect of image processing implementation in an embodiment of the present invention. DETAILED DESCRIPTION

[0025] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.

[0027] In the prior art, when an imaging system captures digital images, purple fringing is prone to occur, which affects the image quality and effect.

[0028] In order to solve the above technical problems, the present invention provides an image processing method. In this method, a target purple-fringed region to be eliminated is determined based on the intensity value of the chromatic edge image. The region with abrupt chromaticity in the image can be identified based on the chromatic gradient of the image and used as a purple-fringed identification condition, thereby efficiently and accurately identifying the purple-fringed region. The chromaticity of the target purple-fringed region is reassigned based on the chromaticity of the neighborhood of the target purple-fringed region. The reassigned initial conversion image is converted from LAB mode to RGB mode to obtain a processed image. The chromaticity of the purple-fringed region is reassigned based on the chromaticity of the area surrounding the purple-fringed region. This method can not only achieve the effect of eliminating the purple-fringed region, but also make the processed image more natural, obtain better restoration, improve image processing effects, and improve image quality.

[0029] As shown in FIG1 , FIG1 is a schematic diagram of the system structure of the hardware operating environment involved in the embodiment of the present invention.

[0030] The terminal of the embodiment of the present invention can be a terminal device with computing capabilities, or it can be a PC, or it can be a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3) player, an MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) player, a portable computer, and other mobile terminal devices with display capabilities.

[0031] As shown in Figure 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0032] Optionally, the terminal may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. Among them, sensors include light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor may turn off the display screen and / or backlight when the mobile terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal can also be configured with other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which will not be repeated here.

[0033] Those skilled in the art will understand that the terminal structure shown in FIG1 does not constitute a limitation on the terminal, and may include more or fewer components than shown, or a combination of certain components, or a different arrangement of components.

[0034] As shown in FIG1 , the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an image processing program.

[0035] In the terminal shown in FIG1 , the network interface 1004 is primarily used to connect to a backend server and perform data communications with the backend server; the user interface 1003 is primarily used to connect to a client (user end) and perform data communications with the client; and the processor 1001 can be used to call an image processing program stored in the memory 1005 and perform the following operations:

[0036] Obtain the target image to be processed;

[0037] Convert the target image from RGB mode to LAB mode to obtain an initial converted image;

[0038] Perform Gaussian blur processing on the LAB mode image to obtain a Gaussian blurred image;

[0039] Subtracting the initial conversion image from the Gaussian blurred image to obtain a chroma edge image;

[0040] Determining a target purple-fringe area to be eliminated according to the intensity value of the chromaticity edge image;

[0041] Reassigning the chromaticity of the target purple-fringed area according to the chromaticity of the neighborhood of the target purple-fringed area;

[0042] The reassigned initial conversion image is converted from LAB mode to RGB mode to obtain a processed image.

[0043] Furthermore, the processor 1001 may call the image processing program stored in the memory 1005 and perform the following operations:

[0044] For each unit area in the chroma edge image, determining whether the intensity value of the unit area is greater than a preset global intensity threshold;

[0045] If yes, determining a local intensity threshold based on the intensity mean of the first neighborhood of the corresponding unit area and the preset global intensity threshold;

[0046] Determine whether there is an area in a second neighborhood of the corresponding unit area whose intensity value is greater than the local intensity threshold; wherein the area of ​​the first neighborhood is greater than the area of ​​the second neighborhood;

[0047] If so, the corresponding unit area is determined to be a purple-edge unit area;

[0048] All unit areas in the chroma edge image are traversed, and a target purple-fringe area to be eliminated is determined according to all the determined purple-fringe unit areas.

[0049] Furthermore, the processor 1001 may call the image processing program stored in the memory 1005 and perform the following operations:

[0050] For each purple-fringed unit area of ​​the target purple-fringed area, obtaining a chromaticity value of a third neighborhood corresponding to the purple-fringed unit area; wherein an area of ​​the first neighborhood is larger than an area of ​​the third neighborhood, and an area of ​​the third neighborhood is larger than an area of ​​the second neighborhood;

[0051] Re-assigning the chromaticity of the corresponding purple-fringe unit area by weighted averaging according to the chromaticity value of the third neighborhood;

[0052] All purple-fringed unit areas in the target purple-fringed area are traversed to complete the reassignment of the chromaticity of the target purple-fringed area.

[0053] Furthermore, the processor 1001 may call the image processing program stored in the memory 1005 and perform the following operations:

[0054] Get the original image to be processed;

[0055] The original image is processed to reduce its resolution to obtain a target image to be processed.

[0056] Furthermore, the processor 1001 may call the image processing program stored in the memory 1005 and perform the following operations:

[0057] determining a first purple-fringe area according to an intensity value of the chroma edge image;

[0058] Obtaining the brightness and chromaticity values ​​of each unit area in the first purple-fringe area;

[0059] Determining whether the luminance value and the chromaticity value of each unit area in the first purple-fringed area meet a preset purple-fringing constraint condition;

[0060] The target purple-fringed area is determined according to the unit area in the first purple-fringed area that meets the preset purple-fringing constraint condition.

[0061] Furthermore, the processor 1001 may call the image processing program stored in the memory 1005 and perform the following operations:

[0062] Acquire real-time frame images;

[0063] Determining the number of image intervals between the real-time frame image and the previous target image;

[0064] If the number of image intervals is equal to the preset number of intervals, the real-time frame image is determined as the target image to be currently processed.

[0065] Furthermore, the processor 1001 may call the image processing program stored in the memory 1005 and perform the following operations:

[0066] Get real-time application scenario type information;

[0067] The preset global intensity threshold corresponding to the current application scene type is obtained according to the association relationship between the real-time application scene type information and the application scene type and the preset global intensity threshold.

[0068] Furthermore, the processor 1001 may call the image processing program stored in the memory 1005 and perform the following operations:

[0069] Get real-time application scenario type information;

[0070] Determining a scenario coefficient according to the real-time application scenario type information;

[0071] The local intensity threshold is determined according to the scene coefficient, the intensity mean, and the preset global intensity threshold.

[0072] 2 is a flow chart of an embodiment of an image processing method for eliminating purple fringing according to the present invention. In some embodiments, the image processing method for eliminating purple fringing includes:

[0073] Step S10: Acquire the target image to be processed.

[0074] The image processing method for eliminating purple fringing of the present invention can be applied to various image processing and video processing software, as well as to embedded system software within image acquisition devices such as cameras. The method can be used to process existing output images, such as captured output images, locally stored images, or images transmitted over a network. Alternatively, the method can be used during image acquisition to output an image processed using the image processing method for eliminating purple fringing of the present invention.

[0075] In some embodiments, step S10 includes:

[0076] Step S11: obtaining the original image to be processed.

[0077] Step S12: reducing the resolution of the original image to obtain a target image to be processed.

[0078] Specifically, in some implementation scenarios, where real-time performance is required, if the performance of the processing system is not sufficient, the requirements of real-time calculation cannot be met. Therefore, after obtaining the initially acquired image, that is, the original image, the original image can be first processed with reduced resolution to obtain the target image to be processed, and then the subsequent purple fringing identification steps are performed on the target image to be processed, and then the purple fringing is repaired on the original resolution image. Among them, the original image to be processed refers to the image that has not been processed with reduced resolution, and refers to the initially acquired image that has not been processed with reduced resolution. The target image to be processed refers to the image that has been processed with reduced resolution. Among them, the reduction parameters of the resolution reduction processing can be adjusted according to actual needs, for example, according to the purple fringing caused by factors such as the image collected by the device or the application scenario. Generally speaking, the preferred reduction range is 1 / 2-1 / 4. By reducing the resolution processing, the computing time for identifying the purple fringing area can be saved, and the overall image processing efficiency can be improved.

[0079] Of course, in some embodiments, the step of reducing the resolution of the original image may not be performed. After the original image is acquired, the subsequent steps are performed directly using the original image as the target image to be processed.

[0080] Step S20: convert the target image from RGB mode to LAB mode to obtain an initial converted image.

[0081] Generally speaking, the target image to be processed is a three-channel RGB color image. However, since each of the three channels in the RGB space reflects brightness to a certain extent, extracting chromaticity-related features directly from the RGB image will be relatively inaccurate. Therefore, it is necessary to convert the target image to be processed from RGB mode to LAB mode. Images in LAB mode separate brightness values ​​(L) and chromaticity values ​​(A / B), allowing for more accurate determination of chromaticity based on the A / B channels.

[0082] Specifically, converting an image from RGB mode to LAB mode requires the use of XYZ color space. First, the conversion method from RGB mode to XYZ color space is:

[0083] XYZ is normalized based on a white reference point, where: [X ref Y ref Z ref ]=[0.95047 1.0 1.08883]

[0084] Normalization process: x=X / X ref ,y=Y / Y ref ,z=Z / Z ref

[0085] x, y, z are transformed into x', y', z' through the following nonlinear formula:

[0086] Finally, after linear transformation, we get L, a, b: L = 116·y′-16, a = 500·(x′-y′), b = 200·(yz′)

[0087] The initial conversion image of the present invention refers to an image obtained after converting the target image to be processed into the LAB mode.

[0088] Step S30 , performing Gaussian blur processing on the LAB mode image to obtain a Gaussian blurred image.

[0089] Specifically, for the initial conversion image processing LAB mode, for each pixel (or set unit area), the pixel value is replaced by the pixel mean of the surrounding pixels or area. Since the closeness of the relationship between points is closely related to the distance, the pixel mean can be calculated by weighted averaging based on the weight determined by the distance. The weight can be determined based on the normal distribution of the image. On the image, the normal distribution is a bell-shaped curve. The closer to the center, the larger the weight value, and the farther away from the center, the smaller the weight value. When calculating the average value, it is only necessary to take the central pixel or area as the far point, and the other points can be assigned weights according to their positions on the normal distribution curve. Among them, the Gaussian blurred image is the image obtained after the initial conversion image is Gaussian blurred.

[0090] Step S40: Subtract the initial conversion image from the Gaussian blurred image to obtain a chromaticity edge image.

[0091] Because purple fringing is a region of pixels with a more abrupt coloration than the surrounding non-purple fringed areas, and the chromaticity gradient between purple fringing and surrounding pixels is large, the image's chromaticity gradient can be used to identify purple fringing areas. Specifically, the chromaticity gradient is subtracted from the Gaussian blurred image from the initial transformed image to obtain a chromatic edge image.

[0092] Specifically, assuming that the initial converted image converted to the LAB mode is image A, image A is subjected to a two-dimensional Gaussian blur process to obtain image B. The difference image C obtained by subtracting image B from image A is the chroma edge image.

[0093] Step S50: determining a target purple-fringe area to be eliminated according to the intensity value of the chromaticity edge image.

[0094] The intensity value of the chromaticity edge image refers to the chromaticity gradient value of each pixel or unit area of ​​the chromaticity edge image.

[0095] In some embodiments, step S50 includes:

[0096] Step S51 : for each unit area in the chroma edge image, determining whether the intensity value of the unit area is greater than a preset global intensity threshold.

[0097] The unit area can be a single pixel or a region consisting of multiple pixels determined based on a set method. If the unit area is a region consisting of multiple pixels, the intensity value of the unit area can be determined as the average of the intensity values ​​of all pixels in the unit area. This case uses a single pixel as an example to illustrate the unit area.

[0098] The preset global intensity threshold can be set to T1, which is an intensity threshold determined in advance based on experience and is used to perform a coarse screening of the chromaticity gradient. According to experimental experience, the preset global intensity threshold can be set within the range of 10 to 20.

[0099] After obtaining the chroma edge image, for each chroma edge pixel, its intensity value is compared with a preset global intensity threshold to determine whether the intensity value of each chroma edge pixel is greater than the preset global intensity threshold.

[0100] Step S52: If yes, determine the local intensity threshold based on the intensity mean of the first neighborhood of the corresponding unit area and the preset global intensity threshold.

[0101] Specifically, the first neighborhood is a neighborhood S1 determined with the corresponding chromatic edge pixel (unit area) as the center. For each chromatic edge pixel whose intensity value is greater than a preset global intensity threshold, M1 pixels can be selected in its area S1 (i.e., the first neighborhood), and the local intensity mean of the pixels in S1 is calculated. The local intensity threshold is calculated according to a set formula based on the local intensity mean and the preset global intensity threshold, which can be set to T2. The set formula can be: T2 = k*T1*(local mean of uniform sampling in S1), where k is a constant set based on experience.

[0102] Chroma edge pixels with intensity values ​​less than the preset global intensity threshold are ignored. The preset global intensity threshold is used to roughly screen purple-fringed areas to determine whether they need adjustment. The local intensity threshold is used to further accurately identify purple-fringed areas and determine the specific locations that need adjustment.

[0103] Step S53 , determining whether there is an area in the second neighborhood of the corresponding unit area whose intensity value is greater than the local intensity threshold; wherein the area of ​​the first neighborhood is greater than the area of ​​the second neighborhood.

[0104] The second neighborhood S2 is a neighborhood centered around a chromatic edge pixel whose intensity value is greater than a preset global intensity threshold. The area of ​​the first neighborhood S1 is larger than the area of ​​the second neighborhood S2. For the same pixel, the first neighborhood S1 encompasses the second neighborhood S2. Preferably, S1 is 100x100, and S2 is 3x3 or 5x5.

[0105] Based on step S52, for each chromaticity edge pixel whose intensity value is greater than the preset global intensity threshold, for example, for the chromaticity edge pixel n, the second neighborhood S2 is first determined based on the chromaticity edge pixel n, and the intensity value of each pixel in the second neighborhood S2 is compared with the local intensity threshold to determine whether the intensity value of each pixel is greater than the local intensity threshold, thereby determining whether there is a pixel in the second neighborhood S2 with an intensity value greater than the local intensity threshold.

[0106] Step S54: If yes, determine that the corresponding unit area is a purple-fringe unit area.

[0107] Based on step S53 , if there is a pixel with an intensity value greater than the local intensity threshold in the second neighborhood, the chromaticity edge pixel n is determined to be a purple-fringed pixel, that is, the chromaticity edge pixel n is determined to be within the purple-fringed area.

[0108] Since purple fringing is a portion of pixels with a more abrupt color relative to the surrounding non-purple fringed area, and the chromaticity gradient between the purple fringed area and the surrounding pixels is large, each chromaticity edge pixel can be preliminarily coarsely screened by a preset global intensity threshold, and the purple fringing can be further identified and screened by determining whether there is a pixel in the neighborhood S2 that is higher than the local intensity threshold, thereby improving the accuracy and reliability of purple fringing identification. Based on steps S51 to S54, for each chromaticity edge pixel, if its intensity value is greater than the preset global intensity threshold T1, M1 pixels are taken from its neighborhood S1, the local intensity mean of the taken neighborhood pixels is calculated, and the local purple fringing discrimination threshold T2 is calculated. If the intensity value of the chromaticity edge pixel is greater than T1 and there is a pixel in its neighborhood S2 that is greater than T2, it is determined that the pixel is within the purple fringing area and needs to be de-purple-fringeed. The above method not only determines whether the chromaticity edge pixel itself is higher than the preset global intensity threshold, but also determines whether there is a pixel in its neighborhood S2 that is higher than the threshold, which can effectively and accurately identify purple fringed pixels.

[0109] Step S55 , traversing all unit areas in the chroma edge image, and determining a target purple-fringe area to be eliminated based on all the determined purple-fringe unit areas.

[0110] For all pixels in the chroma edge image, steps S51 to S54 are performed to identify all purple-fringe pixels, and a target purple-fringe area to be eliminated can be determined based on all the purple-fringe pixels.

[0111] Step S60 : reassigning the chromaticity of the target purple-fringed region according to the chromaticity of the neighborhood of the target purple-fringed region.

[0112] After the target purple-fringed region is determined based on the above steps, the chromaticity of the corresponding target purple-fringed region in the initial converted image is reassigned. Specifically, in some embodiments, step S60 includes:

[0113] Step S61: For each purple-fringed unit area of ​​the target purple-fringed area, obtain the chromaticity value of the third neighborhood corresponding to the purple-fringed unit area; wherein the area of ​​the first neighborhood is larger than the area of ​​the third neighborhood, and the area of ​​the third neighborhood is larger than the area of ​​the second neighborhood.

[0114] For each purple-fringed pixel (purple-fringed unit area) in the target purple-fringed area, its third neighborhood S3 is determined, and then the chromaticity value of each pixel in the third neighborhood S3 is obtained. The third neighborhood S3 is sorted in order of area size as S1, S3, and S2. In some embodiments, the value of S3 is preferably 20x20.

[0115] Step S62 : re-assigning the chromaticity of the corresponding purple-fringe unit area by weighted averaging according to the chromaticity value of the third neighborhood.

[0116] After obtaining the chromaticity value of each pixel in the third neighborhood S3, the chromaticity value of the purple-fringe pixel (purple-fringe unit area) corresponding to the third neighborhood S3 is calculated by weighted averaging, and the chromaticity value calculation result is assigned to the purple-fringe pixel.

[0117] In some embodiments, the weighted weight of the chromaticity value can be determined based on the ratio of the number of pixels corresponding to the chromaticity value of the third neighborhood to the total number of pixels in the third neighborhood S3. In some embodiments, the weighted weight of the neighborhood pixels in the third neighborhood S3 can also be determined based on the distance between the neighborhood pixels and the assigned pixel.

[0118] Step S63 , traversing all the purple-fringed unit areas in the target purple-fringed area to complete reassignment of the chromaticity of the target purple-fringed area.

[0119] The chromaticity assignment operation from step S61 to step S62 is performed on all the purple-fringed pixels (purple-fringed unit area) in the target purple-fringed area, thereby completing the reassignment of the chromaticity of all the pixels in the target purple-fringed area.

[0120] In the above-mentioned image processing method for eliminating purple fringing, for each purple-fringed unit area in the target purple-fringed area, the chromaticity value of the third neighborhood corresponding to the purple-fringed unit area is obtained; wherein the area of ​​the first neighborhood is larger than the area of ​​the third neighborhood, and the area of ​​the third neighborhood is larger than the area of ​​the second neighborhood; the chromaticity of the corresponding purple-fringed unit area is reassigned by weighted averaging based on the chromaticity value of the third neighborhood; all purple-fringed unit areas in the target purple-fringed area are traversed to complete the reassignment of the chromaticity of the target purple-fringed area. The chromaticity of the purple-fringed area is determined based on the chromaticity of the third neighborhood S3, and all unit areas in the purple-fringed area are traversed to perform the assignment, which not only eliminates the purple-fringed area, but also makes the assigned image closer to the actual image, thereby improving the image processing effect.

[0121] Step S70 , converting the re-assigned initial conversion image from the LAB mode to the RGB mode to obtain a processed image.

[0122] As shown in FIG3 , FIG3 is a diagram illustrating the effect of image processing implementation in an embodiment of the present invention. After the chromaticity of the target purple-fringe area of ​​the initial conversion image is reassigned based on the above steps, the reassigned initial conversion image is converted from the LAB mode to the RGB mode to obtain a processed image, that is, an RGB image with the purple-fringe area eliminated.

[0123] In the above-mentioned image processing method for eliminating purple fringing, a target image to be processed is obtained, and the target image is first converted from RGB mode to LAB mode to obtain an initial converted image. The chromaticity discrimination condition can be more accurately determined based on the A / B channel to avoid brightness interference. The LAB mode image is Gaussian blurred to obtain a Gaussian blurred image. The initial converted image and the Gaussian blurred image are subtracted to obtain a chromaticity edge image. The target purple fringing region to be eliminated is determined based on the intensity value of the chromaticity edge image. The chromaticity gradient of the image can be used to identify regions with abrupt chromaticity in the image and serve as a purple fringing identification condition, thereby efficiently and accurately identifying the purple fringing region. The chromaticity of the target purple fringing region is reassigned based on the chromaticity of its neighborhood. The reassigned initial converted image is converted from LAB mode to RGB mode to obtain a processed image. The chromaticity of the purple fringing region is reassigned based on the chromaticity of the surrounding areas of the purple fringing region. This not only achieves the effect of eliminating the purple fringing region, but also makes the processed image more natural, achieves better restoration, and improves image processing and imaging effects.

[0124] In some embodiments, step S50 includes:

[0125] Step S56: determining a first purple-fringe area according to the intensity value of the chroma edge image.

[0126] The specific implementation method of step S57 can refer to the method process for obtaining the target purple-fringed area from steps S51 to S54 in the above embodiment. To meet real-time requirements and reduce calculation time, the neighborhoods S1 and S3 can be adjusted and the number of parameters such as pixel point M1 can be reduced. However, this will reduce the effectiveness of purple-fringing removal to a certain extent and may cause accidental damage to non-purple-fringed image areas. Therefore, it is necessary to add additional purple-fringing chromaticity and brightness constraints to perform purple-fringing recognition and further improve recognition accuracy. The specific implementation method is as follows.

[0127] Step S58: Obtain the brightness value and chromaticity value of each unit area in the first purple-fringe area.

[0128] Based on the above steps, after the first purple-fringe area is determined, the brightness value and chromaticity value (ie, A / B value) of each pixel (unit area) in the first purple-fringe area are obtained in the initial conversion image.

[0129] Step S59 , determining whether the luminance value and chromaticity value of each unit area in the first purple-fringed area meet a preset purple-fringing constraint condition.

[0130] Preset purple fringing constraints refer to constraints pre-set based on luminance and chrominance values ​​for further identifying purple-fringed areas. For example, a pre-set purple fringing constraint based on chrominance values ​​can be set to require chrominance values ​​to be within a purple chrominance value range. A pre-set purple fringing constraint based on luminance values ​​can be set to require luminance values ​​to be within a specific empirical value range.

[0131] After obtaining the brightness and chromaticity values ​​of each pixel in the first purple-fringe area based on the above steps, the chromaticity and brightness values ​​of each pixel are compared and matched with the preset purple-fringe area constraints to determine whether the brightness and chromaticity values ​​of each pixel meet the corresponding constraints.

[0132] Step S591 : determining a target purple-fringed region according to the unit regions in the first purple-fringed region that meet the preset purple-fringing constraint condition.

[0133] Based on step S59, if the chromaticity value and luminance value of the pixel satisfy the corresponding constraints, the pixel is determined to be a pixel in the target purple-fringed area. If the chromaticity value and luminance value of the pixel do not satisfy the corresponding constraints, the pixels in the first purple-fringed area are filtered out and not used as pixels in the target purple-fringed area. The above determination is performed on all pixels in the first purple-fringed area, and the target purple-fringed area is determined based on all pixels in the first purple-fringed area that satisfy the preset purple-fringing constraints.

[0134] In the above method, a first purple-fringed region is determined based on the intensity values ​​of the chromatic edge image; the luminance and chromatic values ​​of each unit area in the first purple-fringed region are obtained; a determination is made as to whether the luminance and chromatic values ​​of each unit area in the first purple-fringed region satisfy preset purple-fringing constraints; and a target purple-fringed region is determined based on the unit areas in the first purple-fringed region that satisfy the preset purple-fringing constraints. The above purple-fringing identification method with additional constraints can further improve the accuracy and reliability of purple-fringed region identification and image processing performance. Furthermore, in combination with the above constraints, parameters used in determining the purple-fringed region based on the intensity values ​​of the chromatic edge image can be adjusted to reduce computational complexity and improve image processing efficiency to meet real-time requirements.

[0135] In some embodiments, step S10 includes:

[0136] Step S13: Acquire real-time frame images.

[0137] Specifically, the real-time frame image refers to a frame image acquired in real time in an image data stream such as a video.

[0138] Step S14: determining the number of image intervals between the real-time frame image and the previous target image.

[0139] In this embodiment, since purple fringing detection is performed only after every other frame or a certain number of frames, frames that do not meet the specified interval will not be subjected to purple fringing detection and will not be used as target images. Therefore, the last target image refers to the last image that underwent purple fringing detection. The number of image intervals can be pre-set as needed.

[0140] Step S15: If the number of image intervals is equal to the preset number of intervals, the real-time frame image is determined as the target image to be processed currently.

[0141] If the number of intervals between the current real-time frame image and the previous target image is equal to the preset number of intervals, the current real-time frame image is determined as the current target image to be processed, and operations after step S20 are performed.

[0142] In real-time scenarios like live broadcasts, the camera is often stationary, so the captured background is also stationary. Because purple fringing often consists of high-contrast white edges, which are often static background features, the location of purple fringing is relatively fixed or changes slowly. Therefore, instead of searching for the location of purple fringing frame by frame, we can search for it every other frame or several frames, thus reducing the computational effort while maintaining the desired effect.

[0143] It is understood that if the number of image intervals between the current real-time frame image and the previous target image is not equal to the preset number of image intervals, the purple fringing recognition operation is not performed, but the purple fringing removal operation is still performed, that is, the assignment operation switching mode operation of steps S20, S60, and S70 is performed. The target purple fringing area of ​​the real-time frame image can be determined based on the target purple fringing area determined for the previous target image.

[0144] In some embodiments, the process before step S51 includes:

[0145] Step S511: Acquire real-time application scenario type information.

[0146] In some embodiments, to improve the accuracy of purple-fringed area recognition, different preset global intensity thresholds can be set based on different application scenarios. Specifically, application scenario types can be categorized as indoor, outdoor, stage, or snow field, among others. Several application scenario types can be pre-set for user selection, and real-time application scenario type information can be obtained based on a user-triggered selection instruction. Alternatively, scene recognition can be performed based on images captured by an image acquisition device to automatically obtain real-time application scenario type information.

[0147] Step S512: acquiring a preset global intensity threshold corresponding to the current application scene type according to the real-time application scene type information and the association relationship between the application scene type and the preset global intensity threshold.

[0148] The association between the application scenario type and the preset global intensity threshold is pre-set and stored association information. Based on experience, a corresponding preset global intensity threshold can be pre-set for each application scenario type. After obtaining the real-time application scenario type information in step S511, the current real-time application scenario type is compared with the pre-stored association to determine the corresponding preset global intensity threshold, which serves as the preset global intensity threshold for purple-fringing region identification.

[0149] In the above method, real-time application scene type information is obtained; and a preset global intensity threshold corresponding to the current application scene type is obtained based on the real-time application scene type information and the relationship between the application scene type and the preset global intensity threshold. Determining the preset global intensity threshold based on the real-time application scene type can improve the accuracy of purple fringing recognition, avoid accidental damage to non-purple fringed areas, and enhance image processing performance.

[0150] In some embodiments, the process before step S52 includes:

[0151] Step S521: Acquire real-time application scenario type information.

[0152] In some embodiments, to improve the accuracy of purple-fringed area recognition, different preset global intensity thresholds can be set based on different application scenarios. Specifically, the application scenario types can include indoor, outdoor, stage, or snow field atmospheres. Several application scenario types can be pre-set for user selection, and real-time application scenario type information can be obtained based on user-triggered selection instructions. Alternatively, scene recognition can be performed based on images captured by an image acquisition device to automatically identify and obtain real-time application scenario type information.

[0153] Step S522: determining a scene coefficient according to the real-time application scene type information.

[0154] In some embodiments, different scene coefficients for calculating the local intensity threshold can be pre-set for different application scene types based on experience, the application scene types are associated with the corresponding scene coefficients, and the application scene type-scene coefficient association relationship is stored in a preset location. When executing step S522, the real-time application scene type information is compared and matched with the application scene type-scene coefficient association relationship to find the scene coefficient corresponding to the current real-time application scene type.

[0155] Step S52 includes:

[0156] Step S523 : determining the local intensity threshold according to the scene coefficient, the intensity mean, and the preset global intensity threshold.

[0157] Specifically, a calculation formula for calculating the local intensity threshold based on the scene coefficient, the intensity mean, and the preset global intensity threshold can be pre-set. When obtaining the real-time scene coefficient, the scene coefficient, the intensity mean, and the preset global intensity threshold are substituted into the formula to calculate the local intensity threshold. Based on the above embodiment, the calculation formula for the local intensity threshold can be set as: T2 = k*q*T1*(local mean of uniform sampling in S1), where q is the scene coefficient.

[0158] In the above-described image processing method for eliminating purple fringing, real-time application scene type information is obtained; a scene coefficient is determined based on the real-time application scene type information; and the local intensity threshold is determined based on the scene coefficient, the intensity mean, and the preset global intensity threshold. Determining the local intensity threshold based on the real-time application scene type can improve the accuracy of purple fringing detection, avoid accidental damage to non-purple fringed areas, and enhance image processing performance.

[0159] In addition, the present invention also provides an image processing device for eliminating purple fringing.

[0160] The image processing device of the present invention includes:

[0161] An acquisition module, used for acquiring a target image to be processed;

[0162] A first conversion module is used to convert the target image from RGB mode to LAB mode to obtain an initial converted image;

[0163] A Gaussian blur processing module is used to perform Gaussian blur processing on the LAB mode image to obtain a Gaussian blurred image;

[0164] An image subtraction module, configured to subtract the initial converted image from the Gaussian blurred image to obtain a chroma edge image;

[0165] a determination module, configured to determine a target purple-fringe area to be eliminated according to the intensity value of the chromaticity edge image;

[0166] an assignment module, configured to reassign the chromaticity of the target purple-fringed region according to the chromaticity of the neighborhood of the target purple-fringed region;

[0167] The second conversion module is used to convert the re-assigned initial conversion image from the LAB mode to the RGB mode to obtain a processed image.

[0168] The specific implementation of the image processing device of the present invention can refer to the various embodiments of the image processing method for eliminating purple fringing of the present invention, and will not be described in detail here.

[0169] In addition, an embodiment of the present invention further provides a computer-readable storage medium.

[0170] The computer-readable storage medium of the present invention stores an image processing program, and when the image processing program is executed by a processor, the steps of the image processing method for eliminating purple fringing described above are implemented.

[0171] The method implemented when the image processing program running on the processor is executed can refer to the various embodiments of the image processing method for eliminating purple fringing of the present invention, and will not be described in detail here.

[0172] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0173] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0174] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0175] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An image processing method for eliminating purple fringing, comprising: Obtain the target image to be processed; Convert the target image from RGB mode to LAB mode to obtain an initial converted image; Perform Gaussian blur processing on the LAB mode image to obtain a Gaussian blurred image; Subtracting the initial conversion image from the Gaussian blurred image to obtain a chroma edge image; For each unit area in the chromatic edge image, determining whether the intensity value of the unit area is greater than a preset global intensity threshold; wherein the preset global intensity threshold corresponding to the current application scene type is obtained based on the real-time application scene type information and the correlation relationship between the application scene type and the preset global intensity threshold; If yes, determining a local intensity threshold based on the intensity mean of the first neighborhood of the corresponding unit area and the preset global intensity threshold; wherein the local intensity threshold is determined according to a scene coefficient of the real-time application scene type, the intensity mean, and the preset global intensity threshold; Determine whether there is an area in a second neighborhood of the corresponding unit area whose intensity value is greater than the local intensity threshold; wherein the area of ​​the first neighborhood is greater than the area of ​​the second neighborhood; If so, the corresponding unit area is determined to be a purple-edge unit area; Traversing all unit areas in the chroma edge image, and determining a target purple-fringe area to be eliminated based on all determined purple-fringe unit areas; For each purple-fringed unit area of ​​the target purple-fringed area, obtaining a chromaticity value of a third neighborhood corresponding to the purple-fringed unit area; wherein an area of ​​the first neighborhood is larger than an area of ​​the third neighborhood, and an area of ​​the third neighborhood is larger than an area of ​​the second neighborhood; Re-assigning the chromaticity of the corresponding purple-fringe unit area by weighted averaging according to the chromaticity value of the third neighborhood; Traversing all purple-fringed unit areas in the target purple-fringed area to reassign the chromaticity of the target purple-fringed area; The reassigned initial conversion image is converted from LAB mode to RGB mode to obtain a processed image.

2. An image processing method for eliminating purple fringing, comprising: Obtain the target image to be processed; Convert the target image from RGB mode to LAB mode to obtain an initial converted image; Perform Gaussian blur processing on the LAB mode image to obtain a Gaussian blurred image; Subtracting the initial conversion image from the Gaussian blurred image to obtain a chroma edge image; Determining a target purple-fringe area to be eliminated according to the intensity value of the chromaticity edge image; Reassigning the chromaticity of the target purple-fringed area according to the chromaticity of the neighborhood of the target purple-fringed area; The reassigned initial conversion image is converted from LAB mode to RGB mode to obtain a processed image.

3. The image processing method for eliminating purple fringing according to claim 2, wherein the step of determining the target purple fringing area to be eliminated based on the intensity value of the chromatic edge image comprises: For each unit area in the chroma edge image, determining whether the intensity value of the unit area is greater than a preset global intensity threshold; If yes, determining a local intensity threshold based on the intensity mean of the first neighborhood of the corresponding unit area and the preset global intensity threshold; Determine whether there is an area in a second neighborhood of the corresponding unit area whose intensity value is greater than the local intensity threshold; wherein the area of ​​the first neighborhood is greater than the area of ​​the second neighborhood; If so, the corresponding unit area is determined to be a purple-edge unit area; All unit areas in the chroma edge image are traversed, and a target purple-fringe area to be eliminated is determined according to all the determined purple-fringe unit areas.

4. The image processing method for eliminating purple fringing according to claim 3, wherein the step of reassigning the chromaticity of the target purple fringed area according to the chromaticity of the neighborhood of the target purple fringed area comprises: For each purple-fringed unit area of ​​the target purple-fringed area, obtaining a chromaticity value of a third neighborhood corresponding to the purple-fringed unit area; wherein an area of ​​the first neighborhood is larger than an area of ​​the third neighborhood, and an area of ​​the third neighborhood is larger than an area of ​​the second neighborhood; Re-assigning the chromaticity of the corresponding purple-fringe unit area by weighted averaging according to the chromaticity value of the third neighborhood; All purple-fringed unit areas in the target purple-fringed area are traversed to complete the reassignment of the chromaticity of the target purple-fringed area.

5. The image processing method for eliminating purple fringing according to claim 2, wherein the step of obtaining the target image to be processed comprises: Get the original image to be processed; The original image is processed to reduce its resolution to obtain a target image to be processed.

6. The image processing method for eliminating purple fringing according to claim 2, wherein the step of determining the target purple fringing area to be eliminated based on the intensity value of the chromatic edge image comprises: determining a first purple-fringe area according to an intensity value of the chroma edge image; Obtaining the brightness and chromaticity values ​​of each unit area in the first purple-fringe area; Determining whether the luminance value and the chromaticity value of each unit area in the first purple-fringed area meet a preset purple-fringing constraint condition; The target purple-fringed area is determined according to the unit area in the first purple-fringed area that meets the preset purple-fringing constraint condition.

7. The image processing method for eliminating purple fringing according to claim 2, wherein the step of obtaining the target image to be processed comprises: Acquire real-time frame images; Determining the number of image intervals between the real-time frame image and the previous target image; If the number of image intervals is equal to the preset number of intervals, the real-time frame image is determined as the target image to be currently processed.

8. The image processing method for eliminating purple fringing according to claim 3, wherein before the step of determining whether the intensity value of the unit area is greater than a preset global intensity threshold, the method further comprises: Get real-time application scenario type information; The preset global intensity threshold corresponding to the current application scene type is obtained according to the association relationship between the real-time application scene type information and the application scene type and the preset global intensity threshold.

9. The image processing method for eliminating purple fringing according to claim 3, wherein before the step of determining the local intensity threshold based on the intensity mean of the first neighborhood of the corresponding unit area and the preset global intensity threshold, the method further comprises: Get real-time application scenario type information; Determining a scenario coefficient according to the real-time application scenario type information; The determining of the local intensity threshold based on the intensity mean of the first neighborhood of the corresponding unit area and the preset global intensity threshold includes: The local intensity threshold is determined according to the scene coefficient, the intensity mean, and the preset global intensity threshold.

10. An image processing device for eliminating purple fringing, comprising: An acquisition module, used for acquiring a target image to be processed; A first conversion module is used to convert the target image from RGB mode to LAB mode to obtain an initial converted image; Gaussian blur processing module is used to perform Gaussian blur processing on the LAB mode image to obtain high Blurred image; An image subtraction module, configured to subtract the initial converted image from the Gaussian blurred image to obtain a chroma edge image; a determination module, configured to determine a target purple-fringe area to be eliminated according to the intensity value of the chromaticity edge image; an assignment module, configured to reassign the chromaticity of the target purple-fringed region according to the chromaticity of the neighborhood of the target purple-fringed region; The second conversion module is used to convert the re-assigned initial conversion image from the LAB mode to the RGB mode to obtain a processed image.

Citation Information

Patent Citations

  • Method for eliminating purple edge of image

    CN107864365A

  • Image processing method and device, terminal and computer readable storage medium

    CN111970449A

  • Image processing method and device, computer equipment and storage medium

    CN113012185A

  • Image purple edge elimination method and device, terminal and computer readable storage medium

    CN115760599A

  • Method and system for correcting purple fringing

    KR1020110060669A