Image purple edge elimination method, device and storage medium

CN121746254BActive Publication Date: 2026-06-23SHENZHEN SUPER PIXEL INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-02-27
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing purple fringing removal methods are prone to misidentifying normal purple edges as purple fringing during the detection stage, resulting in a high false detection rate. Furthermore, the brightness collapse problem during the correction stage leads to unnatural image transitions.

Method used

The accuracy of purple fringing detection is improved by using chromaticity reference correction and area reference correction, and the brightness enhancement coefficient is used to improve the brightness transition after correction. Chromaticity reference correction distinguishes between purple fringing false colors and normal edges by comparing the chromaticity difference between the current pixel and the surrounding pixels. Area reference correction dynamically adjusts the correction intensity, and the brightness enhancement coefficient simultaneously enhances the brightness component.

Benefits of technology

It improves the accuracy of purple fringing detection, avoids image defects caused by color error elimination, and ensures natural brightness transition while maintaining the purple fringing elimination effect, thus improving the overall image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746254B_ABST
    Figure CN121746254B_ABST
Patent Text Reader

Abstract

The application relates to the field of digital image processing, and provides an image purple edge elimination method, device and storage medium. The method comprises the following steps: acquiring an input image; acquiring an initial purple edge correction intensity image according to brightness information, edge information and chroma information of the input image; performing chroma reference correction and area reference correction on the initial purple edge correction intensity image to acquire a final purple edge correction intensity image; acquiring a brightness enhancement coefficient; and performing purple edge elimination correction on the input image according to the final purple edge correction intensity image and the brightness enhancement coefficient. The technical scheme of the application improves the purple edge detection precision through chroma reference correction and area reference correction, and improves the naturalness of the brightness transition after correction by using the brightness enhancement coefficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of digital image processing, and in particular to a method, apparatus and storage medium for removing purple fringing from images. Background Technology

[0002] Purple fringing is a common digital image artifact that typically appears at the boundary between highlight and shadow areas, manifesting as purple or bluish-purple edge stripes. Its formation is primarily due to factors such as lens chromatic aberration, sensor saturation, and image processing algorithms, and is particularly noticeable in backlit or high-contrast scenes. Purple fringing not only affects the visual quality of an image but also reduces its ability to reproduce details; therefore, purple fringing removal technology has become an important research direction in the field of image processing.

[0003] Existing purple fringing removal methods typically rely on brightness, edge, and chromaticity information of an image for purple fringing detection and correction. For example, some methods first determine highlight areas based on brightness information, then locate potential purple fringing edges using edge information, followed by filtering candidate pixels for purple fringing using a preset chromaticity range, and finally eliminating purple fringing by adjusting the chromaticity components of these pixels. While these methods can mitigate purple fringing to some extent, they fundamentally depend on fixed thresholds or empirical ranges, lacking adaptability to the local context of the image.

[0004] However, existing technologies have the following significant drawbacks: 1) In the purple fringing detection stage, relying solely on the simple fusion of brightness, edge, and chromaticity information easily misidentifies normal purple edges of objects as purple fringing, leading to a high false detection rate and thus incorrectly eliminating normal color areas, resulting in visual defects; 2) In the correction stage, existing methods typically only adjust the chromaticity component (e.g., keeping the green or luminance component unchanged), but purple fringing areas are often accompanied by luminance collapse issues. Simply adjusting the chromaticity will result in lower brightness in the corrected area, creating a significant difference in brightness between it and the surrounding non-purple fringing areas, disrupting the natural transition of the image. These drawbacks limit the accuracy and visual quality of purple fringing removal. Summary of the Invention

[0005] This application provides a method, apparatus, and storage medium for eliminating purple fringing in images. It improves the accuracy of purple fringing detection by using chromaticity reference correction and area reference correction, and improves the naturalness of the brightness transition after correction by using a brightness enhancement coefficient.

[0006] On the one hand, this application provides a method for removing purple fringing from images, the method comprising:

[0007] Obtain the input image;

[0008] An initial purple fringing correction intensity image is obtained based on the brightness information, edge information, and chromaticity information of the input image;

[0009] The initial purple fringing correction intensity image is subjected to chromaticity reference correction and area reference correction to obtain the final purple fringing correction intensity image;

[0010] Obtain the brightness enhancement factor;

[0011] Based on the final purple fringing correction intensity image and the brightness enhancement coefficient, the input image is subjected to purple fringing removal correction.

[0012] On the other hand, this application provides an image purple fringing removal device, the device comprising:

[0013] The first acquisition module is used to acquire the input image;

[0014] The second acquisition module is used to acquire an initial purple fringing correction intensity image based on the brightness information, edge information and chromaticity information of the input image;

[0015] The first correction module is used to perform chromaticity reference correction and area reference correction on the initial purple edge correction intensity image to obtain the final purple edge correction intensity image.

[0016] The third acquisition module is used to acquire the brightness enhancement coefficient;

[0017] The second correction module is used to perform purple fringing elimination correction on the input image based on the final purple fringing correction intensity image and the brightness enhancement coefficient.

[0018] Thirdly, this application provides an apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the technical solution of the image purple fringing removal method described above.

[0019] Fourthly, this application provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described image purple fringing removal method.

[0020] As can be seen from the technical solutions provided in this application, on the one hand, through chromaticity reference correction, the purple edge detection process not only relies on brightness, edge, and chromaticity information, but also corrects the initial purple edge correction intensity image based on the image's chromaticity reference information. Chromaticity reference correction can distinguish between purple edge false colors and normal color edges of objects by comparing the chromaticity difference between the current pixel and surrounding pixels. For example, when the chromaticity difference between a pixel and its surroundings is small, it indicates that the area may belong to the normal color of the object, thereby reducing its correction intensity; conversely, the correction intensity is retained. This correction method reduces the probability of misjudging normal purple areas as purple edges, improves the accuracy of purple edge detection, and avoids image defects caused by color error elimination. On the other hand, through area reference correction, the purple edge correction intensity is adaptively penalized by area. Area reference correction dynamically adjusts the correction intensity based on the area size of the purple edge region and local brightness information. For areas with large areas but low brightness, a stronger penalty is applied to reduce the correction intensity and prevent large areas of normal data from being grayscaled. For bright areas, the penalty is reduced to preserve the correction effect on the true purple fringing. This correction strategy can effectively handle complex scenes (e.g., purple grids), maintaining the purple fringing elimination effect while avoiding over-correction of large areas of the image. Thirdly, by introducing a brightness enhancement coefficient, the brightness component of the purple-fringed area is simultaneously enhanced while adjusting its chroma. The brightness enhancement coefficient ensures that the brightness of the corrected pixels is not lower than the original brightness, and may even be moderately enhanced based on local features, thereby compensating for the brightness collapse problem commonly found in purple-fringed areas. This brightness enhancement operation ensures a smoother and more natural brightness transition between purple-fringed and non-purple-fringed areas, eliminating the visual abruptness caused by brightness differences and improving the overall image quality. In summary, the technical solution of this application improves the accuracy of purple fringing detection through chroma reference correction and area reference correction, and improves the naturalness of the brightness transition after correction by using a brightness enhancement coefficient. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart of the image purple fringing removal method provided in the embodiments of this application;

[0023] Figure 2 This demonstrates that, after area reference correction according to this application, false detections are effectively suppressed and the true purple edge correction effect is preserved;

[0024] Figure 3The study revealed a brightness collapse phenomenon in the purple-edge region under existing solutions, where the brightness of the purple-edge region is significantly lower than that of the surrounding normal region.

[0025] Figure 4 The correction effects of different methods were compared, demonstrating that the present application can effectively improve the brightness of the purple edge area and achieve a smooth transition through brightness enhancement, which is superior to existing methods;

[0026] Figure 5 This is a schematic diagram of the image purple fringing removal device provided in the embodiments of this application;

[0027] Figure 6 This is a schematic diagram of the device provided in the embodiments of this application. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] In this specification, adjectives such as "first" and "second" are used only to distinguish one element or action from another, without necessarily requiring or implying any actual such relationship or order. Where circumstances permit, reference to an element or component or step (etc.) should not be construed as limited to only one of the elements, components, or steps, but may include one or more of the elements, components, or steps, etc.

[0030] For ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn to actual scale.

[0031] Existing purple fringing removal methods typically rely on brightness, edge, and chromaticity information of an image for purple fringing detection and correction. For example, some methods first determine highlight areas based on brightness information, then locate potential purple fringing edges using edge information, and finally filter candidate pixels using a preset purple fringing chromaticity range. Finally, they achieve purple fringing removal by adjusting the chromaticity components of these pixels. While these methods can mitigate purple fringing to some extent, they rely on fixed thresholds or empirical ranges and lack adaptability to the local image context. However, existing technologies have the following significant drawbacks: 1) In the purple fringing detection stage, due to the simple fusion of brightness, edge, and chromaticity information, normal purple edges of objects are easily misidentified as purple fringing, leading to a high false detection rate and incorrectly eliminating normal color areas, resulting in visual defects; 2) In the correction stage, existing methods typically only adjust the chromaticity components (e.g., keeping the green or brightness components unchanged). However, purple fringing areas are often accompanied by brightness collapse issues. Simply adjusting the chromaticity results in lower brightness in the corrected area, creating a significant difference in brightness compared to the surrounding non-purple fringed areas, disrupting the natural transition of the image. These defects limit the accuracy and visual quality of purple fringing removal.

[0032] To address the aforementioned problems in the prior art, this application proposes a method for eliminating purple fringing in images, the flowchart of which is attached. Figure 1 As shown, the main steps include S101 to S105, which are detailed below:

[0033] Step S101: Obtain the input image.

[0034] In this application, the input image can come from any digital image source, such as a digital camera, smartphone, or image processing system. Images are typically represented in the RGB color space, but this application is not limited to this and may also directly process image data in YUV or other color spaces. After acquiring the input image, subsequent steps will process it based on its pixel data.

[0035] Step S102: Obtain the initial purple fringing correction intensity image based on the brightness information, edge information, and chromaticity information of the input image.

[0036] In existing technologies, purple fringing detection typically involves directly fusing brightness, edge, and chromaticity information, but this can easily lead to false detection of normal purple edges. Therefore, this application obtains an initial purple fringing correction intensity image based on the brightness, edge, and chromaticity information of the input image, specifically including the following steps S1021 to S1025:

[0037] Step S1021: Convert the input image to the HSL color space to obtain the luminance component L, hue component H, and saturation component S.

[0038] The HSL color space effectively separates the brightness (L), hue (H), and saturation (S) information of an image. Hue (H) reflects the color type, saturation (S) represents color purity, and brightness (L) represents lightness or darkness. For conversion, standard algorithms are preferred; for example, the conversion formula from RGB to HSL is:

[0039] ;

[0040] ;

[0041] ;

[0042] In this design, H ranges from 0° to 360°, while S and L range from 0 to 1. The HSL color space was chosen because hue H can be directly used to determine candidate areas for purple fringing (purple fringing hues are typically located between 220° and 300°), while saturation S and brightness L help with further filtering.

[0043] Step S1022: Perform low-pass filtering and morphological dilation on the luminance component L to obtain the processed luminance component L'.

[0044] Purple fringing typically appears at the edges of highlight areas, so it's necessary to emphasize these areas. Low-pass filtering (e.g., 7×7 mean filtering) is used to smooth noise; its function is represented as Blur(L). Morphological dilation expands the bright areas through a neighborhood maximization operation, enhancing the continuity of the highlight regions. The processing steps are as follows:

[0045] .

[0046] Here, morphological operations are based on structuring elements (e.g., 5×5 rectangles), and the dilation operation can connect discrete highlight points into regions, avoiding missed detections.

[0047] Step S1023: Based on the preset brightness range Perform weight mapping to obtain the first brightness weight. .

[0048] Weight mapping converts brightness values ​​into probability weights, using the following formula:

[0049] .

[0050] Where clip is the truncation function, which truncates the data. Limited to the interval [ , Inside, optionally, =0.6, =0.95. This mapping is based on a monotonically increasing function, making the highlighted area ( near The weight of the light area is close to 1, and the weight of the dark area is close to 0, so as to quickly locate the area where purple edge may appear.

[0051] Step S1024: Based on the luminance component L Calculate edge strength E and edge strength E Perform weight mapping to obtain edge weights .

[0052] Purple fringing only appears near the edges, therefore edge information must be considered. The edge intensity E is obtained by calculating the standard deviation of the neighborhood of each pixel in the luminance component L:

[0053] .

[0054] This formula reflects the degree of brightness variation around a pixel: the larger the standard deviation, the more pronounced the edge. A weighted mapping is then applied to E:

[0055] .

[0056] Optionally, =0.04, =0.15, which normalizes the weights of the edge regions to 0~1.

[0057] Step S1025: Set the first brightness weight With edge weights Multiply to obtain the brightness-corrected intensity image. .

[0058] The fusion formula is: This operation limits the potential purple fringing area to the highlighted region near the edge. To further suppress noise, [the following can be done]... Perform morphological closing operations (dilation followed by erosion): Closing operations can smooth out regions and remove isolated points, improving detection robustness.

[0059] Furthermore, obtaining the initial purple fringing correction intensity image based on the brightness information, edge information, and chromaticity information of the input image can also include steps S'1021 to S'1024, as detailed below:

[0060] Step S'1021: Determine the candidate region for purple edge based on the hue component H, calculate the proportion of pixels within the candidate region that satisfy the preset hue range, and perform weight mapping on the pixel proportions to obtain the hue weights. .

[0061] Purple-edged hues are usually located in =220° to =300°. First, generate a binary image. : Then on Perform low-pass filtering (e.g., mean filtering) to obtain the proportion of neighboring pixels: .

[0062] The weights are mapped as follows: Optionally, =0.15, =0.60, which makes the weight of areas with higher proportions greater.

[0063] Step S'1022: Perform weight mapping on the saturation component S to obtain the saturation weights. .

[0064] Purple edges typically have high saturation, and the weight mapping is as follows: Optionally, =0.3, =1.0 to highlight highly saturated pixels.

[0065] Step S'1023: Weight the hue With saturation weight Multiply to obtain the color-corrected intensity image. .

[0066] The fusion formula is: The chromaticity-corrected intensity image reflects the probability of purple fringing based on chromaticity.

[0067] Step S'1024: Adjust the brightness to the intensity image Color correction intensity image With chromaticity reference correction image Multiply to obtain the initial purple fringing correction intensity image. .

[0068] The initial fusion formula is: ,in, This fusion method, achieved through subsequent chromaticity reference correction, initially combines luminance, chromaticity, and contextual information.

[0069] Step S103: Perform chromaticity reference correction and area reference correction on the initial purple fringing correction intensity image to obtain the final purple fringing correction intensity image.

[0070] Existing purple fringing removal schemes mainly fall into two categories: one is to directly fuse luminance, edge, and chromaticity information to generate the purple fringing correction intensity without additional correction; the other is to reduce the false detection probability by expanding the search area (e.g., searching for similar pixels in a larger area around the pixel). However, the direct fusion scheme lacks adaptability to the local context of the image, has a high false detection rate, and causes color loss in normal areas; while the scheme of expanding the search area can partially improve false detection, it has high computational cost, poor real-time performance, and is difficult to apply in practice. As an embodiment of this application, chromaticity reference correction of the initial purple fringing correction intensity image can be implemented through steps S1031 to S1034, as detailed below:

[0071] Step S1031: Obtain the chromaticity reference image of the input image.

[0072] In this embodiment, the hue component H of the HSL color space can be used as the chromaticity reference image of the input image. Since hue directly represents the type of color, it is the best indicator for judging color consistency.

[0073] Step S1032: Adjust the brightness of the intensity image Perform inverse proportional stretching to obtain a brightness-corrected intensity-weighted image. .

[0074] Inverse stretching treatment will Medium to high values ​​(close to 1, representing a high probability of purple edge) are mapped to low values ​​(close to 0), and vice versa. For example, by setting a threshold... Binarize to 0.6: Obtain a binary image The value is 1 for suspected non-purple-edge areas (originally low-value areas), and 0 for highly suspected purple-edge areas. This step aims to "mask" high-probability purple-edge areas in subsequent filtering.

[0075] Step S1033: Based on the brightness-corrected intensity-weighted image A weighted filter is applied to the chroma reference image to obtain the chroma reference filtered image.

[0076] In this embodiment, the weighted filtering is calculated using a formula. : This operation is essentially based only on non-purple-edged candidate regions ( Calculate the local average hue for the hue values ​​of the region (where hue = 1). If the entire image is filtered directly (e.g., calculating...),... In areas with a wide purple border, the difference between adjacent pixels disappears due to their similar hue, thus losing its correction capability. This method cleverly limits the reference benchmark to a more reliable adjacent non-purple border area by using brightness correction intensity image weighting, and its computational complexity is much lower than that of existing schemes that reduce the false detection probability by expanding the search area.

[0077] Step S1034: Obtain the chromaticity reference correction image based on the pixel differences between the chromaticity reference image and the chromaticity reference filtered image.

[0078] In this embodiment, pixel difference calculation uses a function. For single channel It is an absolute value function: Then, through an exponential function mapping, we obtain... : ,in, This is a scaling parameter (e.g., 15.0). The greater the difference, The closer the value is to 1, the greater the difference between the current pixel and the average hue of its surrounding pixels, indicating a high probability of it being a purple fringing false color, which requires no correction; the smaller the difference, the higher the probability of it being a purple fringing false color, which requires no correction. The closer the value is to 0, the more consistent the color is with the surrounding area, which is likely a normal edge of the object. The initial detection result should be rejected. This correction mechanism effectively solves the problem of false detection.

[0079] As an embodiment of this application, area reference correction of the initial purple fringing correction intensity image can be achieved through steps S'1031 to S'1038. Steps S'1031 to S'1033 aim to handle large-area false detection scenarios, while steps S'1034 to S'1036 aim to optimize the area penalty and avoid excessive penaltying of real large-area purple fringing (which often appears in highlight areas), as detailed below:

[0080] Step S'1031: Perform proportional stretching on the initial purple fringing correction intensity image to obtain the mapped image. .

[0081] In this embodiment, the mapped image is obtained by proportionally stretching the initial purple fringing correction intensity image. It can be a binary image, or a grayscale image with continuous values ​​obtained by stretching it using an S-curve. (Mapped image) It is a binary image For example, proportional stretching can be achieved by setting a threshold. ,For example Binarization is performed at 0.5 to enhance the strong response region. .

[0082] Step S'1032: Map the image Morphological operations and low-pass filtering are performed to obtain the processed mapped image.

[0083] Both binary and continuous-value grayscale images can be processed using morphological operations and low-pass filtering. Let's still consider mapped images. It is a binary image For example, morphological operations and low-pass filtering are used to smooth regions and estimate local purple fringing pixel density: Use a larger filter kernel (e.g., 15x15) to obtain macroscopic area information.

[0084] Step S'1033: Perform weight mapping on the processed mapped image based on a monotonically decreasing function to obtain the area penalty weights. .

[0085] In this embodiment, weight mapping is performed on the processed mapped image based on a monotonically decreasing function, and the weight mapping can use a Gaussian monotonically decreasing function. (The mapped image is then used as an example.) It is a binary image For example, the monotonically decreasing function is: Among them, regarding , and The value of can be optionally, =0.15、 =1.0 and =0.35. The larger the value, the more purple pixels there are around it. The smaller the value, the stronger the penalty, preventing large areas of normal data (e.g., the entire purple grid) from being grayed out.

[0086] Step S'1034: Obtain the brightness reference image of the input image.

[0087] In this embodiment, the Y component of the YUV space can be selected as the luminance reference image. .

[0088] Step S'1035: Perform morphological operations and low-pass filtering on the brightness reference image. .

[0089] To smooth out noise, morphological operations and low-pass filtering can be performed on the brightness reference image: .

[0090] Step S'1036: Perform weight mapping on the luminance reference image after morphological operations and low-pass filtering based on a monotonically increasing function to obtain luminance tolerance weights. .

[0091] The weight mapping uses a Gaussian monotonically increasing function: Optional, =0.0, =0.95, =0.15. The higher the value, the brighter the area. The closer it is to 1, the higher the tolerance and the lighter the punishment.

[0092] Step S'1037: Based on area penalty weights and brightness tolerance weight Calculate the overall penalty weight.

[0093] In this embodiment, the comprehensive penalty weights are dynamically balanced through complementary calculations: When the area brightness is high (i.e. ), The penalty is minimal, preserving the correction for true purple fringing; when the area brightness is low (i.e., ), The area penalty is the primary factor to prevent false positives.

[0094] Step S'1038: Adjust the initial purple fringing correction intensity image using the comprehensive penalty weight to obtain the final purple fringing correction intensity image.

[0095] Simple multiplication can be used The initial purple fringing correction intensity image is adjusted using a comprehensive penalty weight to obtain the final purple fringing correction intensity image.

[0096] As can be seen from step S103 and its specific implementation in the above embodiment, chromaticity reference correction compares the chromaticity difference between the current pixel and surrounding pixels (based on the chromaticity reference image). and weighted filtering This allows for the differentiation between purple-edge false colors and normal object edges: when the chromaticity difference is small, the correction strength is reduced to avoid false detections; when the chromaticity difference is large, the correction strength is retained. Area reference correction utilizes an adaptive penalty mechanism (e.g., based on area penalty weights). and brightness tolerance weight Dynamically adjust the correction intensity: apply a stronger penalty to large areas of low brightness to prevent over-correction; reduce the penalty to bright areas to preserve the true purple fringing correction effect. For example... Figure 2 As shown, the corrected purple fringing detection accuracy is improved, false positives are reduced, and large areas of image grayscale are avoided.

[0097] Step S104: Obtain the brightness enhancement coefficient.

[0098] In existing solutions, only the R and B components are adjusted in the RGB space while keeping G unchanged (corresponding to a decrease in brightness), or only the U and V components are adjusted in the YUV space while keeping Y unchanged (corresponding to unchanged brightness). However, the former reduces the brightness of the purple-edge area, exacerbating brightness collapse, while the latter (adjusting UV while keeping Y) maintains unchanged brightness but cannot compensate for the inherent insufficient brightness of the purple-edge area, resulting in the corrected area still being too dark. Figure 3 As shown, the left side is an example image of the purple-edged region, and the right side is the brightness Y-curve of a row of pixels in the left image in YUV space, proving that there is a significant brightness collapse process in the purple-edged region. To overcome the shortcomings of the existing solutions, this application obtains a brightness enhancement coefficient. Since the brightness enhancement coefficient (e.g., brightness enhancement coefficient M) allows for adaptive adjustment of brightness based on local image features: by setting... (Preferably M=1), to increase the target brightness The brightness is not lower than the original, and even moderately increased, thus compensating for the brightness collapse in the purple-edged areas and ensuring a smoother and more natural brightness transition between the corrected area and the surrounding non-purple-edged areas. For example... Figure 4 As shown, the top left corner is Figure 3 The brightness curves are shown in the upper right corner. The upper right corner shows the brightness curve when the brightness enhancement factor is 1, which shows the brightness improvement and smooth transition. The lower left and lower right corners show the effects of the existing methods, which show that the brightness problem has not been improved.

[0099] Specifically, obtaining the brightness enhancement coefficient can be achieved by adaptively assigning a brightness enhancement coefficient M to each pixel based on the local brightness features of the input image, where M is a value not less than 0. As an embodiment of this application, M can be set as a global constant, optionally 1.0. As an advanced solution, in one embodiment of this application, adaptively assigning the brightness enhancement coefficient M to each pixel based on the local brightness features of the input image can be achieved by dynamically adjusting M based on the difference between the brightness component Y and the green component G, such that M has a larger value in higher brightness areas and a smaller value in lower brightness areas. For example, it can be designed as follows: ,in, base Based on the value (e.g., base =0.5), scale As a scaling factor, a large YG difference indicates that the purple fringing effect may be more severe, requiring stronger brightness compensation.

[0100] Step S105: Perform purple fringing removal correction on the input image based on the final purple fringing correction intensity image and brightness enhancement coefficient.

[0101] As mentioned earlier, existing solutions process chroma and luminance separately in RGB or YUV space. For example, they adjust only some components (R, B or U, V) while keeping other components unchanged. These solutions involve isolated adjustment processes and cannot dynamically coordinate chroma and luminance changes based on purple fringing intensity. For instance, keeping G or Y constant can lead to inconsistent luminance. Separate implementation increases algorithm complexity and hardware cost, resulting in an unnatural appearance after correction and limiting application flexibility. Therefore, to avoid disconnect between chroma and luminance processing and to make the image after purple fringing removal visually more consistent and natural, this application adopts a solution that performs purple fringing removal correction on the input image based on the final purple fringing correction intensity image and luminance enhancement coefficient. As an embodiment of this application, purple fringing removal correction on the input image based on the final purple fringing correction intensity image and luminance enhancement coefficient can be achieved through steps S1051 and S1052, which are described in detail below:

[0102] Step S1051: Determine the target brightness of each pixel in the input image based on the brightness enhancement coefficient M. .

[0103] Specifically, step S1051 can be implemented by: acquiring the initial incremental image. : Where Y is the luminance component of the input image, Let G be the brightness scaling factor, and G be the green component of the input image; calculate the target incremental image; calculate the target brightness. Initial incremental image. The potential brightness loss caused by purple fringing was quantified. Since purple fringing areas are typically... as well as ,and ,and Therefore It can be considered as an average brightness. This intuitively reflects the potential for brightness improvement due to the relatively low G component. Ensure non-negativity. Target increment. The brightness is modulated by a luminance enhancement coefficient M, where M determines the compensation level. Target brightness Increase compensation amount based on the original brightness Y This ensures that the brightness after correction is not lower than the original brightness, and may even be enhanced as needed.

[0104] Step S1052: Based on the final purple fringing correction intensity image, adjust the brightness of each pixel in the input image to its original brightness and target brightness. between.

[0105] Specifically, step S1052 can be implemented by: calculating the corrected luminance components. ; Calculate the corrected chromaticity components , ,in, This is the final purple fringing corrected intensity image. Brightness adjustment formula. It is a linear interpolation process. When (Non-purple edge) Brightness remains unchanged; when (Strong purple edge) The brightness is increased to the target value. This operation smoothly transitions the pixel brightness from the original value Y to the target value. Chromaticity (i.e.) and Adjustments can be made simultaneously, that is, , Follow By increasing the intensity while decreasing it, desaturation is achieved. This synergistic adjustment mechanism ensures that while eliminating purple fringing, brightness consistency is effectively improved.

[0106] From the above appendix Figure 1 As can be seen from the example image purple fringing removal method, on the one hand, through chromaticity reference correction, the purple fringing detection process not only relies on brightness, edge, and chromaticity information, but also adjusts the initial purple fringing correction intensity based on the image's chromaticity reference information. Chromaticity reference correction distinguishes between false purple fringing and normal object color edges by comparing the chromaticity difference between the current pixel and surrounding pixels. For example, when the chromaticity difference between a pixel and its surroundings is small, it indicates that the area may belong to the normal color of the object, thus reducing its correction intensity; conversely, the correction intensity is retained. This correction method reduces the probability of misjudging normal purple areas as purple fringing, improves the accuracy of purple fringing detection, and avoids image defects caused by color error removal. On the other hand, through area reference correction, the purple fringing correction intensity is adaptively penalized by area. Area reference correction dynamically adjusts the correction intensity based on the area size of the purple fringing region and local brightness information: for For areas with large but low brightness, a stronger penalty is applied to reduce the correction intensity and prevent large areas of normal data from being grayscaled. For bright areas, the penalty is reduced to preserve the correction effect on the true purple fringing. This correction strategy effectively handles complex scenes (e.g., purple grids), maintaining the purple fringing elimination effect while avoiding over-correction of large areas of the image. Thirdly, by introducing a brightness enhancement coefficient, the brightness component of the purple-fringed area is simultaneously enhanced while adjusting its chroma. This brightness enhancement coefficient ensures that the corrected pixel brightness is not lower than the original brightness, and may even moderately increase it based on local features, thus compensating for the brightness collapse problem commonly seen in purple-fringed areas. This brightness enhancement operation ensures a smoother and more natural brightness transition between purple-fringed and non-purple-fringed areas, eliminating the visual abruptness caused by brightness differences and improving the overall image quality. In summary, the technical solution of this application improves the accuracy of purple fringing detection through chroma reference correction and area reference correction, and utilizes a brightness enhancement coefficient to improve the naturalness of the brightness transition after correction.

[0107] Please see the appendix Figure 5 This application provides an image purple fringing removal device, which may include a first acquisition module 501, a second acquisition module 502, a first correction module 503, a third acquisition module 504, and a second correction module 505, as detailed below:

[0108] The first acquisition module 501 is used to acquire the input image;

[0109] The second acquisition module 502 is used to acquire an initial purple fringing correction intensity image based on the brightness information, edge information and chromaticity information of the input image;

[0110] The first correction module 503 is used to perform chromaticity reference correction and area reference correction on the initial purple edge correction intensity image to obtain the final purple edge correction intensity image.

[0111] The third acquisition module 504 is used to acquire the brightness enhancement coefficient;

[0112] The second correction module 505 is used to perform purple fringing elimination correction on the input image based on the final purple fringing correction intensity image and the brightness enhancement coefficient.

[0113] From the above appendix Figure 5As can be seen from the example image purple fringing removal device, on the one hand, through chromaticity reference correction, the purple fringing detection process not only relies on brightness, edge, and chromaticity information, but also corrects the initial purple fringing correction intensity based on the image's chromaticity reference information. Chromaticity reference correction distinguishes between false purple fringing and normal object color edges by comparing the chromaticity difference between the current pixel and surrounding pixels. For example, when the chromaticity difference between a pixel and its surroundings is small, it indicates that the area may belong to the normal color of the object, thus reducing its correction intensity; conversely, the correction intensity is retained. This correction method reduces the probability of misjudging normal purple areas as purple fringing, improves the accuracy of purple fringing detection, and avoids image defects caused by color error removal. On the other hand, through area reference correction, the purple fringing correction intensity is adaptively penalized by area. Area reference correction dynamically adjusts the correction intensity based on the area size of the purple fringing region and local brightness information: for... For areas with large but low brightness, a stronger penalty is applied to reduce the correction intensity and prevent large areas of normal data from being grayscaled. For bright areas, the penalty is reduced to preserve the correction effect on the true purple fringing. This correction strategy effectively handles complex scenes (e.g., purple grids), maintaining the purple fringing elimination effect while avoiding over-correction of large areas of the image. Thirdly, by introducing a brightness enhancement coefficient, the brightness component of the purple-fringed area is simultaneously enhanced while adjusting its chroma. This brightness enhancement coefficient ensures that the corrected pixel brightness is not lower than the original brightness, and may even moderately increase it based on local features, thus compensating for the brightness collapse problem commonly seen in purple-fringed areas. This brightness enhancement operation ensures a smoother and more natural brightness transition between purple-fringed and non-purple-fringed areas, eliminating the visual abruptness caused by brightness differences and improving the overall image quality. In summary, the technical solution of this application improves the accuracy of purple fringing detection through chroma reference correction and area reference correction, and utilizes a brightness enhancement coefficient to improve the naturalness of the brightness transition after correction.

[0114] Figure 6 This is a schematic diagram of the structure of a device provided in one embodiment of this application. For example... Figure 6 As shown, the device 6 in this embodiment mainly includes: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60, such as a program for an image purple fringing removal method. When the processor 60 executes the computer program 62, it implements the steps in the above-described image purple fringing removal method embodiment, for example... Figure 1 The steps S101 to S105 are shown. Alternatively, when the processor 60 executes the computer program 62, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 5 The functions of the first acquisition module 501, the second acquisition module 502, the first correction module 503, the third acquisition module 504, and the second correction module 505 are shown.

[0115] For example, the computer program 62 for the image purple fringing removal method mainly includes: acquiring an input image; acquiring an initial purple fringing correction intensity image based on the brightness information, edge information, and chromaticity information of the input image; performing chromaticity reference correction and area reference correction on the initial purple fringing correction intensity image to acquire a final purple fringing correction intensity image; acquiring a brightness enhancement coefficient; and performing purple fringing removal correction on the input image based on the final purple fringing correction intensity image and the brightness enhancement coefficient. The computer program 62 can be divided into one or more modules / units, which are stored in the memory 61 and executed by the processor 60 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 62 in the device 6. For example, computer program 62 can be divided into the functions of a first acquisition module 501, a second acquisition module 502, a first correction module 503, a third acquisition module 504, and a second correction module 505 (a module in the virtual device). The specific functions of each module are as follows: the first acquisition module 501 is used to acquire the input image; the second acquisition module 502 is used to acquire an initial purple fringing correction intensity image based on the brightness information, edge information, and chromaticity information of the input image; the first correction module 503 is used to perform chromaticity reference correction and area reference correction on the initial purple fringing correction intensity image to acquire a final purple fringing correction intensity image; the third acquisition module 504 is used to acquire the brightness enhancement coefficient; and the second correction module 505 is used to perform purple fringing elimination correction on the input image based on the final purple fringing correction intensity image and the brightness enhancement coefficient.

[0116] Device 6 may include, but is not limited to, processor 60 and memory 61. Those skilled in the art will understand that... Figure 6 This is merely an example of device 6 and does not constitute a limitation on device 6. It may include more or fewer components than shown, or combine certain components, or different components. For example, the device may also include input / output devices, network access devices, buses, etc.

[0117] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0118] Memory 61 can be an internal storage unit of device 6, such as a hard disk or RAM of device 6. Memory 61 can also be an external storage device of device 6, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., equipped on device 6. Furthermore, memory 61 can include both internal storage units and external storage devices of device 6. Memory 61 is used to store computer programs and other programs and data required by the device. Memory 61 can also be used to temporarily store data that has been output or will be output.

[0119] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed. That is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above-described device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0120] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0121] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0122] In the embodiments provided in this application, it should be understood that the disclosed apparatus / device and method can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0123] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0124] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0125] If integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can also be implemented by a computer program instructing related hardware. The computer program for the image purple fringing removal method can be stored in a storage medium. When the computer program is executed by a processor, it can implement the steps of the various method embodiments described above, namely, acquiring an input image; acquiring an initial purple fringing correction intensity image based on the brightness information, edge information, and chromaticity information of the input image; performing chromaticity reference correction and area reference correction on the initial purple fringing correction intensity image to acquire a final purple fringing correction intensity image; acquiring a brightness enhancement coefficient; and performing purple fringing removal correction on the input image based on the final purple fringing correction intensity image and the brightness enhancement coefficient. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Storage media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the contents of storage media can be appropriately added to or removed according to the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, storage media may not include electrical carrier signals and telecommunication signals.

[0126] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application. The specific embodiments described above further illustrate the purpose, technical solutions, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the protection scope of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method of image purple fringing elimination, characterized by, The method includes: Obtain the input image; The input image is converted to the HSL color space to obtain the luminance component L, hue component H, and saturation component S. The luminance component L is subjected to low-pass filtering and morphological dilation to obtain the processed luminance component L'; weight-mapping the L' based on a preset luminance range to obtain a first luminance weight ; According to the luminance component L The edge strength is calculated E The edge strength is weighted mapped E to obtain the edge weight ; multiplying the first luminance weight with the edge weight to obtain a luminance correction intensity image ; The purple edge candidate region is determined according to the hue component H, a pixel proportion satisfying a preset hue range in the candidate region is calculated, and weight mapping is performed on the pixel proportion to obtain a hue weight ; weight mapping is performed on the saturation component S to obtain a saturation weight ; Hue weight With saturation weight Multiply to obtain the color-corrected intensity image. ; multiplying a luminance correction intensity image , a chroma correction intensity image with a chroma reference correction image to obtain an initial purple fringe correction intensity image , the chroma reference correction image is obtained by: obtaining a chroma reference image of the input image; inversely stretching the luminance correction intensity image to obtain a luminance correction intensity weighted image ; and performing weighted filtering on the chroma reference image based on the luminance correction intensity weighted image to obtain a chroma reference filtered image; and obtaining the chroma reference correction image according to pixel differences between the chroma reference image and the chroma reference filtered image; The initial purple fringing correction intensity image Perform proportional stretching to obtain the mapped image. ; For the mapped image Morphological operations and low-pass filtering are performed to obtain the processed mapped image; Weight mapping is performed on the processed mapped image based on a monotonically decreasing function to obtain the area penalty weight. ; Obtain the brightness reference image of the input image; Morphological operations and low-pass filtering are performed on the brightness reference image; The brightness tolerance weights are obtained by weight mapping the brightness reference image after morphological operations and low-pass filtering based on a monotonically increasing function. ; According to the area penalty weight and the brightness tolerance weight Calculate the overall penalty weight; The initial purple fringing correction intensity image is adjusted using the comprehensive penalty weight to obtain the final purple fringing correction intensity image; Obtain the brightness enhancement factor; Based on the final purple fringing correction intensity image and the brightness enhancement coefficient, the input image is subjected to purple fringing removal correction.

2. The image purple fringing removal method according to claim 1, characterized in that, The process of obtaining the brightness enhancement coefficient includes: adaptively assigning a brightness enhancement coefficient M to each pixel based on the local brightness features of the input image, where M is a value not less than 0.

3. The image purple fringing removal method according to claim 2, characterized in that, The step of performing purple fringing removal correction on the input image based on the final purple fringing correction intensity image and the brightness enhancement coefficient includes: The target brightness of each pixel in the input image is determined based on the brightness enhancement coefficient M. ; Based on the final purple fringing correction intensity image, the brightness of each pixel in the input image is adjusted to its original brightness and the target brightness. between.

4. The image purple fringing removal method according to claim 3, characterized in that, The target brightness of each pixel in the input image is determined based on the brightness enhancement coefficient M. ,include: Obtain the initial incremental image Where Y is the luminance component of the input image, G is the brightness scaling factor, and G is the green component of the input image; Calculate the target incremental image ; Calculate target brightness .

5. The image purple fringing removal method according to claim 3, characterized in that, The step involves adjusting the brightness of each pixel in the input image to its original brightness and the target brightness based on the final purple fringing correction intensity image. In the YUV color space, this is achieved through the following steps: Calculate the corrected luminance components ; Calculate the corrected chromaticity components , , This is the final purple fringing correction intensity image.

6. A storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image purple edge elimination device and method

    CN111080559A

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

    CN115760599A