CN-115330638-B - Correction method and device for image dead pixel, electronic equipment and storage medium
Abstract
The embodiment of the disclosure discloses a correction method, device, electronic equipment and storage medium for image dead spots, wherein the method comprises the steps of determining a target data window with a preset scale of a pixel point serving as a central pixel point for any pixel point in image data to be processed, determining whether the central pixel point meets preset conditions based on the target data window, wherein the preset conditions comprise a first condition met by the pixel value of the central pixel point and/or a second condition met by the pixel value of the same channel type in at least one direction corresponding to the central pixel point, determining that the central pixel point is the dead spot if the central pixel point meets the preset conditions, determining corrected target pixel values of the central pixel point based on pixel values of other pixel points in the target data window, and determining corrected target image data corresponding to the image data to be processed based on the target pixel values. Bad point recall and high contrast edge preservation can be effectively considered, so that the accuracy of bad point correction is improved.
Inventors
- XIAO XUE
- WANG GUOLI
- ZHANG JIAN
- HUANG CHANG
Assignees
- 北京地平线信息技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20220830
Claims (15)
- 1. A correction method of image dead pixels comprises the following steps: acquiring image data to be processed; Determining a target data window of a preset scale taking the pixel point as a central pixel point based on the image data to be processed aiming at any pixel point in the image data to be processed; Determining whether the central pixel point meets a preset condition or not based on the target data window, wherein the preset condition comprises a first condition and/or a second condition, the first condition is a condition met by the pixel value of the central pixel point, and the second condition is a condition met by the pixel value of the pixel point of the same channel type in at least one direction corresponding to the central pixel point in the target data window; responding to the central pixel point meeting the preset condition, and determining the central pixel point as a dead point; Determining a corrected target pixel value of the center pixel point based on pixel values of other pixel points in the target data window except the center pixel point; determining corrected target image data corresponding to the image data to be processed based on the target pixel value; The determining whether the center pixel point meets a preset condition based on the target data window comprises: determining a difference between pixel values of the same channel type of the at least one direction corresponding to the center pixel point and a dynamic threshold based on existing pixel values respectively corresponding to the pixel points in the target data window; Determining whether the center pixel point satisfies the second condition based on a difference between the pixel values between the pixel points of the same channel type in the at least one direction and the dynamic threshold; determining that the center pixel point meets the preset condition in response to the center pixel point meeting the second condition; The determining the difference between pixel values of the same channel type of the at least one direction corresponding to the center pixel point and the dynamic threshold based on the existing pixel values respectively corresponding to the pixel points in the target data window comprises: determining a second pixel value of a preset standby pixel corresponding to the target channel type based on the existing pixel values respectively corresponding to all the pixel points in the target data window, wherein the preset pixel point is determined by adopting interpolation operation of direction judgment based on the existing pixel values; And determining a difference between the pixel values of the pixel points of the same channel type in the at least one direction corresponding to the center pixel point and the first threshold value corresponding to each direction in the at least one direction respectively based on the existing pixel values and the second pixel values of the preset pixel points.
- 2. The method of claim 1, wherein the determining whether the center pixel point meets a preset condition based on the target data window further comprises: determining the type of the target channel to which the central pixel point belongs based on the target data window; acquiring pixel values of first pixel points of the same channel type of a first preset area corresponding to the target channel type from the target data window based on the target channel type; determining whether the center pixel satisfies the first condition based on the pixel value of each first pixel point, and The determining that the center pixel point meets the preset condition in response to the center pixel point meeting the second condition includes: And responding to the central pixel point meeting the first condition and the second condition, and determining that the central pixel point meets the preset condition.
- 3. The method of claim 1, wherein the determining, based on the existing pixel values respectively corresponding to the pixels in the target data window, a second pixel value of a preset spare pixel corresponding to the target channel type includes: Determining the second pixel value of a first part of standby pixel points by adopting interpolation operation of direction judgment based on the existing pixel value and determining the second pixel value of a second part of standby pixel points based on a preset confidence rule, wherein the second pixel value of the first part of standby pixel points and the second pixel value of the second part of standby pixel points are used as the second pixel value of the preset pixel points corresponding to the target channel type; and responding to the target channel type as a fourth type, and determining the second pixel value of the preset pixel point corresponding to the target channel type by adopting interpolation operation of the direction judgment based on the existing pixel value.
- 4. A method according to claim 3, wherein said determining said second pixel value for a second portion of spare pixel points based on a preset confidence rule comprises: Determining the second pixel value of the second part of standby pixel points and the confidence coefficient of the second part of standby pixel points based on a preset confidence coefficient rule; The determining, based on the existing pixel value and the second pixel value of the preset pixel point, a difference between pixel values of the same channel type of the at least one direction corresponding to the center pixel point includes: in response to the target channel type being the first type, the second type, or the third type, determining a difference in the pixel values between pixels of the same channel type in the at least one direction to which the center pixel corresponds based on the existing pixel value, the second pixel value of the preset pixel, and the confidence of the second portion of spare pixels.
- 5. The method of claim 4, wherein the determining the corrected target pixel value for the center pixel based on pixel values for other pixels in the target data window than the center pixel comprises: determining the sum of difference values corresponding to the directions corresponding to the target data window respectively based on pixel values of other pixel points with the same channel type as the central pixel point in the target data window; determining a minimum difference sum based on each of the difference sums; determining an interpolation direction corresponding to the center pixel point based on the minimum difference sum; the target pixel value is determined based on the interpolation direction.
- 6. The method of claim 5, wherein the determining the target pixel value based on the interpolation direction comprises: determining the target pixel value based on the interpolation direction, the other pixel values of the same channel type in the interpolation direction, the second pixel value of the same channel type in the interpolation direction, and the confidence corresponding to the second pixel value in response to the target channel type being the second type or the third type; In response to the target channel type being the first type or the fourth type, the target pixel value is determined based on the interpolation direction, the other pixel values of the same channel type in the interpolation direction.
- 7. The method according to any one of claims 1-6, wherein determining the first threshold value for each of the at least one direction to which the center pixel corresponds based on the existing pixel value and the second pixel value of the preset pixel includes: determining a first extreme difference corresponding to each direction in the at least one direction corresponding to the center pixel point based on the existing pixel value and the second pixel value of the preset pixel point, wherein the first extreme difference is a difference value between a maximum value and a minimum value in pixel values of which the channel type in the corresponding direction is a first type; and determining the first threshold value corresponding to each direction based on the first polar difference corresponding to each direction.
- 8. The method of any of claims 1-6, wherein the determining whether the center pixel satisfies the second condition based on the difference in pixel values between pixels of the same channel type in the at least one direction and the dynamic threshold comprises: Determining a total difference value corresponding to each direction based on the difference between the pixel values corresponding to each direction; And determining that the center pixel point meets the second condition in response to the total difference value corresponding to each direction is larger than a first threshold value corresponding to the direction.
- 9. The method of any of claims 1-6, wherein the determining whether the center pixel satisfies the second condition based on the difference in pixel values between pixels of the same channel type in the at least one direction and the dynamic threshold comprises: Determining a total difference value corresponding to each direction based on the difference between the pixel values corresponding to each direction; Determining a minimum total difference value based on the total difference values respectively corresponding to the directions; And determining that the center pixel point meets the second condition in response to the minimum total difference value being greater than the dynamic threshold.
- 10. The method of any of claims 1-6, wherein determining a dynamic threshold based on existing pixel values for each pixel point in the target data window, respectively, comprises: determining a second polar difference based on each of the existing pixel values of the channel type of the target data window being of the first type, the second polar difference being the difference between the maximum value and the minimum value of each of the existing pixel values of the first type; the dynamic threshold is determined based on the second polar difference.
- 11. The method of claim 10, wherein determining a second level difference based on each of the existing pixel values in the target data window for which a channel type is a first type comprises: removing the maximum value and the minimum value in each existing pixel value of the first type in the target data window to obtain residual existing pixel values; and taking the difference value between the maximum value and the minimum value in the residual existing pixel values as the second extreme difference.
- 12. The method according to any one of claims 2-6, wherein the determining whether the center pixel satisfies the first condition based on the pixel value of each of the first pixels includes: Sorting the pixel values of the first pixel points to obtain a sorting result; Determining a first difference absolute value between a pixel value of the first pixel located at a first preset level in the preset level range and a pixel value of the first pixel located at a neighboring level in the preset level range in response to the pixel value of the central pixel being located in the preset level range corresponding to the target channel type in the sorting result; determining a first average value based on the existing pixel values of which the channel types are the first type in the first preset area; And determining that the central pixel point meets the first condition in response to the ratio of the first difference absolute value to the first average value being greater than a second threshold.
- 13. An apparatus for correcting a dead pixel of an image, comprising: the first acquisition module is used for acquiring image data to be processed; the first processing module is used for determining a target data window of a preset scale by taking any pixel point in the image data to be processed as a central pixel point based on the image data to be processed; The second processing module is used for determining whether the central pixel point meets preset conditions or not based on the target data window, the preset conditions comprise a first condition and/or a second condition, the first condition is a condition met by the pixel value of the central pixel point, and the second condition is a condition met by the pixel value of the pixel point of the same channel type in at least one direction corresponding to the central pixel point in the target data window; The third processing module is used for responding to the fact that the central pixel point meets the preset condition and determining that the central pixel point is a dead point; A fourth processing module, configured to determine a corrected target pixel value of the center pixel point based on pixel values of other pixel points in the target data window except the center pixel point; a fifth processing module, configured to determine corrected target image data corresponding to the image data to be processed based on the target pixel value; The second processing module includes: A third determining unit, configured to determine, based on existing pixel values corresponding to each pixel point in the target data window, a difference between pixel values between pixel points of the same channel type in the at least one direction corresponding to the center pixel point, and a dynamic threshold; A fourth determining unit configured to determine whether the center pixel point satisfies the second condition based on a difference between the pixel values between the pixel points of the same channel type in the at least one direction and the dynamic threshold value; A fifth determining unit, configured to determine that the center pixel point meets the preset condition in response to the center pixel point meeting the second condition; the dynamic threshold value comprises a first threshold value corresponding to each direction in the at least one direction respectively; The third determination unit includes: a first determining subunit, configured to determine, based on existing pixel values corresponding to each pixel point in the target data window, a second pixel value of a preset spare pixel point corresponding to the target channel type, where the preset spare pixel point is determined by using an interpolation operation of direction judgment based on the existing pixel values; A second determining subunit, configured to determine, based on the existing pixel value and the second pixel value of the preset pixel point, a difference between the pixel values between pixel points of the same channel type in the at least one direction corresponding to the center pixel point, and the first threshold value corresponding to each of the at least one direction, respectively.
- 14. A computer-readable storage medium storing a computer program for executing the correction method of an image dead spot according to any one of the preceding claims 1 to 12.
- 15. An electronic device, the electronic device comprising: A processor; A memory for storing the processor-executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method for correcting an image dead pixel according to any one of claims 1 to 12.
Description
Correction method and device for image dead pixel, electronic equipment and storage medium Technical Field The present disclosure relates to image signal processing technologies, and in particular, to a method and apparatus for correcting an image dead pixel, an electronic device, and a storage medium. Background With the increasing use of ISP (IMAGE SIGNAL Processing ) in various industries, higher demands are being made on image quality. But image data obtained by an image sensor usually has dead pixels, which affect image quality. The dead pixel is a pixel point of which the pixel information on the image is wrong due to the technological defect or the error in the signal conversion process of the image sensor. The dead pixel is generally of two types, namely a static dead pixel and a dynamic dead pixel, the position of the static dead pixel is not changed, the correction is easy, the position of the dynamic dead pixel in an image is random, the dead pixel position is required to be determined first, and the correction is difficult. In the related art, the dead pixel is generally determined based on a comparison between a difference value between a pixel and an adjacent pixel and a threshold value. However, for the high-contrast edge, the method cannot well give consideration to the recall of the dead pixel and the reservation of the edge, so that the dead pixel correction is not accurate enough. Disclosure of Invention The present disclosure is provided for solving the technical problems of inaccurate dead pixel correction and the like. The embodiment of the disclosure provides a correction method, a correction device, electronic equipment and a storage medium for image dead spots. According to one aspect of the embodiment of the disclosure, an image dead pixel correction method is provided, and comprises the steps of obtaining image data to be processed, determining a target data window with a preset scale taking a pixel as a central pixel point based on any pixel point in the image data to be processed, determining whether the central pixel point meets preset conditions based on the target data window, wherein the preset conditions comprise a first condition and/or a second condition, the first condition is a condition met by pixel values of the central pixel point, the second condition is a condition met by pixel values of pixel points of the same channel type in at least one direction corresponding to the central pixel point in the target data window, responding to the preset condition met by the central pixel point, determining that the central pixel point is a dead pixel, determining corrected target pixel values of the central pixel point based on pixel values of other pixel points except the central pixel point in the target data window, and determining the target pixel values after the correction of the central pixel point based on the target data. According to another aspect of the embodiment of the disclosure, there is provided a correction device for an image dead pixel, which comprises a first acquisition module, a first processing module, a second processing module, a fourth processing module and a third processing module, wherein the first acquisition module is used for acquiring image data to be processed, the first processing module is used for aiming at any pixel point in the image data to be processed, determining a target data window with a preset scale taking the pixel point as a central pixel point based on the image data to be processed, the second processing module is used for determining whether the central pixel point meets a preset condition based on the target data window, the preset condition comprises a first condition and/or a second condition, the first condition is a condition met by a pixel value aiming at the central pixel point, the second condition is a condition met by a pixel value aiming at a pixel point of the same channel type corresponding to the central pixel point in the target data window, the third processing module is used for responding to the central pixel point and meeting the condition, the fourth processing module is used for determining the central pixel point as the dead pixel point based on the target data window, the fourth processing module is used for determining that the pixel value of the target data is used for correcting the target pixel based on the target data after the pixel value is subjected to the correction. According to still another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing the method for correcting an image dead pixel according to any one of the above embodiments of the present disclosure. According to still another aspect of the embodiments of the present disclosure, there is provided an electronic device, including a processor, a memory for storing executable instructions of the processor, and the processor configured to read