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

By converting the image from RGB space to HSV space and utilizing the data information of the HSV color image, the intensity of purple fringing is determined and eliminated, thus achieving effective correction of purple fringing in the image. This solves the problem of purple fringing affecting image quality in existing technologies and improves the imaging effect.

CN115760599BActive Publication Date: 2026-05-12ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2022-10-28
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In existing technologies, images exhibit abnormal purple fringing, which affects image quality, and improvements through lens hardware are limited.

Method used

By converting the image to be processed from RGB space to HSV space, the intensity information of purple fringing is determined using the data from the RGB channel and the HSV color image. Based on this information, the purple fringing is eliminated, including the calculation of edge intensity, contrast intensity, and chromaticity intensity. Finally, the correction process is performed in both HSV and RGB spaces.

Benefits of technology

It effectively eliminates abnormal purple fringing in images, improves image quality, and achieves low-cost and universally applicable image correction effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115760599B_ABST
    Figure CN115760599B_ABST
Patent Text Reader

Abstract

The application provides an image purple edge elimination method, device, terminal and computer readable storage medium. The image purple edge elimination method comprises the following steps: obtaining a to-be-processed image, wherein the to-be-processed image is a color image containing a purple edge; converting the to-be-processed image from an RGB space to an HSV space to obtain an HSV color image corresponding to the to-be-processed image; determining intensity information of the purple edge based on RGB channel data of the to-be-processed image and data information of the HSV color image; and eliminating the purple edge in the to-be-processed image based on the intensity information of the purple edge. According to the RGB channel data of the to-be-processed image and the data information of the HSV color image, the intensity information of the purple edge is determined, and then the purple edge in the to-be-processed image is corrected based on the intensity information of the purple edge, so that the abnormal purple edge in the to-be-processed image is eliminated and the imaging quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image correction technology, and in particular to a method, apparatus, terminal, and computer-readable storage medium for eliminating purple fringing in images. Background Technology

[0002] Image fringing refers to the appearance of colors at the edges of objects in an image that do not belong to the objects themselves. It is a localized color error in the image and therefore has a significant impact on image quality and visual effect. There are many types and causes of image fringing, among which chromatic aberration caused by optical systems such as lenses is a prominent and important reason. The wavelength range of visible light is approximately 380nm to 760nm. Due to the inherent properties of lens materials, the refractive index varies for different wavelengths; generally, the longer the wavelength, the greater the refractive index. Therefore, when light of different wavelengths passes through the same optical system, the focal point and imaging position differ, resulting in the appearance of colors at the image edges that do not belong to the objects themselves. This is chromatic aberration caused by the optical system. Optical system chromatic aberration can be divided into longitudinal chromatic aberration and lateral chromatic aberration. Longitudinal chromatic aberration often manifests as abnormal purple fringing in overexposed areas.

[0003] While complex lens designs can eliminate longitudinal chromatic aberration, these designs are intricate, costly, and difficult to implement. In contrast, post-processing methods offer advantages such as lower cost and greater versatility. Besides chromatic aberration caused by the optical system, the widespread presence of blue-violet short-wavelength light in the atmosphere and overexposure / charge overflow in imaging devices like CCDs and CMOS sensors can also cause purple fringing at the edges of bright areas in images. These phenomena are difficult to improve through lens hardware settings. Summary of the Invention

[0004] The main technical problem solved by this invention is to provide a method, apparatus, terminal and computer-readable storage medium for eliminating purple fringing in images, thereby solving the problem of abnormal purple fringing in images that affects imaging quality in the prior art.

[0005] To solve the above-mentioned technical problems, the first technical solution adopted by the present invention is: to provide an image purple fringing removal method, the image purple fringing removal method comprising: acquiring an image to be processed, the image to be processed being a color image of a target object containing purple fringing; converting the image to be processed from RGB space to HSV space to obtain an HSV color image corresponding to the image to be processed; determining the intensity information of the purple fringing based on the RGB channel data of the image to be processed and the data information of the HSV color image; and removing the purple fringing in the image to be processed based on the intensity information of the purple fringing.

[0006] Specifically, based on the RGB channel data of the image to be processed and the data information of the HSV color image, the intensity information of the purple edge is determined, including: based on the RGB channel data of the image to be processed and the data information of the HSV color image, the edge intensity, contrast intensity, and chromaticity intensity of the purple edge are determined; based on the edge intensity, contrast intensity, and chromaticity intensity corresponding to the purple edge, the intensity information of the purple edge is determined.

[0007] The HSV color image includes a hue component (H), a saturation component (S), and a luminance component (V). Determining the edge intensity of the purple fringing includes the following steps: determining the first edge information of the target object based on any one of the G, R, or B channel data in the RGB channel data of the image to be processed; determining the second edge information of the corresponding target object based on the saturation component (S) and luminance component (V) of the HSV color image; and determining the edge intensity of the purple fringing of the target object based on the first and second edge information of the target object.

[0008] Specifically, the first edge information of the target object is determined based on any one of the G channel data, R channel data, and B channel data in the RGB channel data of the image to be processed, including: determining the first edge information of the target object based on the G channel data in the RGB channel data of the image to be processed.

[0009] Specifically, the determination of the second edge information of the corresponding target object based on the saturation component S and the luminance component V of the HSV color image includes: determining the saturation-luminance joint variable based on the saturation component S and the luminance component V of the HSV color image; and determining the second edge information of the corresponding target object based on the saturation-luminance joint variable of the HSV color image.

[0010] The determination of the contrast intensity of the purple edge includes the following steps: determining the corresponding neighborhood region centered on the current pixel and selecting the maximum G channel data within the neighborhood region; determining the contrast of the current pixel based on the maximum G channel data and the G channel data of the current pixel; and determining the contrast intensity of the purple edge based on the contrast of the current pixel.

[0011] The step of determining the contrast intensity of the purple edge based on the contrast of the current pixel includes: determining the contrast intensity of the purple edge to be 0 in response to the contrast of the current pixel being less than a first preset value; determining the contrast intensity of the purple edge to be 1 in response to the contrast of the current pixel being greater than a second preset value; and determining the contrast of the current pixel to be the contrast intensity of the purple edge in response to the contrast of the current pixel being neither less than the first preset value nor greater than the second preset value.

[0012] The determination of the chromaticity intensity of the purple edge includes the following steps: Based on the RGB channel data of each pixel in the image to be processed and the corresponding data information of each pixel in the HSV color image, determine the chromaticity intensity of each pixel; determine the neighborhood region of the current pixel, centered on the current pixel, which includes multiple sub-regions; select the minimum chromaticity intensity from all the chromaticity intensities of all pixels contained in each sub-region as the minimum chromaticity intensity corresponding to each sub-region; determine the purple edge chromaticity intensity of the current pixel based on the minimum chromaticity intensity with the largest value among the minimum chromaticity intensities corresponding to the multiple sub-regions and the chromaticity intensity of the current pixel; and determine the chromaticity intensity of the purple edge based on the purple edge chromaticity intensity of the current pixel.

[0013] Specifically, the chromaticity intensity of each pixel is determined based on the RGB channel data of each pixel in the image to be processed and the corresponding data information of each pixel in the HSV color image. This includes: determining the first chromaticity intensity of the pixel based on the color difference between the R channel data, B channel data and G channel data of the pixel in the image to be processed, respectively; determining the second chromaticity intensity of the pixel based on the hue component H of the pixel in the HSV color image corresponding to the pixel in the image to be processed; and determining the chromaticity intensity of the pixel based on the first chromaticity intensity and the second chromaticity intensity corresponding to the pixel.

[0014] Specifically, determining the chromatic intensity of the purple edge based on the chromatic intensity of the current pixel includes: determining the chromatic intensity of the purple edge to be 0 if the chromatic intensity of the purple edge of the current pixel is less than a first threshold; determining the chromatic intensity of the purple edge to be 1 if the chromatic intensity of the purple edge of the current pixel is greater than a second threshold; and determining the chromatic intensity of the purple edge of the current pixel to be the chromatic intensity of the purple edge if the chromatic intensity of the purple edge of the current pixel is not less than the first threshold and not greater than the second threshold.

[0015] Specifically, the intensity information of the purple edge is determined based on the edge intensity, contrast intensity, and chromaticity intensity corresponding to the purple edge. This includes: calculating the initial intensity information of the purple edge based on the product of the edge intensity, contrast intensity, and chromaticity intensity corresponding to the purple edge and a preset adjustment parameter; and determining the intensity information of the purple edge based on the initial intensity information of the purple edge.

[0016] Specifically, determining the intensity information of the purple edge based on the initial intensity information of the purple edge includes: determining the intensity information of the purple edge as 0 if the initial intensity information of the purple edge is less than a first value; determining the intensity information of the purple edge as 1 if the initial intensity information of the purple edge is greater than a second value; and determining the initial intensity information of the purple edge as the intensity information of the purple edge if the initial intensity information of the purple edge is not less than the first value and not greater than the second value.

[0017] The process of eliminating purple edges in the image to be processed based on the intensity information of the purple edges includes: determining whether the purple edges in the image to be processed are abnormal purple edges based on the intensity information of the purple edges; and eliminating the abnormal purple edges in the image to be processed based on the intensity information of the abnormal purple edges if the purple edges in the image to be processed are abnormal purple edges.

[0018] The process of eliminating abnormal purple fringes in the image to be processed based on the intensity information of the abnormal purple fringes includes: correcting the HSV color image based on the intensity information of the abnormal purple fringes, and converting the corrected HSV color image to RGB space to obtain first corrected RGB channel data; correcting the RGB channel data of the image to be processed based on the intensity information of the abnormal purple fringes to obtain second corrected RGB channel data; and determining the corrected RGB channel data of the image to be processed based on the first corrected RGB channel data and the second corrected RGB channel data.

[0019] The process involves correcting the purple fringing in the image to be processed based on the intensity information of the purple fringing. This includes: performing Gaussian filtering on the intensity information of the purple fringing to obtain the intensity information of the filtered purple fringing; and selecting the one with the largest value between the intensity information of the purple fringing before filtering and the intensity information of the purple fringing after filtering to eliminate the purple fringing in the image to be processed.

[0020] To solve the above-mentioned technical problems, the second technical solution adopted by the present invention is: to provide an image purple fringing removal device, the image purple fringing removal device comprising: an acquisition module for acquiring an image to be processed, the image to be processed being a color image containing purple fringing; a conversion module for converting the image to be processed from RGB space to HSV space to obtain an HSV color image corresponding to the image to be processed; an analysis module for determining the intensity information of purple fringing based on the RGB channel data of the image to be processed and the data information of the HSV color image; and a correction module for removing purple fringing in the image to be processed based on the intensity information of purple fringing.

[0021] To solve the above-mentioned technical problems, the third technical solution adopted by the present invention is to provide a terminal, which includes a memory, a processor, and a computer program stored in the memory and running on the processor. The processor is used to execute program data to implement the steps in the above-mentioned image purple fringing removal method.

[0022] To solve the above-mentioned technical problems, the fourth technical solution adopted by the present invention is to provide a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps in the above-mentioned image purple fringing removal method.

[0023] The beneficial effects of this invention are as follows: Unlike existing technologies, this invention provides a method, apparatus, terminal, and computer-readable storage medium for eliminating purple fringing in images. The method includes acquiring an image to be processed, which is a color image of a target object containing purple fringing; converting the image to be processed from RGB space to HSV space to obtain an HSV color image corresponding to the image to be processed; determining the intensity information of the purple fringing based on the RGB channel data of the image to be processed and the data information of the HSV color image; and eliminating the purple fringing in the image to be processed based on the intensity information. This application determines the intensity information of the purple fringing based on the RGB channel data of the image to be processed and the data information of the HSV color image, and then corrects the purple fringing in the image to be processed based on the intensity information, eliminating abnormal purple fringing in the image to be processed and improving image quality. Attached Figure Description

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

[0025] Figure 1 This is a flowchart illustrating the image purple fringing removal method provided by the present invention;

[0026] Figure 2 yes Figure 1 A flowchart illustrating a specific embodiment of step S3 in the provided image purple fringing removal method;

[0027] Figure 3 yes Figure 2 A flowchart illustrating a specific embodiment of step S31 in the provided image purple fringing removal method;

[0028] Figure 4 yes Figure 3 A flowchart illustrating a specific embodiment of step S3112 in the provided image purple fringing removal method;

[0029] Figure 5 yes Figure 2 A flowchart illustrating another specific embodiment of step S31 in the provided image purple fringing removal method;

[0030] Figure 6 yes Figure 2 A flowchart illustrating another specific embodiment of step S31 in the provided image purple fringing removal method;

[0031] Figure 7 yes Figure 6A flowchart illustrating a specific embodiment of step S3131 in the provided image purple fringing removal method;

[0032] Figure 8 This is a schematic diagram showing the division of the neighborhood region of the current pixel;

[0033] Figure 9 yes Figure 2 A flowchart illustrating a specific embodiment of step S32 in the provided image purple fringing removal method;

[0034] Figure 10 yes Figure 1 A flowchart illustrating a specific embodiment of step S4 in the provided image purple fringing removal method;

[0035] Figure 11 This is a schematic diagram of the frame of an embodiment of the image purple fringing removal device provided by the present invention;

[0036] Figure 12 This is a schematic diagram of the framework of an embodiment of the terminal provided in this application;

[0037] Figure 13 A schematic diagram of a framework of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0038] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0039] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.

[0040] In this article, the term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "more" in this article means two or more objects.

[0041] To enable those skilled in the art to better understand the technical solution of the present invention, the following describes in further detail an image purple fringing removal method provided by the present invention with reference to the accompanying drawings and specific embodiments.

[0042] Please see Figure 1 , Figure 1 This is a schematic flowchart of the image purple fringing removal method provided by the present invention. This embodiment provides an image purple fringing removal method, which includes the following steps.

[0043] S1: Obtain the image to be processed.

[0044] Specifically, the image to be processed is a color image of the target object containing purple fringes.

[0045] In one specific embodiment, an image acquisition device is used to photograph a target object with high contrast to the background to obtain a color image containing purple fringing, which serves as the image to be processed. The color image has RGB three-channel image data.

[0046] S2: Convert the image to be processed from RGB space to HSV space to obtain the HSV color image corresponding to the image to be processed.

[0047] Specifically, the HSV color space is more intuitive than the RGB color space. When searching for purple areas, in order to obtain luminance and chromaticity information, the image to be processed is converted from the RGB space to the HSV space, and the purple fringed areas and their intensity are determined within the HSV color space.

[0048] In one embodiment, in HSV, H represents the hue component, with a value range of 0 to 360°; S represents the saturation component, with a value range of 0 to 1; and V represents the value component, with a value range of 0 to 1. In RGB, R, G, and B are the red, green, and blue component values ​​in the three primary color format, respectively, with values ​​ranging from 0 to 255.

[0049] In one specific embodiment, the pixels in the image to be processed can be converted from RGB space to HSV space based on the following formulas 1, 2 and 3 to obtain the HSV color image corresponding to the image to be processed.

[0050]

[0051]

[0052] V = max(R, G, B) (Formula 3)

[0053] In the formula, max(R, G, B) represents the maximum value of the three RGB channels, and mix(R, G, B) represents the minimum value of the three RGB channels.

[0054] S3: Determine the intensity information of the purple edge based on the RGB channel data of the image to be processed and the data information of the HSV color image.

[0055] In one embodiment, the intensity information of the abnormal purple fringing of the target object is determined based on the RGB channel data of the image to be processed and the corresponding HSV color image data. The intensity information of the purple fringing is determined by edge intensity, contrast intensity, and chromaticity intensity. Specifically, the methods for determining edge intensity, contrast intensity, chromaticity intensity, and the method for determining the intensity information of the purple fringing include the following steps.

[0056] Please see Figure 2 , Figure 2 yes Figure 1 A flowchart illustrating a specific embodiment of step S3 in the provided image purple fringing removal method.

[0057] S31: Based on the RGB channel data of the image to be processed and the data information of the HSV color image, determine the edge intensity, contrast intensity, and chromaticity intensity of the purple edge.

[0058] In one embodiment, determining the edge intensity of the purple edge includes the following steps:

[0059] Please see Figure 3 , Figure 3 yes Figure 2 A flowchart illustrating a specific embodiment of step S31 in the provided image purple fringing removal method.

[0060] S3111: Determine the first edge information of the target object based on any one of the G channel data, R channel data, and B channel data in the RGB channel data of the image to be processed.

[0061] Specifically, any one of the G, R, or B channels in the RGB channel data of the image to be processed can be used as a single channel to extract the first edge information of the target object. In one specific embodiment, when the image to be processed has purple fringing, the R and B channels in the RGB channel data of the image to be processed are both greater than the G channel data. To more accurately and conveniently determine the first edge information of the target object in the image to be processed, the first edge information of the target object is determined based on the G channel data in the RGB channel data of the image to be processed. The first edge information of the target object is denoted as edge. g .

[0062] In one specific embodiment, the variance of any channel data in the RGB channel data of the image to be processed can be locally calculated to determine the first edge information of the target object in the image to be processed.

[0063] In one specific embodiment, corner detection of a template can be performed on any channel of the RGB channel data of the image to be processed to determine the first edge information of the target object in the image. The corner detection of the template can be Sobel edge detection, Robert edge detection, Laplace edge detection, etc.

[0064] In one specific embodiment, an edge detection method with a fixed procedure can be applied to any channel of the RGB channel data of the image to be processed to determine the first edge information of the target object in the image. For example, the edge detection method can be the Canny edge detection method, etc.

[0065] In one specific embodiment, edge detection using deep learning can be performed on any channel of the RGB channel data of the image to be processed to determine the first edge information of the target object in the image to be processed.

[0066] Since there are many types of edge detection and they are well-developed, different methods can be selected according to different requirements for accuracy and computational intensity to ensure the reliability of detection and provide assurance for the accuracy of parameter calculation.

[0067] S3112: Based on the saturation component S and the luminance component V of the HSV color image, determine the second edge information of the target object in the corresponding image to be processed.

[0068] Specifically, determining the second edge information of the target object in the image to be processed includes the following steps. The second edge information of the target object is denoted as edge. sv .

[0069] Please see Figure 4 , Figure 4 yes Figure 3 A flowchart illustrating a specific embodiment of step S3112 in the provided image purple fringing removal method.

[0070] S3112a: Determine the saturation-luminance joint variable based on the saturation component S and luminance component V of the HSV color image.

[0071] Specifically, the definition of this saturation-brightness joint variable allows saturation and brightness to be combined, which makes it easier and more effective to determine saturation and brightness information compared to calculating saturation and brightness separately.

[0072] Based on the following formula, the saturation component S and the luminance component V of the HSV color image are used to determine the saturation-luminance joint variable.

[0073] SV=(S+0.5)×V (Formula 4)

[0074] S3112b: Determine the second edge information of the corresponding target object based on the saturation-luminance joint variable of the HSV color image.

[0075] Specifically, based on the saturation-luminance joint variable of the HSV color image, the second edge information of the target object in the HSV domain can be determined.

[0076] S3113: Determine the edge intensity of the purple edge based on the first edge information and the second edge information of the target object.

[0077] Specifically, the edge intensity of the purple edge can be determined by summing the first edge information and the second edge information of the target object in the image to be processed.

[0078] In one specific embodiment, the edge intensity w of the purple edge is calculated based on the following formula. e .

[0079] w e =edge g +edge sv (Formula 5)

[0080] The above steps can be used to determine the edge intensity w of the purple fringing of the target object in the image to be processed. e .

[0081] In one embodiment, determining the contrast intensity of the purple edge includes the following steps.

[0082] Please see Figure 5 , Figure 5 yes Figure 2 A flowchart illustrating another specific embodiment of step S31 in the provided image purple fringing removal method.

[0083] S3121: Determine the corresponding neighborhood region centered on the current pixel, and select the largest G channel data within the neighborhood region.

[0084] Specifically, a pixel in the image to be processed is taken as the current pixel. A preset range is determined with the current pixel as the center, and the G channel data with the largest value is selected within the preset range, denoted as g. m In this embodiment, the preset range can be a rectangular area or a circular area. The specific range can be set according to the actual situation.

[0085] S3122: Determine the contrast of the current pixel based on the maximum G channel data and the G channel data of the current pixel.

[0086] Specifically, in order to determine the contrast of the current pixel with respect to the preset area, the contrast co of the current pixel is determined by the following formula based on the maximum G channel data within the preset area and the G channel data of the current pixel.

[0087]

[0088] In the formula: G P It is the G channel data of the current pixel.

[0089] S3123: Determine the contrast intensity of the purple edge based on the contrast of the current pixel.

[0090] Specifically, in response to the current pixel's contrast being less than a first preset value, the contrast intensity of the purple edge is determined to be 0. In response to the current pixel's contrast being greater than a second preset value, the contrast intensity of the purple edge is determined to be 1. In response to the current pixel's contrast being neither less than the first preset value nor greater than the second preset value, the contrast of the current pixel is determined to be the contrast intensity of the purple edge. The first and second preset values ​​can be set according to actual conditions.

[0091] In one specific embodiment, the first preset value is t1, and the second preset value is t2. The values ​​of t1 and t2 can be set according to actual conditions. The contrast intensity w of the purple edge of the target object is determined based on the contrast of the current pixel using the following formula. co .

[0092]

[0093] In the formula: t1 is set to 0.1, and t2 is set to 0.5.

[0094] In one embodiment, determining the chromaticity intensity of the purple edge includes the following steps.

[0095] Please see Figure 6 , Figure 6 yes Figure 2 A flowchart illustrating another specific embodiment of step S31 in the provided image purple fringing removal method.

[0096] S3131: Determine the chromaticity intensity of each pixel based on the RGB channel data of each pixel in the image to be processed and the corresponding data information of each pixel in the HSV color image.

[0097] Specifically, determining the chromatic intensity of each pixel includes the following steps.

[0098] Please see Figure 7 , Figure 7 yes Figure 6 A flowchart illustrating a specific embodiment of step S3131 in the provided image purple fringing removal method.

[0099] S3131a: Determine the first chromaticity intensity of purple for a pixel based on the color difference between the R channel data, B channel data and G channel data of the pixel in the image to be processed.

[0100] Specifically, in the RGB domain, the first chromaticity intensity ch of the purple color at the corresponding pixel is determined based on the color difference between the R and G channel data of the pixels in the image to be processed, and the color difference between the B and G channel data of the pixels in the image to be processed. rgb .

[0101] ch rgb =ABS(BG) + ABS(RG) (Formula 8)

[0102] In the formula, ABS(*) represents the absolute value.

[0103] S3131b: Determine the second chromaticity intensity of purple for each pixel based on the hue component H of the HSV color image corresponding to the pixel in the image to be processed.

[0104] Specifically, based on the magnitude of the hue component H of the pixel in the HSV color image corresponding to the pixel in the image to be processed, the second chromaticity intensity ch of the purple color of the pixel is determined. hsv .

[0105] In one specific embodiment, by setting a first threshold parameter h t1 Second threshold parameter h t2 The values ​​of the first threshold parameter and the second threshold parameter can be in the range of 180° ≤ h. t1 ≤h t2 ≤360°. Based on the magnitude of the hue component H in the HSV color image corresponding to the pixel in the image to be processed, determine the second chromaticity intensity ch of the purple pixel. hsv .

[0106]

[0107] S3131c: Determine the chromaticity intensity of a pixel based on the first and second chromaticity intensities corresponding to the pixel.

[0108] Specifically, the chromaticity intensity of purple of a pixel is determined by the product of the first chromaticity intensity and the second chromaticity intensity corresponding to the pixel.

[0109] In one specific embodiment, the chromaticity intensity 'a' of the purple color of a pixel is calculated using the following formula. ch .

[0110] α ch =ch hsv ×ch rgb (Formula 10)

[0111] The purple chromaticity intensity of each pixel in the image to be processed is determined through the above step S3131.

[0112] Specifically, after determining the chromatic intensity of the purple color in a pixel, it is necessary to distinguish whether the purple color of the pixel belongs to a purple object. If the purple color of the pixel belongs to a purple object, then it is necessary to protect the purple color of the purple object from being eliminated.

[0113] S3132: Determine the neighborhood region of the current pixel with the current pixel as the center. The neighborhood region includes multiple sub-regions.

[0114] Please see Figure 8 , Figure 8 This is a schematic diagram showing the division of the neighborhood region of the current pixel.

[0115] Specifically, a pixel in the image to be processed is taken as the current pixel, and a neighborhood region is determined centered on the current pixel. This neighborhood region can be a rectangular or circular window. The neighborhood region has 2r+1 rows and 2r+1 columns, and its row and column range can be represented as (1:2r+1, 1:2r+1). That is, the number of rows in the neighborhood region ranges from row 1 to row 2r+1, and the number of columns ranges from column 1 to column 2r+1. The neighborhood region is then divided into four identical sub-regions: REC1, REC2, REC3, and REC4. In this embodiment, REC1 has a row and column range of (1:r+1, 1:r+1), REC2 has a row and column range of (1:r+1, r+1:2r+1), REC3 has a row and column range of (r+1:2r+1, 1:r+1), and REC4 has a row and column range of (r+1:2r+1, r+1:2r+1). In other embodiments, the neighborhood region can also be divided into other numbers of sub-regions.

[0116] S3133: Select the minimum chromatic intensity from the chromatic intensity of all pixels contained in each sub-region, and use it as the minimum chromatic intensity corresponding to each sub-region.

[0117] Specifically, the purple chromaticity intensity with the smallest value is selected from all pixels in the sub-region, and this purple chromaticity intensity with the smallest value is determined as the minimum chromaticity intensity corresponding to the sub-region.

[0118] In one specific embodiment, the purple chromaticity intensity with the smallest value is selected from all pixels in sub-region REC1 and denoted as a1; the purple chromaticity intensity with the smallest value is selected from all pixels in sub-region REC2 and denoted as a2; the purple chromaticity intensity with the smallest value is selected from all pixels in sub-region REC3 and denoted as a3; and the purple chromaticity intensity with the smallest value is selected from all pixels in sub-region REC4 and denoted as a4.

[0119] S3134: Determine the purple edge chromaticity intensity of the current pixel based on the minimum chromaticity intensity with the largest value among the minimum chromaticity intensities corresponding to multiple sub-regions and the chromaticity intensity of the current pixel.

[0120] Specifically, the chromaticity intensity 'a' with the largest value is selected from the minimum chromaticity intensities corresponding to each sub-region. m a m =max(a1, a2, a3, a4).

[0121] Select the chromaticity intensity 'a' that has the largest value from the minimum chromaticity intensities corresponding to each sub-region. m Determine the purple edge chromaticity intensity of the current pixel by comparing it with the purple chromaticity intensity of the current pixel.

[0122] In one specific embodiment, the purple fringing chromaticity intensity w′ of the current pixel is calculated based on the following formula. ch .

[0123]

[0124] In the formula: a P The chromaticity intensity 'a' of the purple color in the current pixel. ch .

[0125] If the purple edge chromaticity intensity w′ of the current pixel ch The smaller the value, the more similar the purple chromaticity intensity of the current pixel is to the purple chromaticity intensity of all pixels in its neighborhood, thus classifying the current pixel as a purple object. If the purple edge chromaticity intensity w′ of the current pixel... ch The larger the value, the greater the difference between the purple chromaticity intensity of the current pixel and the purple chromaticity intensity of the pixels in the neighboring region, indicating that the current pixel belongs to an abnormal purple edge pixel.

[0126] Specifically, if the purple edge chromaticity intensity of the current pixel is less than a preset intensity value, then the purple color corresponding to the current pixel is determined to be a pixel of a purple object; if the purple edge chromaticity intensity of the current pixel is greater than a preset intensity value, then the purple color corresponding to the current pixel is determined to be an abnormal purple edge.

[0127] S3135: Determine the chromaticity intensity of the purple edge based on the chromaticity intensity of the current pixel.

[0128] Specifically, if the chromatic intensity of the purple edge at the current pixel is less than a first threshold, then the chromatic intensity of the purple edge is determined to be 0. If the chromatic intensity of the purple edge at the current pixel is greater than a second threshold, then the chromatic intensity of the purple edge is determined to be 1. If the chromatic intensity of the purple edge at the current pixel is neither less than the first threshold nor greater than the second threshold, then the chromatic intensity of the purple edge at the current pixel is determined to be the chromatic intensity of the purple edge.

[0129] In one specific embodiment, the chromaticity intensity w of the purple edge is determined based on the magnitude of the purple edge chromaticity intensity of the current pixel. ch .

[0130]

[0131] The above embodiments distinguish between abnormal and normal purple-edged pixels to protect pixels belonging to purple objects. This method of protecting purple objects takes into account various color information in the neighboring region, making it a more human-eye-friendly way of identifying purple objects. After correction in this way, the edges will also appear more natural.

[0132] S32: Determine the intensity information of the purple edge based on the edge intensity, contrast intensity, and chromaticity intensity corresponding to the purple edge.

[0133] Specifically, determining the intensity information of the abnormal purple edge of the target object includes the following steps.

[0134] Please see Figure 9 , Figure 9 yes Figure 2 A flowchart illustrating a specific embodiment of step S32 in the provided image purple fringing removal method.

[0135] S321: Based on the product of the edge intensity, contrast intensity, and chromaticity intensity corresponding to the purple edge, and the preset adjustment parameters, the initial intensity information of the purple edge is calculated.

[0136] Specifically, the initial intensity information w′ of the purple edge is determined based on the following formula. pe .

[0137] w′ pe =coef w ×w e ×w co ×w ch (Formula 13)

[0138] In the formula, coef w This is a parameter for adjusting the overall purple edge intensity, which can be set according to the actual situation.

[0139] S322: Determine the intensity information of the purple edge based on the initial intensity information of the purple edge.

[0140] Specifically, if the initial intensity information of the purple edge is less than a first value, then the intensity information of the purple edge is determined to be 0. If the initial intensity information of the purple edge is greater than a second value, then the intensity information of the purple edge is determined to be 1. If the initial intensity information of the purple edge is neither less than the first value nor greater than the second value, then the initial intensity information of the purple edge is determined to be the intensity information of the purple edge.

[0141] Specifically, the intensity information w of the purple edge is determined based on the following formula. pe .

[0142]

[0143] Based on the above embodiments, the intensity information of the purple fringing of abnormal pixels can be determined. pe .

[0144] In one embodiment, to eliminate the influence of noise, the intensity information of the purple edge is subjected to Gaussian filtering to obtain filtered intensity information of the purple edge. Specifically, the intensity information w of the purple edge... pe A 3x3 Gaussian filter is applied. The filter window and filter intensity can be adjusted according to the resolution of the image to be processed and the actual situation. The intensity information of purple fringing before and after filtering is compared, and the one with the largest value is selected and denoted as weight. The abnormal purple fringing in the image to be processed is corrected based on the intensity information of the purple fringing with the largest value.

[0145] S4: Eliminate purple fringing in the image to be processed based on the intensity information of the purple fringing.

[0146] Based on the intensity information of the purple edge, it is determined whether the purple edge in the image to be processed is an abnormal purple edge; in response to the purple edge in the image to be processed being an abnormal purple edge, the abnormal purple edge in the image to be processed is eliminated based on the intensity information of the abnormal purple edge.

[0147] Specifically, eliminating purple fringing involves calculating corrections in both the HSV and RGB color spaces, then fusing the correction data from both spaces to achieve a smoother and more uniform brightness and color representation. The specific steps for correcting purple fringing in the image to be processed include the following.

[0148] Please see Figure 10 , Figure 10 yes Figure 1 A flowchart illustrating a specific embodiment of step S4 in the provided image purple fringing removal method.

[0149] S41: Correct the HSV color image based on the intensity information of the abnormal purple edge, and convert the corrected HSV color image to RGB space to obtain the first corrected RGB channel data.

[0150] Specifically, the saturation component in the HSV color image is corrected based on the intensity information of the abnormal purple fringing using the following formula, resulting in the corrected saturation component S. out .

[0151] S out =S×(1-weight) (Formula 15)

[0152] Based on the corrected saturation component S corresponding to the corrected HSV color image out The luminance component V and hue component H are converted to RGB space to obtain the first corrected RGB channel data in RGB space. The first corrected RGB channel data includes G1 channel data, R1 channel data, and B1 channel data.

[0153] In one specific embodiment, the corrected saturation component S corresponding to the HSV color image is determined by the following formula. out The luminance component V and hue component H are converted to obtain G1 channel data, R1 channel data, and B1 channel data.

[0154] H = 6 × H

[0155] K = floor(H)

[0156] P=HK

[0157] T = 1 - S out

[0158] N = 1 - S out ×P

[0159] P = 1 - S out ×(1-P) (Formula 16)

[0160] R tmp =1; G tmp =P;B tmp =T; if (K=0 or K=6)

[0161] R tmp =N;G tmp =1; B tmp =T; if (K=1)

[0162] R tmp =T;G tmp =1; B tmp =P; if (K=2)

[0163] R tmp =T;G tmp =N;B tmp =1; if (K=3)

[0164] R tmp =P;G tmp =T;B tmp =1; if (K=4)

[0165] R tmp =1; G tmp =T;B tmp =N; if(K=5) (Formula 17)

[0166] R1 = R tmp ×V

[0167] G1 = G tmp ×V

[0168] B1 = B tmp ×V (Formula 18)

[0169] S42: Based on the intensity information of abnormal purple fringing, the RGB channel data of the image to be processed is corrected to obtain the second corrected RGB channel data.

[0170] Specifically, the RGB channel data of the image to be processed is directly corrected based on the intensity information (weight) of the abnormal purple fringing using the following formula to obtain the second corrected RGB channel data. The second corrected RGB channel data includes G2 channel data, R2 channel data, and B2 channel data.

[0171] R² = G - (GR) × (1 - 0.9 × weight)

[0172] B2 = G - (GB) × (1 - weight)

[0173] G2 = G (Formula 19)

[0174] S43: Based on the first and second corrected RGB channel data, determine the corrected RGB channel data of the image to be processed.

[0175] Specifically, the corrected RGB channel data of the image to be processed is determined based on the weighted sum of the first corrected RGB channel data and the second corrected RGB channel data.

[0176] In one specific embodiment, the corrected RGB channel data of the image to be processed is determined by the following formula. Wherein, the corrected RGB channel data includes R... out G out B out .

[0177] R out =R1×f + R2×(1-f)

[0178] G out =G1×f+G2×(1-f)

[0179] B out =B1×f+B2×(1-f) (Formula 20)

[0180] In the formula: f is the weight value, 0 < f < 1. In this embodiment, f is defaulted to 0, in order to make the color and brightness more harmonious and avoid abnormal brightness and color matching caused by HSV domain conversion.

[0181] Based on the corrected RGB channel data R out G out B out This constitutes the corrected RGB image. The corrected RGB image is the one where abnormal purple fringing has been eliminated.

[0182] The image purple fringing removal method provided in this embodiment includes acquiring an image to be processed, which is a color image containing purple fringing; converting the image to be processed from RGB space to HSV space to obtain an HSV color image corresponding to the image to be processed; determining the intensity information of the purple fringing based on the RGB channel data of the image to be processed and the data information of the HSV color image; and removing the purple fringing in the image to be processed based on the intensity information of the purple fringing. This application determines the intensity information of the purple fringing based on the RGB channel data of the image to be processed and the data information of the HSV color image, and then corrects the purple fringing in the image to be processed based on the intensity information of the purple fringing, thereby eliminating abnormal purple fringing in the image to be processed and improving image quality.

[0183] See Figure 11 , Figure 11 This is a schematic diagram of the framework of an embodiment of the image purple fringing removal device provided by the present invention. This embodiment provides an image purple fringing removal device 60, which includes an acquisition module 61, a conversion module 62, an analysis module 63, and a correction module 64.

[0184] The acquisition module 61 is used to acquire the image to be processed, which is a color image containing purple fringes.

[0185] The conversion module 62 is used to convert the image to be processed from the RGB space to the HSV space to obtain the corresponding HSV color image. The HSV color image includes a hue component (H), a saturation component (S), and a luminance component (V).

[0186] The analysis module 63 is used to determine the intensity information of the purple edge based on the RGB channel data of the image to be processed and the data information of the HSV color image.

[0187] The analysis module 63 is also used to determine the edge intensity, contrast intensity, and chromaticity intensity of the purple edge based on the RGB channel data of the image to be processed and the data information of the HSV color image; and to determine the intensity information of the purple edge based on the edge intensity, contrast intensity, and chromaticity intensity corresponding to the purple edge.

[0188] Specifically, the analysis module 63 is used to determine the first edge information of the image to be processed based on any one of the G channel data, R channel data, and B channel data in the RGB channel data of the image to be processed; to determine the second edge information of the corresponding image to be processed based on the saturation component S and the brightness component V of the HSV color image; and to determine the edge intensity of the purple edge based on the first edge information and the second edge information of the image to be processed.

[0189] In one specific embodiment, the analysis module 63 is used to determine the first edge information of the image to be processed based on the G channel data in the RGB channel data of the image to be processed.

[0190] In one specific embodiment, the analysis module 63 is used to determine the saturation-luminance joint variable based on the saturation component S and the luminance component V of the HSV color image; and to determine the second edge information of the corresponding image to be processed based on the saturation-luminance joint variable of the HSV color image.

[0191] In one embodiment, the analysis module 63 is used to determine the corresponding neighborhood region centered on the current pixel, and select the maximum G channel data within the neighborhood region; determine the contrast of the current pixel based on the maximum G channel data and the G channel data of the current pixel; and determine the contrast intensity of the purple edge based on the contrast of the current pixel.

[0192] In one specific embodiment, the analysis module 63 is used to determine that the contrast intensity of the purple edge is 0 in response to the contrast of the current pixel being less than a first preset value; to determine that the contrast intensity of the purple edge is 1 in response to the contrast of the current pixel being greater than a second preset value; and to determine that the contrast of the current pixel is the contrast intensity of the purple edge in response to the contrast of the current pixel being neither less than the first preset value nor greater than the second preset value.

[0193] In one embodiment, the analysis module 63 is used to determine the chromaticity intensity of each pixel based on the RGB channel data of each pixel in the image to be processed and the data information of each pixel in the HSV color image; determine the neighborhood region of the current pixel as the center, the neighborhood region including multiple sub-regions; select the chromaticity intensity with the smallest value in each sub-region from all the chromaticity intensities of all pixels contained in each sub-region as the minimum chromaticity intensity corresponding to each sub-region; determine the purple edge chromaticity intensity of the current pixel based on the minimum chromaticity intensity with the largest value among the minimum chromaticity intensities corresponding to the multiple sub-regions and the chromaticity intensity of the current pixel; and determine the chromaticity intensity of the purple edge based on the purple edge chromaticity intensity of the current pixel.

[0194] In one specific embodiment, the analysis module 63 is used to determine the first chromaticity intensity of a pixel based on the color difference between the R channel data and B channel data of the pixel in the image to be processed and the G channel data, respectively; to determine the second chromaticity intensity of the pixel based on the hue component H of the pixel in the HSV color image corresponding to the pixel in the image to be processed; and to determine the chromaticity intensity of the pixel based on the first chromaticity intensity and the second chromaticity intensity corresponding to the pixel.

[0195] In one specific embodiment, the analysis module 63 is configured to determine the chromatic intensity of the purple edge as 0 if the chromatic intensity of the purple edge of the current pixel is less than a first threshold; determine the chromatic intensity of the purple edge as 1 if the chromatic intensity of the purple edge of the current pixel is greater than a second threshold; and determine the chromatic intensity of the purple edge of the current pixel as the chromatic intensity of the purple edge if the chromatic intensity of the purple edge of the current pixel is not less than the first threshold and not greater than the second threshold.

[0196] In one embodiment, the analysis module 63 is used to calculate the initial intensity information of the purple edge based on the product of the edge intensity, contrast intensity and chromaticity intensity corresponding to the purple edge and a preset adjustment parameter; and to determine the intensity information of the purple edge based on the initial intensity information of the purple edge.

[0197] In one embodiment, the analysis module 63 is configured to determine the intensity information of the purple edge as 0 if the initial intensity information of the purple edge is less than a first value; determine the intensity information of the purple edge as 1 if the initial intensity information of the purple edge is greater than a second value; and determine the initial intensity information of the purple edge as the intensity information of the purple edge if the initial intensity information of the purple edge is not less than the first value and not greater than the second value.

[0198] The removal module 64 is used to remove purple fringes in the image to be processed based on the intensity information of the purple fringes.

[0199] In one specific embodiment, the elimination module 64 is used to determine whether the purple edge in the image to be processed is an abnormal purple edge based on the intensity information of the purple edge; in response to the purple edge in the image to be processed being an abnormal purple edge, the abnormal purple edge in the image to be processed is eliminated based on the intensity information of the abnormal purple edge.

[0200] In one specific embodiment, the elimination module 64 is used to correct the HSV color image based on the intensity information of the abnormal purple fringing, and convert the corrected HSV color image to RGB space to obtain first corrected RGB channel data; correct the RGB channel data of the image to be processed based on the intensity information of the abnormal purple fringing to obtain second corrected RGB channel data; and determine the corrected RGB channel data of the image to be processed based on the first corrected RGB channel data and the second corrected RGB channel data.

[0201] In one specific embodiment, the elimination module 64 is used to perform Gaussian filtering on the intensity information of the purple edge to obtain the intensity information of the filtered purple edge; and selects the one with the largest value between the intensity information of the purple edge before filtering and the intensity information of the purple edge after filtering to correct the purple edge in the image to be processed.

[0202] The image purple fringing removal device provided in this embodiment includes: an acquisition module for acquiring an image to be processed, which is a color image containing purple fringing; a conversion module for converting the image to be processed from RGB space to HSV space to obtain an HSV color image corresponding to the image to be processed; an analysis module for determining the intensity information of the purple fringing based on the RGB channel data of the image to be processed and the data information of the HSV color image; and a correction module for removing the purple fringing in the image to be processed based on the intensity information of the purple fringing. By determining the intensity information of the purple fringing based on the RGB channel data of the image to be processed and the data information of the HSV color image, and then correcting the purple fringing in the image to be processed based on the intensity information, abnormal purple fringing in the image to be processed is eliminated, thereby improving image quality.

[0203] Please see Figure 12 , Figure 12 This is a schematic diagram of a terminal embodiment provided in this application. The terminal 80 includes a memory 81 and a processor 82 coupled to each other. The processor 82 is used to execute program instructions stored in the memory 81 to implement the steps of any of the above-described embodiments of the image purple fringing removal method. In a specific implementation scenario, the terminal 80 may include, but is not limited to, a microcomputer or a server. In addition, the terminal 80 may also include mobile devices such as laptops and tablets, which are not limited here.

[0204] Specifically, processor 82 controls itself and memory 81 to implement the steps of any of the above-described embodiments of the image purple fringing removal method. Processor 82 may also be referred to as a CPU (Central Processing Unit). Processor 82 may be an integrated circuit chip with signal processing capabilities. Processor 82 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 82 may be implemented using integrated circuit chips.

[0205] Please see Figure 13 , Figure 13 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this application. The computer-readable storage medium 90 stores program instructions 901 that can be executed by a processor. The program instructions 901 are used to implement the steps of any of the above-described embodiments of the image purple fringing removal method.

[0206] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0207] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0208] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations 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, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0209] 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.

[0210] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0211] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0212] The above are merely embodiments of the present invention and do not limit the scope of patent protection of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for eliminating purple fringing in images, characterized in that, The image purple fringing removal method includes: Acquire an image to be processed, wherein the image to be processed is a color image of a target object containing purple fringing; The image to be processed is converted from RGB space to HSV space to obtain the HSV color image corresponding to the image to be processed; Based on the RGB channel data of the image to be processed and the data information of the HSV color image, the intensity information of the purple edge is determined; Based on the intensity information of the purple fringing, the purple fringing in the image to be processed is eliminated; The step of determining the intensity information of the purple fringing based on the RGB channel data of the image to be processed and the data information of the HSV color image includes: Based on the RGB channel data of the image to be processed and the data information of the HSV color image, the edge intensity, contrast intensity, and chromaticity intensity of the purple edge are determined; wherein, the edge intensity is determined based on the G channel data in the RGB channel data of the image to be processed and the saturation component S and the luminance component V of the HSV color image; the contrast intensity is determined based on the G channel data in the RGB channel data of the image to be processed; the chromaticity intensity is jointly determined based on a first chromaticity intensity obtained from the R channel data, B channel data, and G channel data of the image to be processed and a second chromaticity intensity obtained from the hue component H of the HSV color image; The intensity information of the purple edge is determined based on the edge intensity, contrast intensity, and chromaticity intensity corresponding to the purple edge.

2. The image purple fringing removal method according to claim 1, characterized in that, The HSV color image includes a hue component H, a saturation component S, and a luminance component V; Determining the edge intensity of the purple edge includes the following steps: Based on any one of the G channel data, R channel data, and B channel data in the RGB channel data of the image to be processed, determine the first edge information of the target object; Based on the saturation component S and the luminance component V of the HSV color image, the second edge information of the corresponding target object is determined; Based on the first edge information and the second edge information of the target object, the edge intensity of the purple edge of the target object is determined.

3. The image purple fringing removal method according to claim 2, characterized in that, The determination of the first edge information of the target object based on any one of the G channel data, R channel data, and B channel data in the RGB channel data of the image to be processed includes: Based on the G channel data in the RGB channel data of the image to be processed, the first edge information of the target object is determined.

4. The image purple fringing removal method according to claim 2, characterized in that, The determination of the second edge information of the target object based on the saturation component S and the luminance component V of the HSV color image includes: Based on the saturation component S and the luminance component V of the HSV color image, determine the saturation-luminance joint variable; Based on the saturation-luminance joint variable of the HSV color image, the second edge information of the corresponding target object is determined.

5. The image purple fringing removal method according to claim 1, characterized in that, Determining the contrast intensity of the purple edge includes the following steps: Determine the corresponding neighborhood region centered on the current pixel, and select the G channel data with the largest value within the neighborhood region; The contrast of the current pixel is determined based on the G-channel data with the largest value and the G-channel data of the current pixel. The contrast intensity of the purple edge is determined based on the contrast of the current pixel.

6. The image purple fringing removal method according to claim 5, characterized in that, Determining the contrast intensity of the purple edge based on the contrast of the current pixel includes: In response to the fact that the contrast of the current pixel is less than a first preset value, the contrast intensity of the purple edge is determined to be 0; In response to the fact that the contrast of the current pixel is greater than a second preset value, the contrast intensity of the purple edge is determined to be 1; In response to the fact that the contrast of the current pixel is not less than the first preset value and not greater than the second preset value, the contrast of the current pixel is determined to be the contrast intensity of the purple edge.

7. The image purple fringing removal method according to claim 1, characterized in that, The determination of the chromaticity intensity of the purple edge includes the following steps: Based on the RGB channel data of each pixel in the image to be processed and the corresponding data information of each pixel in the HSV color image, the chromaticity intensity of each pixel is determined. A neighborhood region of the current pixel is determined with the current pixel as the center, and the neighborhood region includes multiple sub-regions; Select the minimum chromaticity intensity from the chromaticity intensities of all pixels contained in each sub-region, and use it as the minimum chromaticity intensity corresponding to each sub-region. Based on the minimum chromaticity intensity with the largest value among the minimum chromaticity intensities corresponding to the plurality of sub-regions and the chromaticity intensity of the current pixel, the purple edge chromaticity intensity of the current pixel is determined; The chromaticity intensity of the purple edge is determined based on the chromaticity intensity of the current pixel.

8. The image purple fringing removal method according to claim 7, characterized in that, The step of determining the chromaticity intensity of each pixel based on the RGB channel data of each pixel in the image to be processed and the corresponding data information of each pixel in the HSV color image includes: Based on the color difference between the R channel data and the B channel data of the pixel in the image to be processed and the G channel data, the first chromaticity intensity of the pixel is determined. The second chromaticity intensity of the pixel is determined based on the hue component H of the HSV color image corresponding to the pixel in the image to be processed. The chromaticity intensity of the pixel is determined based on the first chromaticity intensity and the second chromaticity intensity corresponding to the pixel.

9. The image purple fringing removal method according to claim 7, characterized in that, Determining the chromaticity intensity of the purple edge based on the chromaticity intensity of the current pixel includes: If the chromaticity intensity of the purple edge at the current pixel is less than a first threshold, then the chromaticity intensity of the purple edge is determined to be 0. If the chromaticity intensity of the purple edge at the current pixel is greater than the second threshold, then the chromaticity intensity of the purple edge is determined to be 1. If the purple edge chromaticity intensity of the current pixel is not less than the first threshold and not greater than the second threshold, then the purple edge chromaticity intensity of the current pixel is determined to be the chromaticity intensity of the purple edge.

10. The image purple fringing removal method according to claim 1, characterized in that, The determination of the intensity information of the purple edge based on the edge intensity, contrast intensity, and chromaticity intensity corresponding to the purple edge includes: The initial intensity information of the purple edge is calculated based on the product of the edge intensity, the contrast intensity, and the chromaticity intensity corresponding to the purple edge, as well as the preset adjustment parameters. Based on the initial intensity information of the purple edge, the intensity information of the purple edge is determined.

11. The image purple fringing removal method according to claim 10, characterized in that, The determination of the intensity information of the purple edge based on the initial intensity information of the purple edge includes: If the initial intensity information of the purple edge is less than a first value, then the intensity information of the purple edge is determined to be 0. If the initial intensity information of the purple edge is greater than the second value, then the intensity information of the purple edge is determined to be 1; If the initial intensity information of the purple edge is not less than the first value and not greater than the second value, then the initial intensity information of the purple edge is determined to be the intensity information of the purple edge.

12. The image purple fringing removal method according to claim 1, characterized in that, The process of removing the purple fringing in the image to be processed based on the intensity information of the purple fringing includes: Based on the intensity information of the purple edge, determine whether the purple edge in the image to be processed is an abnormal purple edge; In response to the fact that the purple fringing in the image to be processed is the abnormal purple fringing, the abnormal purple fringing in the image to be processed is eliminated based on the intensity information of the abnormal purple fringing.

13. The image purple fringing removal method according to claim 12, characterized in that, The step of determining whether the purple fringing in the image to be processed is an abnormal purple fringing based on the intensity information of the purple fringing includes: The HSV color image is corrected based on the intensity information of the abnormal purple fringing, and the corrected HSV color image is converted to RGB space to obtain the first corrected RGB channel data; Based on the intensity information of the abnormal purple fringing, the RGB channel data of the image to be processed is corrected to obtain the second corrected RGB channel data; Based on the first corrected RGB channel data and the second corrected RGB channel data, the corrected RGB channel data of the image to be processed is determined.

14. The image purple fringing removal method according to claim 1 or 12, characterized in that, The process of removing the purple fringing in the image to be processed based on the intensity information of the purple fringing includes: The intensity information of the purple edge is subjected to Gaussian filtering to obtain the filtered intensity information of the purple edge; The purple fringing intensity information before and after filtering is selected, and the purple fringing in the image to be processed is eliminated by selecting the one with the largest value.

15. An image purple fringing removal device, characterized in that, The image purple fringing removal device includes: The acquisition module is used to acquire the image to be processed, wherein the image to be processed is a color image of the target object containing purple fringes; The conversion module is used to convert the image to be processed from RGB space to HSV space to obtain the HSV color image corresponding to the image to be processed. The analysis module is used to determine the intensity information of the purple edge based on the RGB channel data of the image to be processed and the data information of the HSV color image; it is also used to determine the edge intensity, contrast intensity, and chromaticity intensity of the purple edge based on the RGB channel data of the image to be processed and the data information of the HSV color image; the intensity information of the purple edge is determined based on the edge intensity, contrast intensity, and chromaticity intensity corresponding to the purple edge; the edge intensity is determined based on the G channel data in the RGB channel data of the image to be processed and the saturation component S and the luminance component V of the HSV color image; the contrast intensity is determined based on the G channel data in the RGB channel data of the image to be processed; the chromaticity intensity is jointly determined based on the first chromaticity intensity obtained from the R channel data, B channel data, and G channel data of the image to be processed and the second chromaticity intensity obtained from the hue component H of the HSV color image; The correction module is used to eliminate the purple fringing in the image to be processed based on the intensity information of the purple fringing.

16. A terminal, characterized in that, The terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor, the processor being used to execute program data to implement the steps in the image purple fringing removal method as described in any one of claims 1 to 14.

17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the image purple fringing removal method as described in any one of claims 1 to 14.