Search

CN-115760599-B - Image purple fringing eliminating method, device, terminal and computer readable storage medium

CN115760599BCN 115760599 BCN115760599 BCN 115760599BCN-115760599-B

Abstract

The application provides an image purple fringing eliminating method, an image purple fringing eliminating device, a terminal and a computer readable storage medium, wherein the image purple fringing eliminating method comprises the steps of obtaining an image to be processed, wherein the image to be processed is a color image containing purple fringing; the method comprises the steps of converting an image to be processed from an RGB space to an HSV space to obtain an HSV color image corresponding to the image to be processed, determining intensity information of purple fringing based on RGB channel data of the image to be processed and data information of the HSV color image, and eliminating purple fringing in the image to be processed based on the intensity information of the purple fringing. According to 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 fringing is determined, and then the purple fringing in the image to be processed is corrected based on the intensity information of the purple fringing, so that abnormal purple fringing in the image to be processed is eliminated, and the imaging quality is improved.

Inventors

  • DONG ZHENHAO
  • WANG SONG
  • YU KEQIANG
  • LIU SHUO
  • SHAO CHEN

Assignees

  • 浙江大华技术股份有限公司

Dates

Publication Date
20260512
Application Date
20221028

Claims (17)

  1. 1. An image purple fringing removal method, characterized in that the image purple fringing removal method comprises: acquiring an image to be processed, wherein the image to be processed is a color image of a target object containing purple fringing; converting the image to be processed from an RGB space to an 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; based on the intensity information of the purple fringing, eliminating the purple fringing in the image to be processed; wherein the 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: Determining edge intensity, contrast intensity and chromaticity intensity of the purple fringing based on RGB channel data of the image to be processed and data information of the HSV color image, wherein the edge intensity is determined based on G channel data in the RGB channel data of the image to be processed and saturation component S and brightness component V of the HSV color image, the contrast intensity is determined based on G channel data in the RGB channel data of the image to be processed, and the chromaticity intensity is jointly determined based on first chromaticity intensity obtained based on R channel data, B channel data and G channel data of the image to be processed and second chromaticity intensity obtained based on hue component H of the HSV color image; And determining the intensity information of the purple fringing based on the edge intensity, the contrast intensity and the chromaticity intensity corresponding to the purple fringing.
  2. 2. The image purple fringing removal method of claim 1, wherein the HSV color image includes a hue component H, a saturation component S, and a brightness component V; the determination of the edge intensity of the purple fringing comprises the following steps: Determining first edge information of the target object based on any one of G channel data, R channel data and B channel data in RGB channel data of the image to be processed; determining second edge information of the corresponding target object based on the saturation component S and the brightness component V of the HSV color image; and determining the edge intensity of the purple fringing of the target object based on the first edge information and the second edge information of the target object.
  3. 3. The method for eliminating purple fringing on an image according to claim 2, wherein, The determining the first edge information of the target object based on any one of the G channel data, the R channel data, and the B channel data in the RGB channel data of the image to be processed includes: And determining first edge information of the target object based on the G channel data in the RGB channel data of the image to be processed.
  4. 4. The method for eliminating purple fringing on an image according to claim 2, wherein, The determining second edge information of the corresponding target object based on the saturation component S and the brightness component V of the HSV color image includes: determining a saturation-luminance joint variable based on the saturation component S and the luminance component V of the HSV color image; and determining second edge information of the corresponding target object based on the saturation-brightness joint variable of the HSV color image.
  5. 5. The method for removing purple fringing from an image according to claim 1, The determination of the contrast intensity of the purple fringing comprises the following steps: determining a corresponding neighborhood region by taking a current pixel point as a center, and selecting G channel data with the largest numerical value in the neighborhood region; Determining the contrast of the current pixel point based on the G channel data with the largest value and the G channel data of the current pixel point; and determining the contrast intensity of the purple fringing based on the contrast of the current pixel point.
  6. 6. The method for removing purple fringing from an image according to claim 5, The determining the contrast intensity of the purple fringing based on the contrast of the current pixel point comprises the following steps: determining that the contrast intensity of the purple fringing is 0 in response to the contrast of the current pixel point being smaller than a first preset value; determining that the contrast intensity of the purple fringing is 1 in response to the contrast of the current pixel point being greater than a second preset value; And determining that the contrast of the current pixel point is the contrast intensity of the purple fringing in response to the contrast of the current pixel point being not less than the first preset value and not greater than the second preset value.
  7. 7. The method for removing purple fringing from an image according to claim 1, The determination of the chromaticity intensity of the purple fringing comprises the following steps: Determining the chromaticity intensity of each pixel point based on RGB channel data of each pixel point in the image to be processed and data information of each pixel point corresponding to the HSV color image; determining a neighborhood region of a current pixel point by taking the current pixel point as a center, wherein the neighborhood region comprises a plurality of sub-regions; selecting the chromaticity intensity with the smallest numerical value in each subarea from the chromaticity intensities of all the pixel points contained in each subarea as the minimum chromaticity intensity corresponding to each subarea; determining the purple fringing chrominance intensity of the current pixel point based on the minimum chrominance intensity with the largest value in the minimum chrominance intensity and the chrominance intensity of the current pixel point, which correspond to the plurality of subareas respectively; and determining the chromaticity intensity of the purple fringing based on the chromaticity intensity of the purple fringing of the current pixel point.
  8. 8. The method for removing purple fringing from an image according to claim 7, The determining the chromaticity intensity of each pixel point based on the RGB channel data of each pixel point in the image to be processed and the data information of each pixel point corresponding to the HSV color image includes: Determining a first chrominance intensity of the pixel point based on the color difference between R channel data and B channel data of the pixel point and G channel data in the image to be processed; Determining a second chromaticity intensity of the pixel point based on the hue component H of the HSV color image corresponding to the pixel point in the image to be processed; And determining the chromaticity intensity of the pixel point based on the first chromaticity intensity and the second chromaticity intensity corresponding to the pixel point.
  9. 9. The method for removing purple fringing from an image according to claim 7, The determining the chroma intensity of the purple fringing based on the chroma intensity of the purple fringing of the current pixel point comprises the following steps: determining that the chroma intensity of the purple fringing is 0 if the chroma intensity of the purple fringing of the current pixel point is smaller than a first threshold value; determining that the chroma intensity of the purple fringing is 1 in response to the fact that the chroma intensity of the purple fringing of the current pixel point is larger than a second threshold value; and determining that the purple fringing chromaticity intensity of the current pixel point is the purple fringing chromaticity intensity in response to the fact that the purple fringing chromaticity intensity of the current pixel point is not smaller than the first threshold value and is not larger than the second threshold value.
  10. 10. The method for removing purple fringing from an image according to claim 1, The determining the intensity information of the purple fringing based on the edge intensity, the contrast intensity and the chromaticity intensity corresponding to the purple fringing includes: Calculating to obtain initial intensity information of the purple fringing based on the product of the edge intensity, the contrast intensity and the chromaticity intensity corresponding to the purple fringing and preset adjusting parameters; And determining the intensity information of the purple fringing based on the initial intensity information of the purple fringing.
  11. 11. The method for removing purple fringing from an image according to claim 10, The determining the intensity information of the purple fringing based on the initial intensity information of the purple fringing comprises: Determining that the intensity information of the purple fringing is 0 in response to the initial intensity information of the purple fringing being less than a first value; Determining that the intensity information of the purple fringing is 1 in response to the initial intensity information of the purple fringing being greater than a second value; And determining that the initial intensity information of the purple fringing is the intensity information of the purple fringing in response to the initial intensity information of the purple fringing being not less than the first numerical value and not greater than the second numerical value.
  12. 12. The method for removing purple fringing from an image according to claim 1, The removing the purple fringing in the image to be processed based on the intensity information of the purple fringing comprises: determining whether the purple fringing in the image to be processed is abnormal purple fringing or not based on the intensity information of the purple fringing; And in response to the purple fringing in the image to be processed being the abnormal purple fringing, eliminating the abnormal purple fringing in the image to be processed based on the intensity information of the abnormal purple fringing.
  13. 13. The method for removing purple fringing from an image according to claim 12, characterized in that, The determining whether the purple fringing in the image to be processed is abnormal purple fringing based on the intensity information of the purple fringing comprises: Correcting the HSV color image based on the intensity information of the abnormal purple fringing, and converting the corrected HSV color image into an 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 fringing to obtain second corrected RGB channel data; And determining RGB channel data corrected by the image to be processed based on the first correction RGB channel data and the second correction RGB channel data.
  14. 14. The method for eliminating purple fringing on an image according to claim 1 or 12, characterized in that, The removing the purple fringing in the image to be processed based on the intensity information of the purple fringing comprises: Carrying out Gaussian filtering treatment on the intensity information of the purple fringing to obtain the intensity information of the purple fringing after filtering; And selecting one of the intensity information of the purple fringing before filtering and the intensity information of the purple fringing after filtering, which has the largest value, and eliminating the purple fringing in the image to be processed.
  15. 15. An image purple fringing eliminating device is characterized in that, the image purple fringing removing apparatus includes: the acquisition module is used for acquiring an image to be processed, wherein the image to be processed is a color image of a target object containing purple fringing; the conversion module is used for converting the image to be processed from an RGB space to an HSV space to obtain an HSV color image corresponding to the image to be processed; The device comprises an analysis module, an edge intensity, a contrast intensity and a chromaticity intensity, wherein the analysis module is used for determining intensity information of the purple fringing based on RGB channel data of an image to be processed and data information of the HSV color image, determining the intensity information of the purple fringing based on the edge intensity, the contrast intensity and the chromaticity intensity corresponding to the purple fringing, determining the edge intensity based on G channel data in the RGB channel data of the image to be processed and saturation components S and brightness components V of the HSV color image, determining the contrast intensity based on G channel data in the RGB channel data of the image to be processed, and determining the chromaticity intensity based on first chromaticity intensity obtained by R channel data, B channel data and G channel data of the image to be processed and second chromaticity intensity obtained by hue components H of the HSV color image; And the correction module is used for eliminating the purple fringing in the image to be processed based on the intensity information of the purple fringing.
  16. 16. A terminal comprising a memory, a processor and a computer program stored in the memory and running on the processor, the processor being configured to execute program data to implement the steps in the image purple fringing method according to any one of claims 1 to 14.
  17. 17. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program when executed by a processor implements the steps of the method for removing purple fringing in an image according to any one of claims 1 to 14.

Description

Image purple fringing eliminating method, device, terminal and computer readable storage medium Technical Field The present invention relates to the field of image correction technologies, and in particular, to a method, an apparatus, a terminal, and a computer readable storage medium for eliminating purple fringing in an image. Background Image color edges refer to colors which do not belong to an object and which are local color errors of the image, so that the image color edges have a great influence on image quality and visual effect. The types and reasons of the color edges of the image are numerous, and among them, the prominent and important reasons are chromatic aberration caused by optical systems such as lenses. The wavelength range of visible light is about 380 nm-760 nm, and due to the inherent property of the lens material, the refractive indexes of the lens material are different for different wavelengths, and the refractive index of light with longer wavelength is always larger, so that after light with different wavelengths passes through the same optical system, the focal point and the imaging position are different, and the image edge is caused to have color which does not belong to an original object, namely color difference caused by the optical system. Optical system chromatic aberration can be divided into longitudinal chromatic aberration and transverse chromatic aberration. Wherein the longitudinal chromatic aberration often appears as abnormal purple fringing in overexposed areas. The lens is designed in a complex manner, so that the generation of longitudinal chromatic aberration can be eliminated, but the lens is complex in design, high in cost and high in implementation difficulty, and compared with the method for post-processing of images, the method has the advantages of being low in cost and high in universality. Besides chromatic aberration caused by an optical system, blue-violet short wave light widely exists in the atmosphere, so that overexposed charge overflow phenomenon and the like exist in imaging devices such as CCD/CMOS, and the phenomenon of purple fringing occurs at the edge of a highlight area of an image, and the phenomena are difficult to improve through the arrangement of lens hardware. Disclosure of Invention The invention mainly solves the technical problem of providing an image purple fringing eliminating method, an image purple fringing eliminating device, a terminal and a computer readable storage medium, and solves the problem that in the prior art, an image has abnormal purple fringing and imaging quality is affected. The first technical scheme adopted by the invention is to provide an image purple fringing eliminating method, which comprises the steps of obtaining an image to be processed, converting the image to be processed into an HSV space from an RGB space to obtain an HSV color image corresponding to the image to be processed, determining purple fringing intensity information based on RGB channel data of the image to be processed and data information of the HSV color image, and eliminating purple fringing in the image to be processed based on the purple fringing intensity information. The method comprises the steps of determining the intensity information of the purple fringing based on the RGB channel data of an image to be processed and the data information of an HSV color image, determining the edge intensity, the contrast intensity and the chromaticity intensity 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 determining the intensity information of the purple fringing based on the edge intensity, the contrast intensity and the chromaticity intensity corresponding to the purple fringing. The method comprises the steps of determining first edge information of a target object based on any one of G channel data, R channel data and B channel data in RGB channel data of an image to be processed, determining second edge information of a corresponding target object based on the saturation component S and the brightness component V of the HSV color image, and determining the edge intensity of the purple edge of the target object based on the first edge information and the second edge information of the target object. The method comprises the steps of determining first edge information of a target object based on any one of G channel data, R channel data and B channel data in RGB channel data of an image to be processed, wherein 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 method comprises the steps of determining second edge information of a corresponding target object based on a saturation component S and a brightness component V of an HSV color image, determining a saturation-brightness joint variable based on the saturation component S and the brightness compon