Purple edge correction method, device and equipment and computer readable storage medium

Through multi-threshold detection and correction, combined with the joint determination of edge gradient, brightness and color aberration, the multi-dimensional correction coefficient of the purple edge area is calculated for purple edge correction, which solves the problem of high cost and poor effect of lens coating in the prior art, and achieves efficient purple edge correction effect and saves hardware costs.

CN120416679APending Publication Date: 2025-08-01XIAN WINGTECH INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510528060.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

When removing the purple edge phenomenon, the prior art requires expensive lens coating and the effect is not good, making it difficult to ensure the purple edge correction effect while saving hardware costs.

Method used

Through multi-threshold detection and correction, combined with the joint determination of edge gradient, brightness and color difference, the edge correction coefficient, brightness correction coefficient and color difference correction coefficient of each pixel point in the purple edge area are calculated, and these coefficients are used for purple edge correction to avoid misjudgment of a single dimension.

Benefits of technology

It improves the accuracy of purple edge detection, ensures the purple edge correction effect, and does not need to rely on expensive coated lenses, saving hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120416679A_ABST
    Figure CN120416679A_ABST
Patent Text Reader

Abstract

The invention relates to a purple edge correction method, device and equipment and a computer readable storage medium. Through multi-threshold detection and correction and combined judgment of the edge gradient, the brightness and the chromatic aberration, single-dimension misjudgment is avoided, the purple edge detection accuracy is improved, the purple edge correction coefficient is jointly determined through the multi-dimension correction coefficients for purple edge correction, dependence on an expensive coated lens is not needed, and the cost is reduced. And the purple edge correction effect is ensured while the hardware cost is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technologies, and in particular, to a method, apparatus, device, and computer-readable storage medium for purple fringing correction. Background Art

[0002] Purple fringing refers to the chromatic aberration phenomenon that occurs at the junction of high-brightness and low-brightness parts when a digital camera captures an object due to a large brightness contrast of the object being photographed.

[0003] Generally, in mobile electronic devices such as mobile phones, the method of coating the lens is adopted to adjust the optical dispersion of the lens at the physical level.

[0004] However, the lens coating with a good effect on removing purple fringing is expensive. If the cost of the lens coating is reduced, the purple fringing removal effect will be poor. Summary of the Invention

[0005] Based on this, it is necessary to provide a method, apparatus, device, and computer-readable storage medium for purple fringing correction that can ensure the purple fringing correction effect while saving hardware costs for the above technical problems.

[0006] In a first aspect, an embodiment of the present disclosure provides a method for purple fringing correction, including:

[0007] Performing purple fringing detection on a to-be-processed image based on a plurality of preset detection thresholds to determine a purple fringing region in the to-be-processed image;

[0008] Obtaining an edge correction coefficient, a brightness correction coefficient, and a chromatic aberration correction coefficient respectively corresponding to each pixel point in the purple fringing region according to the pixel point information in the purple fringing region and the plurality of preset detection thresholds;

[0009] Calculating a purple fringing correction coefficient respectively corresponding to each pixel point in the purple fringing region based on the edge correction coefficient, the brightness correction coefficient, and the chromatic aberration correction coefficient;

[0010] Performing purple fringing correction on the to-be-processed image according to the purple fringing correction coefficient to obtain a corrected image corresponding to the to-be-processed image.

[0011] In one embodiment, the performing purple fringing detection on a to-be-processed image based on a plurality of preset detection thresholds to determine a purple fringing region in the to-be-processed image includes:

[0012] Performing channel separation on the to-be-processed image to obtain a brightness image, a first chrominance image, and a second chrominance image corresponding to the to-be-processed image;

[0013] Performing edge detection on the brightness image to obtain an edge image corresponding to the to-be-processed image;

[0014] Perform purple edge detection on the edge image based on multiple preset detection thresholds, the luminance image, the first chrominance image, and the second chrominance image, and determine the purple edge region in the image to be processed.

[0015] In one embodiment, the preset detection thresholds include a preset edge gradient interval; performing purple edge detection on the edge image based on multiple preset detection thresholds, the luminance image, the first chrominance image, and the second chrominance image, and determining the purple edge region in the image to be processed includes:

[0016] Determine at least one candidate pixel point in the edge image whose pixel value gradient is greater than the lower limit value of the preset edge gradient interval;

[0017] For each of the candidate pixel points, determine a neighborhood window centered on the candidate pixel point;

[0018] Obtain the maximum luminance value of the pixel points within the neighborhood window;

[0019] Calculate the luminance filtering value corresponding to the neighborhood window according to the luminance image;

[0020] Determine the chrominance feature value of the candidate pixel point according to the first chrominance image and the luminance image;

[0021] If the maximum luminance value, the luminance filtering value, and the chrominance feature value meet the preset conditions, determine that the region corresponding to the neighborhood window is a purple edge region.

[0022] In one embodiment, the preset detection thresholds further include a preset luminance interval and a preset color difference interval;

[0023] The step of if the maximum luminance value, the luminance filtering value, and the chrominance feature value meet the preset conditions, determine that the region corresponding to the neighborhood window is a purple edge region, includes:

[0024] If the luminance filtering value is greater than the lower limit value of the preset edge gradient interval, and the maximum luminance value is greater than the lower limit value of the preset luminance interval, and the chrominance feature value is greater than the lower limit value of the preset color difference interval, determine that the region corresponding to the neighborhood window is a purple edge region.

[0025] In one embodiment, the preset detection thresholds include a preset edge gradient interval, a preset luminance interval, and a preset color difference interval;

[0026] The step of obtaining the edge correction coefficient, the luminance correction coefficient, and the color difference correction coefficient respectively corresponding to each pixel point in the purple edge region according to the pixel point information in the purple edge region and the multiple preset detection thresholds includes:

[0027] For each pixel point in each of the purple edge regions, an edge correction coefficient of the pixel point is calculated based on the luminance filtering value of the pixel point neighborhood window and the preset edge gradient interval;

[0028] A luminance correction coefficient of the pixel point is calculated based on the maximum luminance value of the pixel point neighborhood window and the preset luminance interval;

[0029] A color difference correction coefficient of the pixel point is calculated based on the chromaticity feature value of the pixel point and the preset color difference interval.

[0030] In one embodiment, calculating the purple edge correction coefficient corresponding to each pixel point in the purple edge region based on the edge correction coefficient, the luminance correction coefficient, and the color difference correction coefficient includes:

[0031] Calculating the width of the pixel value range and the preset edge gradient interval to obtain a first coefficient;

[0032] Calculating the product of the chromaticity reference value, the edge correction coefficient, the luminance correction coefficient, and the color difference correction coefficient, and determining the ratio of the product to the chromaticity reference value as a second coefficient, where the chromaticity reference value is the sum of the first chromaticity value and the second chromaticity value of the pixel point;

[0033] Calculating the difference between the first coefficient and the second coefficient to obtain the purple edge correction coefficient corresponding to the pixel point.

[0034] In one embodiment, performing purple edge correction on the image to be processed according to the purple edge correction coefficient to obtain a corrected image corresponding to the image to be processed includes:

[0035] For each pixel point in each of the purple edge regions, calculating the ratio of the first corrected value of the pixel point to the first coefficient to obtain a corrected first chromaticity value, where the first corrected value is the product of the first chromaticity value of the pixel point and the purple edge correction coefficient;

[0036] Calculating the ratio of the second corrected value of the pixel point to the first coefficient to obtain a corrected second chromaticity value, where the second corrected value is the product of the second chromaticity value of the pixel point and the purple edge correction coefficient;

[0037] Obtaining a corrected image corresponding to the image to be processed according to the corrected first chromaticity value and the corrected second chromaticity value.

[0038] In a second aspect, an embodiment of the present disclosure provides a purple edge correction device, including:

[0039] A purple edge detection module, configured to perform purple edge detection on an image to be processed based on a plurality of preset detection thresholds, and determine a purple edge region in the image to be processed;

[0040] A first coefficient calculation module, configured to obtain an edge correction coefficient, a brightness correction coefficient, and a color difference correction coefficient respectively corresponding to each pixel point in the purple edge area according to the pixel point information in the purple edge area and the multiple preset detection thresholds;

[0041] A second coefficient calculation module, configured to calculate a purple edge correction coefficient respectively corresponding to each pixel point in the purple edge area based on the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient;

[0042] A purple edge correction module, configured to perform purple edge correction on the image to be processed according to the purple edge correction coefficient to obtain a corrected image corresponding to the image to be processed.

[0043] In a third aspect, an embodiment of the present disclosure provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the method according to any one of the first aspects are implemented.

[0044] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method according to any one of the first aspects are implemented.

[0045] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instruction, and when the computer program or instruction is executed by a processor, the purple edge correction method as described above is implemented.

[0046] The purple edge correction method, device, equipment, and computer-readable storage medium provided by the embodiments of the present disclosure avoid misjudgment in a single dimension, improve the accuracy of purple edge detection through multi-threshold detection and correction, and joint determination of edge gradient, brightness, and color difference, and use multi-dimensional correction coefficients to jointly determine the purple edge correction coefficient for purple edge correction, without relying on expensive coated lenses, ensuring the effect of purple edge correction while saving hardware costs. Description of the Drawings

[0047] The drawings here are incorporated into the description and form a part of this description, showing embodiments consistent with the present disclosure and used together with the description to explain the principles of the present disclosure.

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0049] Figure 1 Flow chart of the purple fringing correction method provided by an embodiment of the present disclosure;

[0050] Figure 2 Schematic structural diagram of a purple fringing correction device provided by an embodiment of the present disclosure;

[0051] Figure 3 Schematic structural diagram of a computer device provided by an embodiment of the present disclosure. Detailed implementation manners

[0052] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.

[0053] Figure 1 Flow chart of the purple fringing correction method provided by an embodiment of the present disclosure. In this embodiment, an example is given where the method is applied to a terminal. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server.

[0054] In this embodiment, the method includes the following steps:

[0055] S102. Perform purple fringing detection on the image to be processed based on multiple preset detection thresholds, and determine the purple fringing area in the image to be processed.

[0056] Purple fringing detection refers to identifying the high-light edge color difference area caused by optical dispersion by analyzing the brightness distribution, chromaticity offset and edge features of pixels in the image.

[0057] Multiple preset detection thresholds refer to the critical conditions for judging the existence of purple fringing preset according to different image scenes, including a preset edge gradient range, a preset brightness range, and a preset color difference range.

[0058] Since the purple fringing phenomenon in the image usually appears in the high-brightness edge area, it is necessary to simultaneously meet the conditions of high brightness value, obvious chromaticity deviation, and large edge gradient to determine that the pixel set of the essence is the purple fringing area.

[0059] S104. Obtain the edge correction coefficient, brightness correction coefficient, and chromaticity correction coefficient corresponding to each pixel point in the purple fringing area according to the pixel point information in the purple fringing area and the multiple preset detection thresholds.

[0060] The edge correction coefficient is used to eliminate the influence of the edge intensity in the purple fringing area on the color difference. The edge gradient value of the purple fringing area is extracted through an edge detection algorithm, and a coefficient is generated according to the ratio of the gradient value to a preset gradient threshold. For example, the larger the edge gradient, the more obvious the purple fringing phenomenon, and the edge correction coefficient needs to be dynamically enhanced.

[0061] The brightness correction coefficient is used to eliminate the influence of the brightness in the purple fringing area on the color difference. The brightness distribution of the pixels in the purple fringing area is statistically analyzed, and the correction intensity is calculated in combination with a preset brightness threshold. For example, the higher the brightness value, the more significant the purple fringing color difference, and it is necessary to increase the brightness correction coefficient for stronger brightness compensation.

[0062] The color difference correction coefficient is used to eliminate the chromaticity shift. Based on the difference between the chromaticity value in the purple fringing area and the normal chromaticity range, the chromaticity value is corrected to a reasonable range through the color difference correction coefficient.

[0063] Among them, multiple preset detection thresholds are used to provide correction references for normal edge gradients, brightness, and color differences, and are also used for normalization calculations in coefficient calculations.

[0064] S106. Based on the edge correction coefficient, brightness correction coefficient, and color difference correction coefficient, calculate the purple fringing correction coefficient corresponding to each pixel point in the purple fringing area.

[0065] S108. Perform purple fringing correction on the image to be processed according to the purple fringing correction coefficient, and obtain the corrected image corresponding to the image to be processed.

[0066] Fuse the edge correction coefficient, brightness correction coefficient, and color difference correction coefficient into the final purple fringing correction coefficient, eliminate the purple fringing phenomenon in the image to be processed, and finally obtain the corrected image corresponding to the image to be processed.

[0067] In the embodiments of the present disclosure, purple fringing detection is performed on the image to be processed based on multiple preset detection thresholds to determine the purple fringing area in the image to be processed; according to the pixel point information in the purple fringing area and multiple preset detection thresholds, obtain the edge correction coefficient, brightness correction coefficient, and color difference correction coefficient corresponding to each pixel point in the purple fringing area; based on the edge correction coefficient, brightness correction coefficient, and color difference correction coefficient, calculate the purple fringing correction coefficient corresponding to each pixel point in the purple fringing area; perform purple fringing correction on the image to be processed according to the purple fringing correction coefficient, and obtain the corrected image corresponding to the image to be processed; through multi-threshold detection and correction, combined with the joint determination of edge gradient, brightness, and color difference, avoid misjudgment in a single dimension, improve the accuracy of purple fringing detection, and use multi-dimensional correction coefficients to jointly determine the purple fringing correction coefficient for purple fringing correction, and do not rely on expensive coated lenses, saving hardware costs while ensuring the effect of purple fringing correction.

[0068] In some embodiments, the purple fringing detection of the image to be processed based on multiple preset detection thresholds to determine the purple fringing area in the image to be processed includes: separating the channels of the image to be processed to obtain the corresponding luminance image, first chrominance image, and second chrominance image of the image to be processed; performing edge detection on the luminance image to obtain the corresponding edge image of the image to be processed; and performing purple fringing detection on the edge image based on multiple preset detection thresholds and the luminance image, first chrominance image, and second chrominance image to determine the purple fringing area in the image to be processed.

[0069] The image to be processed is a YUV image. YUV is a color encoding system used to represent and process color information in images or videos. Different from the common RGB (Red, Green, Blue) color space, the YUV color space represents luminance (Y) and chrominance (U and V) separately. Luminance (Y) represents the black-and-white information in the image, while chrominance (U and V) represents the color information. Since the human eye is more sensitive to luminance and relatively less sensitive to chrominance, YUV encoding can reduce the data volume while maintaining the image quality. This makes YUV encoding widely used in image and video compression, transmission, and processing. In the YUV color space, the value range of luminance (Y) is from 0 to 255 (or 0 to 1), and the value range of chrominance (U and V) is from -128 to 127 (or -0.5 to 0.5). Common YUV formats include YUV420, YUV422, and YUV444, etc., which represent and store the color information in images or videos with different sampling methods and chrominance resolutions.

[0070] Optionally, before performing channel separation, the image to be processed is first optimized to facilitate subsequent parameter calculation. For example, the YUV420 image is converted to a YUV444 image through an interpolation operation so that each pixel corresponds to a set of YUV values.

[0071] Channel separation refers to decomposing the original image (such as in YUV format) into independent luminance (Y) and chrominance (U, V) channels to obtain the luminance image (Y), the first chrominance image (U), and the second chrominance image (V).

[0072] Edge detection is to extract the contour information of objects in the image through gradient calculation, identify the regions with drastic luminance changes, and obtain the corresponding edge image of the image to be processed. Optionally, the sobel operator is used for edge detection to obtain the edge image.

[0073] Among them, the preset detection threshold includes a preset edge gradient interval; the purple edge detection of the edge image based on a plurality of preset detection thresholds, the luminance image, the first chrominance image, and the second chrominance image to determine the purple edge area in the image to be processed includes: determining at least one candidate pixel point in the edge image whose pixel value gradient is greater than the lower limit value of the preset edge gradient interval; for each of the candidate pixel points, determining a neighborhood window centered on the candidate pixel point; obtaining the maximum luminance value of the pixel points within the neighborhood window; calculating the luminance filtering value corresponding to the neighborhood window according to the luminance image; determining the chrominance feature value of the candidate pixel point according to the first chrominance image and the luminance image; if the maximum luminance value, the luminance filtering value, and the chrominance feature value meet the preset conditions, determining the area corresponding to the neighborhood window as the purple edge area.

[0074] The preset detection threshold includes a preset edge gradient interval, which is determined by a preset edge gradient lower limit value EdgeThr[0] and a preset edge gradient upper limit value EdgeThr[1].

[0075] Traverse the pixel points in the edge image. For at least one pixel point whose pixel value gradient is greater than the lower limit value of the preset edge gradient interval, it is considered to be in the area of pixel value mutation, that is, the edge area of the subject in the image. The possibility that this pixel point is a purple edge pixel is relatively high and needs to be further determined.

[0076] That is, for the pixel value gradient EdgeImg(x, y) of any pixel point in the edge image EdgeImg, if EdgeImg(x, y)>EdgeThr[0], then this pixel point is a candidate pixel point.

[0077] The neighborhood window is the area covered by a preset mask (mask). For example, the neighborhood window is a window with a size of 7×7. The neighborhood window is a local area centered on the candidate pixel point, used to analyze the luminance and chrominance features of the candidate pixel point and its surrounding pixel points. The purple edge phenomenon usually shows luminance mutation and chrominance diffusion within the neighborhood, rather than isolated anomalies of individual pixels. Therefore, if the central pixel has a high gradient and the luminance and chrominance of the surrounding pixels conform to the purple edge characteristics, it is determined that this area is the purple edge area.

[0078] Among them, the maximum luminance value of the pixel points within the neighborhood window is the maximum value of all pixel luminances within the neighborhood window, reflecting the luminance peak of this area. This luminance maximum value is obtained based on the luminance image of the image to be processed.

[0079] For example, for the pixel at EdgeImg(x, y)>EdgeThr[0], with a 7x7 neighborhood window, find the maximum luminance value, denoted as MaxY.

[0080] The brightness filter value is obtained by filtering the brightness value in the neighborhood window, reflecting the overall brightness level in the neighborhood window.

[0081] In some embodiments, the brightness filter value corresponding to the neighborhood window is calculated based on the brightness image, including: determining the brightness matrix corresponding to the neighborhood window based on the brightness image; multiplying the brightness matrix with a preset two-dimensional Gaussian kernel to obtain a brightness feature matrix of the neighborhood window, and the two-dimensional Gaussian kernel is consistent with the size of the neighborhood window; calculating the sum of the elements of the brightness feature matrix to obtain the brightness filter value corresponding to the neighborhood window.

[0082] The preset 2D Gaussian kernel is a weight matrix used to filter brightness values. Its numerical distribution conforms to a 2D Gaussian function, with the highest weight at the center of the matrix and gradually decreasing towards the edges. The smoothing properties of the Gaussian kernel suppress noise interference while preserving edge information.

[0083] The new matrix obtained by element-by-element multiplication of the brightness matrix and the Gaussian kernel is the brightness feature matrix, which reflects the weighted distribution of the brightness of each pixel within the neighborhood window. Through weighted calculation, the contribution of the center pixel of the neighborhood window is significantly higher than that of the edge pixels. In other words, the closer the pixel is to the candidate point, the higher the contribution of the pixel brightness value. All elements of the brightness feature matrix are then summed to obtain a scalar value, which is used as the brightness filter value.

[0084] In the disclosed embodiment, the mask uses a two-dimensional Gaussian kernel. For the pixel where EdgeImg(x,y)>EdgeThr[0], the brightness value matrix corresponding to its neighborhood window is multiplied by the two-dimensional Gaussian kernel and the sum of each element is calculated to obtain a brightness filter value, which is recorded as LY.

[0085] The chromaticity feature value is obtained based on the first chromaticity and brightness of the candidate pixel.

[0086] In some embodiments, determining the chromaticity feature value of the candidate pixel point based on the first chromaticity image and the second chromaticity image includes: obtaining the first chromaticity of the candidate pixel point based on the first chromaticity image; obtaining the brightness of the candidate pixel point based on the brightness image; and calculating the ratio of the first chromaticity to the brightness to obtain the chromaticity feature value of the candidate pixel point.

[0087] In the YUV color space, the first chromaticity (U channel) represents the pixel's chromaticity offset on the blue-yellow axis, while the second chromaticity (V channel) represents the pixel's chromaticity offset on the red-green axis. The higher the first chromaticity value, the bluer the pixel's color. Purple fringing is characterized by abnormal refraction of blue light due to optical dispersion, so excessively high first chromaticity values are a characteristic of this region. The first chromaticity values are further normalized using the luminance value to suppress absolute color difference interference in high-luminance areas.

[0088] For example, for pixels where EdgeImg(x,y) > EdgeThr[0], calculate the chromaticity feature value, denoted as S0.

[0089] In some embodiments, the preset detection threshold further includes a preset brightness range and a preset color difference range; the step of determining the area corresponding to the neighborhood window as a purple edge area if the maximum brightness value, brightness filtering value, and chromaticity feature value meet the preset conditions includes: if the brightness filtering value is greater than the lower limit value of the preset edge gradient range, and the maximum brightness value is greater than the lower limit value of the preset brightness range, and the chromaticity feature value is greater than the lower limit value of the preset color difference range, then determine the area corresponding to the neighborhood window as a purple edge area.

[0090] The brightness filtering value is the overall brightness level of the neighborhood window calculated by weighting the brightness values of the neighborhood window, and it needs to be greater than the lower limit value of the preset edge gradient range to verify the relevance between the purple edge and the edge intensity.

[0091] The purple edge phenomenon mainly appears in the edge areas with highlight overflow. Even if there is chromaticity abnormality in the low-brightness areas, it is more likely to be caused by sensor noise or environmental light interference. By setting the lower limit value of the preset brightness range and screening the candidate pixel points with the maximum brightness value greater than the lower limit value of the preset brightness range, misjudgments in the low-brightness areas can be excluded.

[0092] The essence of the purple edge is the abnormal offset of the chromaticity channel. The chromaticity feature value quantifies the degree of chromaticity imbalance of the candidate pixel points. If the chromaticity feature value is greater than the lower limit value of the preset color difference range, it indicates that the chromaticity offset of the candidate pixel points is relatively serious.

[0093] In summary, when the brightness filtering value corresponding to the candidate pixel point and the neighborhood window is greater than the lower limit value of the preset edge gradient range, and the maximum brightness value is greater than the lower limit value of the preset brightness range, and the chromaticity feature value is greater than the lower limit value of the preset color difference range, the pixels in the candidate pixel point and the neighborhood window area meet the conditions of high brightness, strong edge, and chromaticity imbalance, and the area corresponding to the neighborhood window is determined as a purple edge area.

[0094] The embodiments of the present disclosure determine the edge candidate areas in the image based on image channel separation and edge detection, and through the calculation of the maximum brightness, filtered brightness, and chromaticity feature values of the neighborhood window and the combined multi-threshold determination of the brightness range, color difference range, and edge gradient range, ensure the rationality and accuracy of the purple edge area detection.

[0095] In some embodiments, the preset detection thresholds include a preset edge gradient range, a preset brightness range, and a preset color difference range; obtaining the edge correction coefficient, brightness correction coefficient, and color difference correction coefficient corresponding to each pixel point in the purple edge area according to the pixel point information in the purple edge area and the multiple preset detection thresholds includes: for each pixel point in the purple edge area, calculating the edge correction coefficient of the pixel point based on the brightness filtering value of the pixel point neighborhood window and the preset edge gradient range; calculating the brightness correction coefficient of the pixel point based on the maximum brightness value of the pixel point neighborhood window and the preset brightness range; calculating the color difference correction coefficient of the pixel point based on the chromaticity characteristic value of the pixel point and the preset color difference range.

[0096] The calculation process of the edge correction coefficient Edgecoef is expressed as:

[0097]

[0098] where LY is the brightness filtering value of the pixel point neighborhood window, and H E is the width of the preset edge gradient range, specifically the difference between the upper limit value EdgeThr[1] and the lower limit value EdgeThr[0] of the preset edge gradient range.

[0099] The calculation process of the brightness correction coefficient Ycoef is expressed as:

[0100]

[0101] where MaxY is the maximum brightness value of the pixel point neighborhood window, and H Y is the width of the preset brightness range, specifically the difference between the upper limit value YTht[1] and the lower limit value YThr[0] of the preset brightness range.

[0102] The calculation process of the color difference correction coefficient Scoef is expressed as:

[0103]

[0104] where S0 is the chromaticity characteristic value of the pixel point, and H S is the width of the preset color difference range, specifically the difference between the upper limit value SThr[1] and the lower limit value SThr[0] of the preset color difference range.

[0105] Further, calculating the purple fringing correction coefficient corresponding to each pixel point in the purple fringing area based on the edge correction coefficient, brightness correction coefficient, and color difference correction coefficient includes: calculating the width of the pixel value range and the preset edge gradient interval to obtain a first coefficient; calculating the product of the chromaticity reference value, the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient, and determining the ratio of the product to the chromaticity reference value as a second coefficient, where the chromaticity reference value is the sum of the first chromaticity value and the second chromaticity value of the pixel point; calculating the difference between the first coefficient and the second coefficient to obtain the purple fringing correction coefficient corresponding to the pixel point.

[0106] The calculation process of the purple fringing correction coefficient can be expressed as:

[0107]

[0108] Where, W is the pixel value range, for example, taking 256; H E is the width of the preset edge gradient interval, specifically the difference between the upper limit value and the lower limit value of the preset edge gradient interval; SUV is the chromaticity reference value, Edgecoef is the edge correction coefficient, Ycoef is the brightness correction coefficient, and Scoef is the color difference correction coefficient.

[0109] The smaller the purple fringing correction coefficient, the stronger the effect of removing purple fringing.

[0110] In some embodiments, performing purple fringing correction on the image to be processed according to the purple fringing correction coefficient to obtain the corrected image corresponding to the image to be processed includes: for each pixel point in each purple fringing area, calculating the ratio of the first correction value of the pixel point to the first coefficient to obtain the corrected first chromaticity value, where the first correction value is the product of the first chromaticity value of the pixel point and the purple fringing correction coefficient; calculating the ratio of the second correction value of the pixel point to the first coefficient to obtain the corrected second chromaticity value, where the second correction value is the product of the second chromaticity value of the pixel point and the purple fringing correction coefficient; obtaining the corrected image corresponding to the image to be processed according to the corrected first chromaticity value and the corrected second chromaticity value.

[0111] For any pixel point in the purple fringing area, the correction process of its first chromaticity value is expressed as:

[0112]

[0113] Where, UImg(x,y) is the original first chromaticity value of the pixel point, UImg′(x,y) is the corrected first chromaticity value; K is the purple fringing correction coefficient of the pixel point; W is the pixel value range; H E is the width of the preset edge gradient interval.

[0114] For any pixel point in the purple fringing area, its second chromaticity value correction process is expressed as:

[0115]

[0116] Among them, VImg(x,y) is the original second chromaticity value of this pixel point, and VImg′(x,y) is the corrected second chromaticity value; K is the purple fringing correction coefficient of this pixel point; W is the pixel value range; H E is the width of the preset edge gradient interval.

[0117] Optionally, based on the corrected first chromaticity value and the corrected second chromaticity value of each pixel value in the purple fringing area, the first chromaticity image and the second chromaticity image are respectively updated with chromaticity values to obtain the corrected first chromaticity image and the corrected second chromaticity image. The luminance image, the corrected first chromaticity image, and the corrected second chromaticity image are merged in channels to obtain the corrected image corresponding to the image to be processed.

[0118] Optionally, if the image to be processed is optimized before channel separation, and the YUV420 image is converted to a YUV444 image through an interpolation operation, then after the purple fringing correction is completed, the corrected image needs to be restored to the original format, that is, the YUV444 image is converted to a YUV420 image.

[0119] In the embodiments of the present disclosure, the edge correction coefficient is calculated through the luminance filtering value of the neighborhood window and the edge gradient interval to quantify the contribution of the edge intensity to chromatic dispersion; the luminance correction coefficient is generated based on the maximum luminance value and the luminance interval width to adaptively adjust the compensation strength of the overexposed area; the chromatic aberration correction coefficient is calculated by combining the chromaticity characteristic value and the chromatic aberration interval; the product of the edge correction coefficient, the luminance correction coefficient, and the chromatic aberration correction coefficient is normalized by the chromaticity reference value, so that the purple fringing correction coefficient conforms to the edge sharpness, luminance level, and chromatic aberration degree of the image to be processed, while eliminating purple fringing and retaining normal color transitions, thus ensuring the effect of purple fringing correction.

[0120] It should be understood that although Figure 1 the steps in the flowchart of Figure 1 are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figure 1 at least a part of the steps in can include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.

[0121] Figure 2 Schematic structural diagram of a purple fringing correction device provided by an embodiment of the present disclosure.

[0122] In one embodiment, as Figure 2 shown, a purple fringing correction device 20 is provided, including: a purple fringing detection module 21, a first coefficient calculation module 22, a second coefficient calculation module 23, and a purple fringing correction module 24; wherein, the purple fringing detection module 21 is configured to perform purple fringing detection on a to-be-processed image based on a plurality of preset detection thresholds to determine a purple fringing area in the to-be-processed image; the first coefficient calculation module 22 is configured to obtain an edge correction coefficient, a brightness correction coefficient, and a color difference correction coefficient corresponding to each pixel point in the purple fringing area according to pixel point information in the purple fringing area and the plurality of preset detection thresholds; the second coefficient calculation module 23 is configured to calculate a purple fringing correction coefficient corresponding to each pixel point in the purple fringing area based on the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient; and the purple fringing correction module 24 is configured to perform purple fringing correction on the to-be-processed image according to the purple fringing correction coefficient to obtain a corrected image corresponding to the to-be-processed image.

[0123] Optionally, the purple fringing detection module 21 includes a channel separation unit 211, an edge detection unit 212, and a purple fringing detection unit 213; the channel separation unit 211 is configured to perform channel separation on the to-be-processed image to obtain a brightness image, a first chrominance image, and a second chrominance image corresponding to the to-be-processed image; the edge detection unit 212 is configured to perform edge detection on the brightness image to obtain an edge image corresponding to the to-be-processed image; and the purple fringing detection unit 213 is configured to perform purple fringing detection on the edge image based on a plurality of preset detection thresholds and the brightness image, the first chrominance image, and the second chrominance image to determine a purple fringing area in the to-be-processed image.

[0124] Optionally, the preset detection threshold includes a preset edge gradient interval; specifically, the purple fringing detection unit 213 is configured to determine at least one candidate pixel point in the edge image whose pixel value gradient is greater than the lower limit value of the preset edge gradient interval; for each of the candidate pixel points, determine a neighborhood window centered on the candidate pixel point; obtain the maximum brightness value of the pixel points in the neighborhood window; calculate a brightness filtering value corresponding to the neighborhood window according to the brightness image; determine a chrominance feature value of the candidate pixel point according to the first chrominance image and the brightness image; and if the maximum brightness value, the brightness filtering value, and the chrominance feature value meet a preset condition, determine that the area corresponding to the neighborhood window is a purple fringing area.

[0125] Optionally, the preset detection threshold further includes a preset brightness range and a preset color difference range; the purple fringing detection unit 213 is specifically configured to determine that the area corresponding to the neighborhood window is a purple fringing area if the brightness filtering value is greater than the lower limit value of the preset edge gradient range, the maximum brightness value is greater than the lower limit value of the preset brightness range, and the chromaticity feature value is greater than the lower limit value of the preset color difference range.

[0126] Optionally, the preset detection threshold includes a preset edge gradient range, a preset brightness range, and a preset color difference range; the first coefficient calculation module 22 is specifically configured to, for each pixel point in each purple fringing area, calculate an edge correction coefficient of the pixel point based on the brightness filtering value of the neighborhood window of the pixel point and the preset edge gradient range; calculate a brightness correction coefficient of the pixel point based on the maximum brightness value of the neighborhood window of the pixel point and the preset brightness range; calculate a color difference correction coefficient of the pixel point based on the chromaticity feature value of the pixel point and the preset color difference range.

[0127] Optionally, the second coefficient calculation module 23 is specifically configured to calculate the width of the pixel value range and the preset edge gradient range to obtain a first coefficient; calculate the product of the chromaticity reference value, the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient, and determine the ratio of the product to the chromaticity reference value as a second coefficient, where the chromaticity reference value is the sum of the first chromaticity value and the second chromaticity value of the pixel point; calculate the difference between the first coefficient and the second coefficient to obtain the purple fringing correction coefficient corresponding to the pixel point.

[0128] Optionally, the purple fringing correction module 24 includes a first correction unit 241, a second correction unit 242, and an image processing unit 243; the first correction unit 241 is configured to, for each pixel point in each purple fringing area, calculate the ratio of the first correction value of the pixel point to the first coefficient to obtain a corrected first chromaticity value, where the first correction value is the product of the first chromaticity value of the pixel point and the purple fringing correction coefficient; the second correction unit 242 is configured to calculate the ratio of the second correction value of the pixel point to the first coefficient to obtain a corrected second chromaticity value, where the second correction value is the product of the second chromaticity value of the pixel point and the purple fringing correction coefficient; the image processing unit 243 is configured to obtain a corrected image corresponding to the image to be processed according to the corrected first chromaticity value and the corrected second chromaticity value.

[0129] Through multi-threshold detection and correction, and the combined determination of edge gradient, brightness, and color difference, the embodiments of the present disclosure avoid misjudgment in a single dimension, improve the accuracy of purple fringing detection, and use multi-dimensional correction coefficients to jointly determine the purple fringing correction coefficient for purple fringing correction, and do not rely on expensive coated lenses, ensuring the effect of purple fringing correction while saving hardware costs.

[0130] For the specific limitations of the purple fringing correction device, reference can be made to the limitations of the purple fringing correction method in the foregoing text, which will not be elaborated here. Each module in the above purple fringing correction device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to each of the above modules.

[0131] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 3 shown. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a carrier network, near field communication (NFC), or other technologies. The computer program, when executed by the processor, implements a purple fringing correction method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.

[0132] Those skilled in the art can understand that Figure 3 the structure shown in

[0133] is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout. Figure 3 In one embodiment, the purple fringing correction device provided by the present application can be implemented in the form of a computer program, and the computer program can run on a computer device as Figure 2 shown. The memory of the computer device can store each program module that makes up the purple fringing correction device. For example,

[0134] such as Figure 3The computer device shown can perform purple fringing detection on a to-be-processed image based on multiple preset detection thresholds through the purple fringing detection module in the purple fringing correction device shown in Figure 2 to determine the purple fringing area in the to-be-processed image. The computer device can execute, through the first coefficient calculation module, to obtain the edge correction coefficient, brightness correction coefficient, and color difference correction coefficient corresponding to each pixel point in the purple fringing area according to the pixel point information in the purple fringing area and multiple preset detection thresholds. The computer device can execute, through the second coefficient calculation module, to calculate the purple fringing correction coefficient corresponding to each pixel point in the purple fringing area based on the edge correction coefficient, brightness correction coefficient, and color difference correction coefficient. The computer device can perform purple fringing correction on the to-be-processed image according to the purple fringing correction coefficient through the purple fringing correction module to obtain the corrected image corresponding to the to-be-processed image.

[0135] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: performing purple fringing detection on a to-be-processed image based on multiple preset detection thresholds to determine the purple fringing area in the to-be-processed image; obtaining the edge correction coefficient, brightness correction coefficient, and color difference correction coefficient corresponding to each pixel point in the purple fringing area according to the pixel point information in the purple fringing area and multiple preset detection thresholds; calculating the purple fringing correction coefficient corresponding to each pixel point in the purple fringing area based on the edge correction coefficient, brightness correction coefficient, and color difference correction coefficient; performing purple fringing correction on the to-be-processed image according to the purple fringing correction coefficient to obtain the corrected image corresponding to the to-be-processed image.

[0136] In one embodiment, when the processor executes the computer program, the following steps are further implemented: performing channel separation on the to-be-processed image to obtain the luminance image, first chrominance image, and second chrominance image corresponding to the to-be-processed image; performing edge detection on the luminance image to obtain the edge image corresponding to the to-be-processed image; performing purple fringing detection on the edge image based on multiple preset detection thresholds and the luminance image, first chrominance image, and second chrominance image to determine the purple fringing area in the to-be-processed image.

[0137] In one embodiment, when the processor executes the computer program, the following steps are further implemented: determining at least one candidate pixel point in the edge image whose pixel value gradient is greater than the lower limit value of the preset edge gradient interval; for each candidate pixel point, determining a neighborhood window centered on the candidate pixel point; obtaining the maximum luminance value of the pixel points within the neighborhood window; calculating the luminance filtering value corresponding to the neighborhood window according to the luminance image; determining the chrominance feature value of the candidate pixel point according to the first chrominance image and the luminance image; if the maximum luminance value, luminance filtering value, and chrominance feature value meet the preset conditions, determining the area corresponding to the neighborhood window as the purple fringing area.

[0138] In one embodiment, when the processor executes the computer program, the following steps are further implemented: If the luminance filtering value is greater than the lower limit value of the preset edge gradient interval, and the maximum luminance value is greater than the lower limit value of the preset luminance interval, and the chromaticity feature value is greater than the lower limit value of the preset color difference interval, then it is determined that the area corresponding to the neighborhood window is a purple fringing area.

[0139] In one embodiment, when the processor executes the computer program, the following steps are further implemented: For each pixel point in the purple fringing area, based on the luminance filtering value of the pixel point's neighborhood window and the preset edge gradient interval, an edge correction coefficient of the pixel point is calculated; based on the maximum luminance value of the pixel point's neighborhood window and the preset luminance interval, a luminance correction coefficient of the pixel point is calculated; based on the chromaticity feature value of the pixel point and the preset color difference interval, a color difference correction coefficient of the pixel point is calculated.

[0140] In one embodiment, when the processor executes the computer program, the following steps are further implemented: Calculate the width of the pixel value range and the preset edge gradient interval to obtain a first coefficient; calculate the product of the chromaticity reference value, the edge correction coefficient, the luminance correction coefficient, and the color difference correction coefficient, and determine the ratio of the product to the chromaticity reference value as a second coefficient, where the chromaticity reference value is the sum of the first chromaticity value and the second chromaticity value of the pixel point; calculate the difference between the first coefficient and the second coefficient to obtain the purple fringing correction coefficient corresponding to the pixel point.

[0141] In one embodiment, when the processor executes the computer program, the following steps are further implemented: For each pixel point in the purple fringing area, calculate the ratio of the first correction value of the pixel point to the first coefficient to obtain the corrected first chromaticity value, where the first correction value is the product of the first chromaticity value of the pixel point and the purple fringing correction coefficient; calculate the ratio of the second correction value of the pixel point to the first coefficient to obtain the corrected second chromaticity value, where the second correction value is the product of the second chromaticity value of the pixel point and the purple fringing correction coefficient; according to the corrected first chromaticity value and the corrected second chromaticity value, obtain the corrected image corresponding to the image to be processed.

[0142] The embodiments of the present disclosure avoid misjudgment in a single dimension through multi-threshold detection and correction, combined with the joint determination of edge gradient, luminance, and color difference, improve the accuracy of purple fringing detection, and use multi-dimensional correction coefficients to jointly determine the purple fringing correction coefficient for purple fringing correction, and do not rely on expensive coated lenses, ensuring the effect of purple fringing correction while saving hardware costs.

[0143] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: performing purple fringing detection on a to-be-processed image based on a plurality of preset detection thresholds to determine a purple fringing region in the to-be-processed image; obtaining an edge correction coefficient, a brightness correction coefficient, and a color difference correction coefficient respectively corresponding to each pixel point in the purple fringing region according to the pixel point information in the purple fringing region and the plurality of preset detection thresholds; calculating a purple fringing correction coefficient respectively corresponding to each pixel point in the purple fringing region based on the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient; and performing purple fringing correction on the to-be-processed image according to the purple fringing correction coefficient to obtain a corrected image corresponding to the to-be-processed image.

[0144] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: performing channel separation on the to-be-processed image to obtain a brightness image, a first chrominance image, and a second chrominance image corresponding to the to-be-processed image; performing edge detection on the brightness image to obtain an edge image corresponding to the to-be-processed image; and performing purple fringing detection on the edge image based on the plurality of preset detection thresholds, the brightness image, the first chrominance image, and the second chrominance image to determine a purple fringing region in the to-be-processed image.

[0145] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining at least one candidate pixel point in the edge image whose pixel value gradient is greater than a lower limit value of a preset edge gradient interval; for each candidate pixel point, determining a neighborhood window centered on the candidate pixel point; obtaining a maximum brightness value of pixel points within the neighborhood window; calculating a brightness filtering value corresponding to the neighborhood window according to the brightness image; determining a chrominance feature value of the candidate pixel point according to the first chrominance image and the brightness image; and if the maximum brightness value, the brightness filtering value, and the chrominance feature value meet preset conditions, determining the region corresponding to the neighborhood window as a purple fringing region.

[0146] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: if the brightness filtering value is greater than the lower limit value of the preset edge gradient interval, the maximum brightness value is greater than the lower limit value of a preset brightness interval, and the chrominance feature value is greater than the lower limit value of a preset color difference interval, determining the region corresponding to the neighborhood window as a purple fringing region.

[0147] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: for each pixel point in a purple fringing region, calculating an edge correction coefficient of the pixel point based on the brightness filtering value of the pixel point neighborhood window and the preset edge gradient interval; calculating a brightness correction coefficient of the pixel point based on the maximum brightness value of the pixel point neighborhood window and the preset brightness interval; and calculating a color difference correction coefficient of the pixel point based on the chrominance feature value of the pixel point and the preset color difference interval.

[0148] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: calculating the width of the pixel value range and the preset edge gradient interval to obtain a first coefficient; calculating the product of the chromaticity reference value, the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient, and determining the ratio of the product to the chromaticity reference value as a second coefficient, where the chromaticity reference value is the sum of the first chromaticity value and the second chromaticity value of the pixel; calculating the difference between the first coefficient and the second coefficient to obtain the purple fringing correction coefficient corresponding to the pixel.

[0149] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: for each pixel in the purple fringing region, calculating the ratio of the first correction value of the pixel to the first coefficient to obtain the corrected first chromaticity value, where the first correction value is the product of the first chromaticity value of the pixel and the purple fringing correction coefficient; calculating the ratio of the second correction value of the pixel to the first coefficient to obtain the corrected second chromaticity value, where the second correction value is the product of the second chromaticity value of the pixel and the purple fringing correction coefficient; obtaining the corrected image corresponding to the image to be processed according to the corrected first chromaticity value and the corrected second chromaticity value.

[0150] The embodiments of the present disclosure avoid misjudgment in a single dimension through multi-threshold detection and correction, combined with the joint determination of edge gradient, brightness, and color difference, improve the accuracy of purple fringing detection, and use multi-dimensional correction coefficients to jointly determine the purple fringing correction coefficient for purple fringing correction, without relying on expensive coated lenses, ensuring the effect of purple fringing correction while saving hardware costs.

[0151] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium provided in the embodiments of the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, or optical memories, etc. Volatile memories can include random access memory (RAM) or external cache memories. By way of illustration and not limitation, RAM is available in various forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM), etc.

[0152] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0153] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.

Claims

1. A purple edge correction method, characterized in that, The method includes: Performing purple edge detection on the image to be processed based on multiple preset detection thresholds to determine the purple edge region in the image to be processed; Obtaining an edge correction coefficient, a brightness correction coefficient, and a color difference correction coefficient respectively corresponding to each pixel point in the purple edge region according to the pixel point information in the purple edge region and the multiple preset detection thresholds; Calculating a purple edge correction coefficient respectively corresponding to each pixel point in the purple edge region based on the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient; Performing purple edge correction on the image to be processed according to the purple edge correction coefficient to obtain a corrected image corresponding to the image to be processed.

2. The method according to claim 1, characterized in that The performing purple edge detection on the image to be processed based on multiple preset detection thresholds to determine the purple edge region in the image to be processed includes: Separating channels of the image to be processed to obtain a brightness image, a first chrominance image, and a second chrominance image corresponding to the image to be processed; Performing edge detection on the brightness image to obtain an edge image corresponding to the image to be processed; Performing purple edge detection on the edge image based on multiple preset detection thresholds and the brightness image, the first chrominance image, and the second chrominance image to determine the purple edge region in the image to be processed.

3. The method according to claim 2, wherein The preset detection thresholds include a preset edge gradient range; the performing purple edge detection on the edge image based on multiple preset detection thresholds and the brightness image, the first chrominance image, and the second chrominance image to determine the purple edge region in the image to be processed includes: Determining at least one candidate pixel point in the edge image whose pixel value gradient is greater than the lower limit value of the preset edge gradient range; For each of the candidate pixel points, determining a neighborhood window centered on the candidate pixel point; Obtaining the maximum brightness value of the pixel points within the neighborhood window; Calculating a brightness filtering value corresponding to the neighborhood window according to the brightness image; Determining a chrominance feature value of the candidate pixel point according to the first chrominance image and the brightness image; If the maximum brightness value, the brightness filtering value, and the chrominance feature value meet the preset conditions, determining the region corresponding to the neighborhood window as the purple edge region.

4. The method according to claim 3, wherein The preset detection thresholds further include a preset brightness range and a preset color difference range; The if the maximum brightness value, the brightness filtering value, and the chrominance feature value meet the preset conditions, determining the region corresponding to the neighborhood window as the purple edge region includes: If the brightness filtering value is greater than the lower limit value of the preset edge gradient range, and the maximum brightness value is greater than the lower limit value of the preset brightness range, and the chrominance feature value is greater than the lower limit value of the preset color difference range, determining the region corresponding to the neighborhood window as the purple edge region.

5. The method according to claim 1, wherein The preset detection thresholds include a preset edge gradient range, a preset brightness range, and a preset color difference range; The obtaining an edge correction coefficient, a brightness correction coefficient, and a color difference correction coefficient respectively corresponding to each pixel point in the purple edge region according to the pixel point information in the purple edge region and the multiple preset detection thresholds includes: For each pixel point in each of the purple edge regions, an edge correction coefficient of the pixel point is calculated based on the brightness filtering value of the pixel point neighborhood window and the preset edge gradient interval; A brightness correction coefficient of the pixel point is calculated based on the maximum brightness value of the pixel point neighborhood window and the preset brightness interval; A color difference correction coefficient of the pixel point is calculated based on the chromaticity characteristic value of the pixel point and the preset color difference interval.

6. The method according to claim 5, wherein The calculating the purple edge correction coefficient corresponding to each pixel point in the purple edge region based on the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient includes: Calculating the width of the pixel value range and the preset edge gradient interval to obtain a first coefficient; Calculating the product of the chromaticity reference value, the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient, and determining the ratio of the product to the chromaticity reference value as a second coefficient, where the chromaticity reference value is the sum of the first chromaticity value and the second chromaticity value of the pixel point; Calculating the difference between the first coefficient and the second coefficient to obtain the purple edge correction coefficient corresponding to the pixel point.

7. The method according to claim 5, wherein The performing purple edge correction on the image to be processed according to the purple edge correction coefficient to obtain the corrected image corresponding to the image to be processed includes: For each pixel point in each of the purple edge regions, calculating the ratio of the first correction value of the pixel point to the first coefficient to obtain the corrected first chromaticity value, where the first correction value is the product of the first chromaticity value of the pixel point and the purple edge correction coefficient; Calculating the ratio of the second correction value of the pixel point to the first coefficient to obtain the corrected second chromaticity value, where the second correction value is the product of the second chromaticity value of the pixel point and the purple edge correction coefficient; Obtaining the corrected image corresponding to the image to be processed according to the corrected first chromaticity value and the corrected second chromaticity value.

8. A purple edge correction device, characterized in that, Including: A purple edge detection module, configured to perform purple edge detection on the image to be processed based on a plurality of preset detection thresholds, and determine the purple edge regions in the image to be processed; A first coefficient calculation module, configured to obtain the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient corresponding to each pixel point in the purple edge region according to the pixel point information in the purple edge region and the plurality of preset detection thresholds; A second coefficient calculation module, configured to calculate the purple edge correction coefficient corresponding to each pixel point in the purple edge region based on the edge correction coefficient, the brightness correction coefficient, and the color difference correction coefficient; A purple edge correction module, configured to perform purple edge correction on the image to be processed according to the purple edge correction coefficient to obtain the corrected image corresponding to the image to be processed.

9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.