CN117676359A - Image correction method, system, device and computer readable storage medium - Google Patents

Image correction method, system, device and computer readable storage medium Download PDF

Info

Publication number
CN117676359A
CN117676359A CN202311631585.2A CN202311631585A CN117676359A CN 117676359 A CN117676359 A CN 117676359A CN 202311631585 A CN202311631585 A CN 202311631585A CN 117676359 A CN117676359 A CN 117676359A
Authority
CN
China
Prior art keywords
pixel
point
value
current pixel
average value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311631585.2A
Other languages
Chinese (zh)
Inventor
帅珂
宋博
王勇
温建新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Image Design Technology Co Ltd
Original Assignee
Chengdu Image Design Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Image Design Technology Co Ltd filed Critical Chengdu Image Design Technology Co Ltd
Priority to CN202311631585.2A priority Critical patent/CN117676359A/en
Publication of CN117676359A publication Critical patent/CN117676359A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention provides an image correction method, an image correction system, an image correction device and a computer readable storage medium, wherein whether a current pixel meets a first bad point judgment condition is judged according to a first average value and a second average value, group data is averaged to obtain a fifth average value, whether the current pixel meets a second bad point judgment condition is judged according to a first adjacent pixel, a second adjacent pixel, the current pixel, a third average value, a fourth average value and the fifth average value, whether the current pixel meets the first bad point judgment condition and the second bad point judgment condition is judged, and if the current pixel meets the first bad point judgment condition and the second bad point judgment condition, the current pixel is corrected, so that bad point detection and correction by using one line of cache window data are realized.

Description

Image correction method, system, device and computer readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image correction method, system, device, and computer readable storage medium.
Background
Image sensors are now commonly used in a variety of electronic devices, but for hardware reasons, some dead spots are randomly generated on the captured raw image. The dead pixel can obviously reduce the image quality and influence the look and feel, so that the dead pixel needs to be identified and corrected in the early stage of image processing, otherwise, the dead pixel can be diffused to the periphery to form a colored pixel cluster in the subsequent demosaicing and various image filtering operations, and the image quality is damaged.
Dynamic dead spots are dead spots that are not fixed in position on the image acquired by the sensor, and are generally related to the temperature and gain of the sensor. Under a real use environment, the bright dead pixels in the dynamic dead pixels are obviously more than the dark dead pixels, and when the performance of the algorithm module is considered, the situation of removing the bright dead pixels is referred to more.
On some hardware devices, available hardware storage resources are very limited, and we can only use a data cache window of one line to realize the function of the dead pixel removal algorithm. Thus, there is a need for a dead pixel removal algorithm in this particular scenario that achieves as good performance as possible with limited resource constraints.
Accordingly, there is a need for a new image correction method, system, apparatus, and computer-readable storage medium that solve the above-described problems in the prior art.
Disclosure of Invention
The invention aims to provide an image correction method, an image correction system, image correction equipment and a computer readable storage medium, which are used for realizing the detection and correction of dead pixels by using one line of cache window data.
To achieve the above object, the image correction method of the present invention includes:
in an image to be corrected, taking odd-numbered pixel points positioned in the same row as cache window data by taking a current pixel point as a center;
Obtaining pixel values of pixel points, which are the same color as the current pixel point, in the cache window data to form group data, and then removing maximum value in the group data for averaging and removing minimum value in the group data for averaging to obtain a first average value and a second average value respectively;
acquiring a first adjacent pixel point and a second adjacent pixel point which are adjacent to the current pixel point in the buffer window data, then taking the pixel value of an even number of pixel points which take the first adjacent pixel point as the center and are the same with the first pixel point to average so as to obtain a third average value, and taking the pixel value of an even number of pixel points which take the second adjacent pixel point as the center and are the same with the second pixel point to average so as to obtain a fourth average value;
judging whether the current pixel point meets a first dead point judging condition according to the first average value and the second average value;
averaging the group data to obtain a fifth average value, and judging whether the current pixel point meets a second bad point judgment condition according to the first adjacent pixel point, the second adjacent pixel point, the current pixel point, a third average value, a fourth average value and the fifth average value;
And judging whether the current pixel point meets the first dead point judging condition and the second dead point judging condition at the same time, and correcting the current pixel point if the current pixel point meets the first dead point judging condition and the second dead point judging condition at the same time.
Optionally, the first dead pixel judgment condition includes a first bright dead pixel judgment condition, and judging whether the current pixel point meets the first dead pixel judgment condition according to the first average value and the second average value includes:
judging whether the pixel value of the current pixel point is greater than 1+m of the first average value 1 Multiple of 0 < m 1 <1;
If the pixel value of the current pixel point is judged to be greater than 1+m of the first average value 1 And (5) multiplying, judging that the current pixel point meets a first bright bad point judgment condition.
Optionally, the first dead pixel judgment condition further includes a first dark dead pixel judgment condition, and judging whether the current pixel point meets the first dead pixel judgment condition according to the first average value and the second average value, and further includes:
judging whether the pixel value of the current pixel point is smaller than 1-m of the second average value 1 Doubling;
if the pixel value of the current pixel point is less than 1-m of the second average value 1 And (5) multiplying, judging that the current pixel point meets a first dark dead point judgment condition.
Optionally, then determining whether the current pixel point meets a second dead point determining condition according to the first neighboring pixel point, the second neighboring pixel point, the current pixel point and a fifth average value, including:
acquiring the deviation amplitude of the first adjacent pixel point relative to the third average value to obtain a first deviation amplitude;
acquiring the deviation amplitude of the second adjacent pixel point relative to the fourth average value to obtain a second deviation amplitude;
obtaining the deviation amplitude of the current pixel point relative to the fifth average value to obtain a third deviation amplitude;
judging whether the current pixel point meets a second bad point judging condition according to the first deviation amplitude, the second deviation amplitude and the third deviation amplitude.
Optionally, the second dead pixel judging condition includes a second bright dead pixel judging condition, and judging whether the current pixel point meets the second dead pixel judging condition according to the first deviation amplitude, the second deviation amplitude and the third deviation amplitude includes:
determining whether the third deviation amplitude is greater than m of the greater value of the first and second deviation amplitudes 2 Multiple, m 2 ≥1;
If the third deviation amplitude is judged to be greater than the m of the larger value of the first deviation amplitude and the second deviation amplitude 2 And (5) multiplying, judging that the current pixel point meets the second bright and bad point judgment condition.
Optionally, the second dead pixel judging condition further includes a second dark dead pixel judging condition, and judging whether the current pixel point meets the second dead pixel judging condition according to the first deviation amplitude, the second deviation amplitude and the third deviation amplitude includes:
determining whether the third deviation amplitude is smaller than m of the smaller value of the first deviation amplitude and the second deviation amplitude 2 Doubling;
if the third deviation amplitude is less than the m of the smaller value of the first deviation amplitude and the second deviation amplitude 2 And (5) multiplying, judging that the current pixel point meets the second dark dead point judgment condition.
Optionally, the first dead pixel judgment condition includes a first bright dead pixel judgment condition, the second dead pixel judgment condition includes a second bright dead pixel judgment condition, and if the current pixel is judged to simultaneously meet the first dead pixel judgment condition and the second dead pixel judgment condition, the current pixel is corrected, including:
And if the current pixel point is judged to simultaneously meet the first bright and bad point judgment condition and the second bright and bad point judgment condition, carrying out bright and bad point correction on the current pixel point.
Optionally, the first dead pixel judgment condition includes a first dark dead pixel judgment condition, the second dead pixel judgment condition includes a second dark dead pixel judgment condition, and if the current pixel is judged to simultaneously meet the first dead pixel judgment condition and the second dead pixel judgment condition, the current pixel is corrected, including:
and if the current pixel point is judged to simultaneously meet the first dark dead point judgment condition and the second dark dead point judgment condition, correcting the dark dead point of the current pixel point.
Optionally, the bright-dead-spot correction includes:
judging whether the pixel value of the same-color pixel point adjacent to the first side of the current pixel point is equal to the maximum value in the group of data;
and if the pixel value of the same-color pixel adjacent to the first side of the current pixel is equal to the maximum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the second side of the current pixel.
Optionally, the bright-dead-spot correction further includes:
judging whether the pixel value of the same-color pixel point adjacent to the second side of the current pixel point is equal to the maximum value in the group of data;
and if the pixel value of the same-color pixel adjacent to the second side of the current pixel is equal to the maximum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the first side of the current pixel.
Optionally, if it is determined that the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel are not equal to the maximum value in the set of data, correcting the current pixel by an average value of the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel.
Optionally, the dark dead pixel correction includes:
judging whether the pixel value of the same-color pixel point adjacent to the first side of the current pixel point is equal to the minimum value in the group of data or not;
and if the pixel value of the same-color pixel adjacent to the first side of the current pixel is equal to the minimum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the second side of the current pixel.
Optionally, the dark dead pixel correction further includes:
judging whether the pixel value of the same-color pixel point adjacent to the second side of the current pixel point is equal to the minimum value in the group of data or not;
and if the pixel value of the same-color pixel adjacent to the second side of the current pixel is equal to the minimum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the first side of the current pixel.
Optionally, if it is determined that the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel are not equal to the minimum value in the set of data, correcting the current pixel by an average value of the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel.
The invention also provides an image correction system which is characterized by comprising a cache window selection unit, an average value calculation unit, a judgment unit and a correction unit, wherein the cache window selection unit takes the pixel points of odd columns positioned in the same row as cache window data by taking the current pixel point as the center in an image to be corrected; the average value calculation unit is used for obtaining pixel values of pixel points, which are in the same color with the current pixel point, in the cache window data to form group data, and then removing the maximum value in the group data to calculate the average value and the minimum value in the group data to calculate the average value so as to obtain a first average value and a second average value respectively; the method comprises the steps of obtaining a first adjacent pixel point and a second adjacent pixel point which are adjacent to a current pixel point in the cache window data, then obtaining an average value of pixel values of even number of pixel points which take the first adjacent pixel point as a center and are in the same color as the first pixel point to obtain a third average value, and obtaining an average value of pixel values of even number of pixel points which take the second adjacent pixel point as a center and are in the same color as the second pixel point to obtain a fourth average value; the average value calculating unit is further configured to average the set of data to obtain a fifth average value; the judging unit is used for judging whether the current pixel point meets a first bad point judging condition according to the first average value and the second average value; the judging unit is further configured to judge whether the current pixel point meets a second bad point judging condition according to the first adjacent pixel point, the second adjacent pixel point, the current pixel point, a third average value, a fourth average value and a fifth average value; the judging unit is further used for judging whether the current pixel point meets the first bad point judging condition and the second bad point judging condition at the same time; the correction unit is used for correcting the current pixel point after the judgment unit judges that the current pixel point simultaneously meets the first bad point judgment condition and the second bad point judgment condition.
The invention also provides an apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the image correction method when executing instructions of the memory.
The invention also provides a computer readable storage medium comprising computer instructions which, when executed by a processor, implement the image correction method.
The invention has the beneficial effects that: the method comprises the steps of obtaining pixel values of pixels, which are the same color as a current pixel, in cache window data to form group data, removing maximum value averaging and removing minimum value averaging to obtain a first average value and a second average value respectively, obtaining a first adjacent pixel and a second adjacent pixel, which are adjacent to the current pixel, in the cache window data, then obtaining pixel values of even number of pixels, which are centered on the first adjacent pixel and are the same color as the first pixel, averaging to obtain a third average value, obtaining pixel values of even number of pixels, which are centered on the second adjacent pixel and are the same color as the second pixel, averaging to obtain a fourth average value, judging whether the current pixel meets a first bad pixel judging condition according to the first average value and the second average value, averaging the group data to obtain a fifth average value, judging whether the current pixel meets a second bad pixel judging condition according to the first adjacent pixel, the second adjacent pixel, the current pixel, the third average value, the fourth average value and the fifth average value, judging whether the current pixel meets the second bad pixel judging condition or not, and correcting the current pixel by using the first pixel and the second bad pixel, and carrying out the first-row-and the second-bad pixel judging condition, and carrying out the first-line-and second-pixel-defect-judging condition, and carrying out the first-pixel-and second-line-pixel-and the first-pixel-and the second-pixel-and the first-pixel.
Drawings
FIG. 1 is a flow chart of an image correction method according to some embodiments of the invention;
FIG. 2 is a schematic diagram illustrating a position of window data of an image buffer to be corrected according to some embodiments of the present invention;
FIG. 3 is a schematic diagram of the pixel color of the data in the image buffer window to be corrected shown in FIG. 2;
FIG. 4 is a schematic diagram of an image to be corrected according to some embodiments of the invention;
fig. 5 is a corrected image of the image to be corrected shown in fig. 4.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention. Unless otherwise defined, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this invention belongs. As used herein, the word "comprising" and the like means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof without precluding other elements or items.
Aiming at the problems existing in the prior art, the embodiment of the invention provides an image correction method. Referring to fig. 1, the image correction method includes the steps of:
s1: in an image to be corrected, taking odd-numbered pixel points positioned in the same row as cache window data by taking a current pixel point as a center;
s2: obtaining pixel values of pixel points, which are the same color as the current pixel point, in the cache window data to form group data, and then removing maximum value in the group data for averaging and removing minimum value in the group data for averaging to obtain a first average value and a second average value respectively;
s3: acquiring a first adjacent pixel point and a second adjacent pixel point which are adjacent to the current pixel point in the buffer window data, then taking the pixel value of an even number of pixel points which take the first adjacent pixel point as the center and are the same with the first pixel point to average so as to obtain a third average value, and taking the pixel value of an even number of pixel points which take the second adjacent pixel point as the center and are the same with the second pixel point to average so as to obtain a fourth average value;
s4: judging whether the current pixel point meets a first dead point judging condition according to the first average value and the second average value;
S5: averaging the group data to obtain a fifth average value, and judging whether the current pixel point meets a second bad point judgment condition according to the first adjacent pixel point, the second adjacent pixel point, the current pixel point, a third average value, a fourth average value and the fifth average value;
s6: and judging whether the current pixel point meets the first dead point judging condition and the second dead point judging condition at the same time, and correcting the current pixel point if the current pixel point meets the first dead point judging condition and the second dead point judging condition at the same time. And if the current pixel point is judged to not meet the first dead point judgment condition and the second dead point judgment condition at the same time, correcting the current pixel point is not needed.
In some embodiments, S1 to S6 are sequentially executed on all the pixels in the image to be corrected until all the pixels are corrected, so as to obtain a corrected image.
In some embodiments, when the current pixel is located at an edge of the image to be corrected, the current pixel cannot acquire complete buffer window data, and then the buffer window data is complemented by a 0 pixel value. Or does not correct the current pixel point.
In some embodiments, the image to be corrected may be in RGB format, bayer array format, or other format. When the image to be corrected is in a format other than RGB format and bayer array format, it may be converted into RGB format or bayer array format by format conversion.
Fig. 2 is a schematic diagram illustrating a position of window data of an image buffer to be corrected according to some embodiments of the invention. Fig. 3 is a schematic diagram of the pixel color of the image buffer window to be corrected shown in fig. 2. Referring to fig. 2 and 3, taking an RGB format image to be corrected as an example, buff [0] is a G pixel, buff [1] is an R pixel, buff [2] is a G pixel, buff [3] is an R pixel, buff [4] is a G pixel, buff [5] is an R pixel, buff [6] is a G pixel, buff [7] is an R pixel, buff [8] is a G pixel, buff [9] is an R pixel, and buff [10] is a G pixel. The G pixel is a green pixel, and the R pixel is a red pixel.
With reference to FIGS. 2 and 3, in buff [5]]Taking 11 columns of pixel points positioned in the same row as cache window data by taking the pixel point as the center, namely, buff [5]]The local pixel point is the current pixel point. Buff [5]]The pixel point is R pixel point, buff [1] ]Pixel point at the position, buff [3]Pixel point at, buff [7 ]]Pixel point and buff [9 ]]Pixel point and buff [5]]The pixel points are the same color, buff [1 ]]Pixel value of pixel point at position, buff [3 ]]Pixel value of pixel point at position, buff [7 ]]Pixel value and buff [9 ] of the pixel point]The pixel values of the pixel points at the positions form group data, buff [1 ]]Pixel value of pixel point at position, buff [3 ]]Pixel value of pixel point at position, buff [7 ]]Pixel value and buff [9 ] of the pixel point]The pixel values of the pixel points are ordered into CrtStort [0 ] from big to small]、CrtStort[1]、CrtStort[2]、CrtStort[3]The process of obtaining the first average value can be expressed as a formulaAvgWhite represents the first average value and the second average value acquisition process can be expressed as the formula +.>AvgDark represents the second average value.
Referring to FIGS. 2 and 3, the pixel at buff [4] and the pixel at buff [6] are both adjacent to the pixel at the current pixel buff [5], the pixel at buff [4] is the first adjacent pixel to the pixel at the current pixel buff [5], and the pixel at buff [6] is the second adjacent pixel to the pixel at the current pixel buff [5 ].
Referring to FIGS. 2 and 3, and buff [4]]The pixel point with the same color as the pixel point is buff [0 ]]Pixel point at the position, buff [2 ]]Pixel point at, buff [6]Pixel point at, buff [8 ] ]Pixel point and buff [10 ]]A pixel point is positioned, and the buff [4 ]]An even number of pixels centered at the pixel point is buff [0 ]]Pixel point at the position, buff [2 ]]Pixel point at, buff [6]Pixel point at, buff [8 ]]At the pixel point, the process of obtaining the third average value may be expressed as a formulaAvgceft represents the third average value.
Referring to FIGS. 2 and 3, and buff [6 ]]The pixel point with the same color as the pixel point is buff [0 ]]Pixel point at the position, buff [2 ]]Pixel point at, buff [4 ]]Pixel point at, buff [8 ]]Pixel point and buff [10 ]]A pixel point is positioned, the buff [6 ]]An even number of pixels centered at the pixel point is buff 2]Pixel point at, buff [4 ]]Pixel point at, buff [8 ]]Pixel point at, buff [10 ]]At the pixel point, the process of obtaining the third average value may be expressed as a formulaAvgceft represents the fourth average value.
In some embodiments, the first dead pixel judgment condition includes a first bright dead pixel judgment condition, and judging whether the current pixel point meets the first dead pixel judgment condition according to the first average value and the second average value includes:
judging whether the pixel value of the current pixel point is greater than 1+m of the first average value 1 Multiple of 0 < m 1 <1;
If the pixel value of the current pixel point is judged to be greater than 1+m of the first average value 1 And (5) multiplying, judging that the current pixel point meets a first bright bad point judgment condition. In particular, if buff [5 ]]>((1+m 1 ) Avgcwhite), then the current pixel point buff [5 ] is judged]The pixel point meets the first bright and bad point judging condition, wherein m is 1 Is an adjustable parameter for controlling the intensity of the dead pixel detection, such as 0.1, 0.5, 0.9, etc., but is notIs specifically defined.
In some embodiments, the first dead pixel judgment condition further includes a first dark dead pixel judgment condition, and judging whether the current pixel point meets the first dead pixel judgment condition according to the first average value and the second average value, further includes:
judging whether the pixel value of the current pixel point is smaller than 1-m of the second average value 1 Doubling;
if the pixel value of the current pixel point is less than 1-m of the second average value 1 And (5) multiplying, judging that the current pixel point meets a first dark dead point judgment condition. In particular, if buff [5 ]]<((1-m 1 ) AvgDark), determining the current pixel buff [5 ]]The pixel points meet the first dark dead point judging condition.
In some embodiments, determining whether the current pixel satisfies a second dead pixel determination condition according to the first neighboring pixel, the second neighboring pixel, the current pixel, and a fifth average value includes:
Acquiring the deviation amplitude of the first adjacent pixel point relative to the third average value to obtain a first deviation amplitude; the process of obtaining the first deviation amplitude may be expressed as the formula shiftleft=buff [4] -AvgLeft, shiftLeft, representing the first deviation amplitude.
Acquiring the deviation amplitude of the second adjacent pixel point relative to the fourth average value to obtain a second deviation amplitude; the process of obtaining the second deviation amplitude may be expressed as the formula shiftgt=buff [6] -AvgRgt, shiftRgt.
Obtaining the deviation amplitude of the current pixel point relative to the fifth average value to obtain a third deviation amplitude; the process of obtaining the fifth average value can be expressed as a formulaWhere AvgCrt is the fifth average, the process of obtaining the third deviation amplitude may be expressed as the formula shiftcrt=buff [5 ]]-AvgCrt, shiftCrt represents said third deviation amplitude.
Judging whether the current pixel point meets a second bad point judging condition according to the first deviation amplitude, the second deviation amplitude and the third deviation amplitude.
In some embodiments, the second dead pixel judging condition includes a second bright dead pixel judging condition, and judging whether the current pixel satisfies the second dead pixel judging condition according to the first deviation amplitude, the second deviation amplitude and the third deviation amplitude includes:
Determining whether the third deviation amplitude is greater than m of the greater value of the first and second deviation amplitudes 2 Multiple, m 2 ≥1;
If the third deviation amplitude is judged to be greater than the m of the larger value of the first deviation amplitude and the second deviation amplitude 2 And (5) multiplying, judging that the current pixel point meets the second bright and bad point judgment condition. In particular, if Shift Crt>(m 2 * max (ShiftLeft, shiftRgt), judging that the current pixel point meets the second bright and bad point judgment condition. Wherein m is 2 Is an adjustable parameter for controlling the intensity of the dead pixel detection, such as 1, 2, 7, 10, 200, etc., but is not limited thereto.
In some embodiments, the second dead pixel judgment condition further includes a second dead pixel judgment condition, and judging whether the current pixel satisfies the second dead pixel judgment condition according to the first deviation amplitude, the second deviation amplitude and the third deviation amplitude includes:
determining whether the third deviation amplitude is smaller than m of the smaller value of the first deviation amplitude and the second deviation amplitude 2 Doubling;
if the third deviation amplitude is less than the m of the smaller value of the first deviation amplitude and the second deviation amplitude 2 And (5) multiplying, judging that the current pixel point meets the second dark dead point judgment condition. In particular, if Shift Crt<(m 2 * And min (ShiftLeft, shiftRgt), judging that the current pixel point meets the second dark dead point judgment condition.
In some embodiments, the first dead pixel judgment condition includes a first bright dead pixel judgment condition, the second dead pixel judgment condition includes a second bright dead pixel judgment condition, and if the current pixel is judged to simultaneously meet the first dead pixel judgment condition and the second dead pixel judgment condition, correcting the current pixel includes:
and if the current pixel point is judged to simultaneously meet the first bright and bad point judgment condition and the second bright and bad point judgment condition, carrying out bright and bad point correction on the current pixel point.
In some embodiments, the first dead pixel judgment condition includes a first dark dead pixel judgment condition, the second dead pixel judgment condition includes a second dark dead pixel judgment condition, and if the current pixel is judged to simultaneously meet the first dead pixel judgment condition and the second dead pixel judgment condition, correcting the current pixel includes:
and if the current pixel point is judged to simultaneously meet the first dark dead point judgment condition and the second dark dead point judgment condition, correcting the dark dead point of the current pixel point.
In some embodiments, the bright-dead correction includes:
judging whether the pixel value of the same-color pixel point adjacent to the first side of the current pixel point is equal to the maximum value in the group of data;
and if the pixel value of the same-color pixel adjacent to the first side of the current pixel is equal to the maximum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the second side of the current pixel.
In some embodiments, the bright-dead-spot correction further includes:
judging whether the pixel value of the same-color pixel point adjacent to the second side of the current pixel point is equal to the maximum value in the group of data;
and if the pixel value of the same-color pixel adjacent to the second side of the current pixel is equal to the maximum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the first side of the current pixel.
In some embodiments, if it is determined that the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel are not equal to the maximum value in the set of data, the current pixel is corrected by an average value of the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel.
Referring to fig. 2 and 3, the current pixel is the pixel at the buff [5], the pixel of the same color adjacent to the first side of the current pixel is the pixel at the buff [3], and if the pixel value of the pixel at the buff [3] is equal to the pixel value of CrtSort [0], the pixel value of the pixel at the buff [7] is assigned to the current pixel to realize the correction of the current pixel.
Referring to fig. 2 and 3, the current pixel is the pixel at the buff [5], the pixel of the same color adjacent to the second side of the current pixel is the pixel at the buff [7], and if the pixel value of the pixel at the buff [7] is equal to the pixel value of CrtSort [0], the pixel value of the pixel at the buff [3] is assigned to the current pixel to realize the correction of the current pixel.
Referring to FIGS. 2 and 3, the current pixel is buff [5]]At pixel point, if buff [3]Pixel value and buff [7] of the pixel point]The pixel values of the pixel points are not equal to CrtSort [0]]Will beAnd giving the current pixel point to realize the correction of the current pixel point.
In some embodiments, the dark pixel correction includes:
judging whether the pixel value of the same-color pixel point adjacent to the first side of the current pixel point is equal to the minimum value in the group of data or not;
and if the pixel value of the same-color pixel adjacent to the first side of the current pixel is equal to the minimum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the second side of the current pixel.
In some embodiments, the dark pixel correction further includes:
judging whether the pixel value of the same-color pixel point adjacent to the second side of the current pixel point is equal to the minimum value in the group of data or not;
and if the pixel value of the same-color pixel adjacent to the second side of the current pixel is equal to the minimum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the first side of the current pixel.
In some embodiments, if it is determined that the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel are not equal to the minimum value in the set of data, the current pixel is corrected by an average value of the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel.
Referring to fig. 2 and 3, the current pixel is the pixel at the buff [5], the pixel of the same color adjacent to the first side of the current pixel is the pixel at the buff [3], and if the pixel value of the pixel at the buff [3] is equal to the pixel value of CrtSort [3], the pixel value of the pixel at the buff [7] is assigned to the current pixel to realize the correction of the current pixel.
Referring to fig. 2 and 3, the current pixel is the pixel at the buff [5], the pixel of the same color adjacent to the second side of the current pixel is the pixel at the buff [7], and if the pixel value of the pixel at the buff [7] is equal to the pixel value of CrtSort [3], the pixel value of the pixel at the buff [3] is assigned to the current pixel to realize the correction of the current pixel.
Referring to FIGS. 2 and 3, the current pixel is buff [5]]At pixel point, if buff [3]Pixel value and buff [7] of the pixel point]The pixel values of the pixel points are not equal to CrtSort [3]]Will beAnd giving the current pixel point to realize the correction of the current pixel point.
Fig. 4 is a schematic diagram of an image to be corrected according to some embodiments of the invention. Fig. 5 is a corrected image of the image to be corrected shown in fig. 4. As can be clearly seen by comparing fig. 5 and fig. 4, fig. 5 removes the dynamic dead pixel with respect to fig. 4.
The invention also provides an image correction system which is characterized by comprising a cache window selection unit, an average value calculation unit, a judgment unit and a correction unit, wherein the cache window selection unit takes the pixel points of odd columns positioned in the same row as cache window data by taking the current pixel point as the center in an image to be corrected; the average value calculation unit is used for obtaining pixel values of pixel points, which are in the same color with the current pixel point, in the cache window data to form group data, and then removing the maximum value in the group data to calculate the average value and the minimum value in the group data to calculate the average value so as to obtain a first average value and a second average value respectively; the method comprises the steps of obtaining a first adjacent pixel point and a second adjacent pixel point which are adjacent to a current pixel point in the cache window data, then obtaining an average value of pixel values of even number of pixel points which take the first adjacent pixel point as a center and are in the same color as the first pixel point to obtain a third average value, and obtaining an average value of pixel values of even number of pixel points which take the second adjacent pixel point as a center and are in the same color as the second pixel point to obtain a fourth average value; the average value calculating unit is further configured to average the set of data to obtain a fifth average value; the judging unit is used for judging whether the current pixel point meets a first bad point judging condition according to the first average value and the second average value; the judging unit is further configured to judge whether the current pixel point meets a second bad point judging condition according to the first adjacent pixel point, the second adjacent pixel point, the current pixel point, a third average value, a fourth average value and a fifth average value; the judging unit is further used for judging whether the current pixel point meets the first bad point judging condition and the second bad point judging condition at the same time; the correction unit is used for correcting the current pixel point after the judgment unit judges that the current pixel point simultaneously meets the first bad point judgment condition and the second bad point judgment condition.
The invention also provides an apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the image correction method when executing instructions of the memory.
The invention also provides a computer readable storage medium comprising computer instructions which, when executed by a processor, implement the image correction method.
The computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, electromagnetic, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer readable storage medium include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access Memory (Random Access Memory, RAM), a Read-Only Memory (ROM), an erasable programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM) or flash Memory, a portable compact disc Read-Only Memory (CD-ROM), a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, or any suitable combination of the preceding.
Computer program code for carrying out operations of the present specification may be written in one or more programming languages, such as Java, smalltalk, C ++, C-language and the like. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
While embodiments of the present invention have been described in detail hereinabove, it will be apparent to those skilled in the art that various modifications and variations can be made to these embodiments. It is to be understood that such modifications and variations are within the scope and spirit of the present invention as set forth in the following claims. Moreover, the invention described herein is capable of other embodiments and of being practiced or of being carried out in various ways.

Claims (17)

1. An image correction method, comprising:
In an image to be corrected, taking odd-numbered pixel points positioned in the same row as cache window data by taking a current pixel point as a center;
obtaining pixel values of pixel points, which are the same color as the current pixel point, in the cache window data to form group data, and then removing maximum value in the group data for averaging and removing minimum value in the group data for averaging to obtain a first average value and a second average value respectively;
acquiring a first adjacent pixel point and a second adjacent pixel point which are adjacent to the current pixel point in the buffer window data, then taking the pixel value of an even number of pixel points which take the first adjacent pixel point as the center and are the same with the first pixel point to average so as to obtain a third average value, and taking the pixel value of an even number of pixel points which take the second adjacent pixel point as the center and are the same with the second pixel point to average so as to obtain a fourth average value;
judging whether the current pixel point meets a first dead point judging condition according to the first average value and the second average value;
averaging the group data to obtain a fifth average value, and judging whether the current pixel point meets a second bad point judgment condition according to the first adjacent pixel point, the second adjacent pixel point, the current pixel point, a third average value, a fourth average value and the fifth average value;
And judging whether the current pixel point meets the first dead point judging condition and the second dead point judging condition at the same time, and correcting the current pixel point if the current pixel point meets the first dead point judging condition and the second dead point judging condition at the same time.
2. The image correction method according to claim 1, wherein the first dead pixel judgment condition includes a first bright dead pixel judgment condition, and judging whether the current pixel satisfies the first dead pixel judgment condition based on the first average value and the second average value includes:
judging whether the pixel value of the current pixel point is greater than 1+m of the first average value 1 Multiple of 0 < m 1 <1;
If the pixel value of the current pixel point is judged to be greater than 1+m of the first average value 1 And (5) multiplying, judging that the current pixel point meets a first bright bad point judgment condition.
3. The image correction method according to claim 2, wherein the first dead pixel judgment condition further includes a first dead pixel judgment condition, and judging whether the current pixel satisfies the first dead pixel judgment condition based on the first average value and the second average value, further comprising:
Judging whether the pixel value of the current pixel point is smaller than 1-m of the second average value 1 Doubling;
if the pixel value of the current pixel point is less than 1-m of the second average value 1 And (5) multiplying, judging that the current pixel point meets a first dark dead point judgment condition.
4. The image correction method according to claim 1, wherein then determining whether the current pixel satisfies a second dead pixel determination condition based on the first adjacent pixel, the second adjacent pixel, the current pixel, and a fifth average value, comprises:
acquiring the deviation amplitude of the first adjacent pixel point relative to the third average value to obtain a first deviation amplitude;
acquiring the deviation amplitude of the second adjacent pixel point relative to the fourth average value to obtain a second deviation amplitude;
obtaining the deviation amplitude of the current pixel point relative to the fifth average value to obtain a third deviation amplitude;
judging whether the current pixel point meets a second bad point judging condition according to the first deviation amplitude, the second deviation amplitude and the third deviation amplitude.
5. The image correction method according to claim 4, wherein the second dead pixel judgment condition includes a second bright dead pixel judgment condition, and judging whether the current pixel satisfies the second dead pixel judgment condition based on the first deviation amplitude, the second deviation amplitude, and the third deviation amplitude includes:
Determining whether the third deviation amplitude is greater than m of the greater value of the first and second deviation amplitudes 2 Multiple, m 2 ≥1;
If the third deviation amplitude is judged to be greater than the m of the larger value of the first deviation amplitude and the second deviation amplitude 2 And (5) multiplying, judging that the current pixel point meets the second bright and bad point judgment condition.
6. The image correction method according to claim 5, wherein the second dead pixel judgment conditions further include a second dead pixel judgment condition, and judging whether the current pixel satisfies the second dead pixel judgment condition based on the first deviation amplitude, the second deviation amplitude, and the third deviation amplitude comprises:
determining whether the third deviation amplitude is smaller than m of the smaller value of the first deviation amplitude and the second deviation amplitude 2 Doubling;
if the third deviation amplitude is less than the m of the smaller value of the first deviation amplitude and the second deviation amplitude 2 And (5) multiplying, judging that the current pixel point meets the second dark dead point judgment condition.
7. The image correction method according to claim 1, wherein the first dead pixel judgment condition includes a first bright dead pixel judgment condition, the second dead pixel judgment condition includes a second bright dead pixel judgment condition, and correcting the current pixel if the current pixel is judged to satisfy the first dead pixel judgment condition and the second dead pixel judgment condition at the same time includes:
And if the current pixel point is judged to simultaneously meet the first bright and bad point judgment condition and the second bright and bad point judgment condition, carrying out bright and bad point correction on the current pixel point.
8. The image correction method according to claim 7, wherein the first dead pixel judgment condition includes a first dark dead pixel judgment condition, the second dead pixel judgment condition includes a second dark dead pixel judgment condition, and correcting the current pixel if the current pixel is judged to satisfy the first dead pixel judgment condition and the second dead pixel judgment condition at the same time, comprises:
and if the current pixel point is judged to simultaneously meet the first dark dead point judgment condition and the second dark dead point judgment condition, correcting the dark dead point of the current pixel point.
9. The image correction method according to claim 7 or 8, characterized in that the bright-dead-spot correction includes:
judging whether the pixel value of the same-color pixel point adjacent to the first side of the current pixel point is equal to the maximum value in the group of data;
and if the pixel value of the same-color pixel adjacent to the first side of the current pixel is equal to the maximum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the second side of the current pixel.
10. The image correction method according to claim 9, wherein the bright-dead-spot correction further includes:
judging whether the pixel value of the same-color pixel point adjacent to the second side of the current pixel point is equal to the maximum value in the group of data;
and if the pixel value of the same-color pixel adjacent to the second side of the current pixel is equal to the maximum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the first side of the current pixel.
11. The image correction method according to claim 10, wherein if it is determined that the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel are not equal to the maximum value in the set of data, the current pixel is corrected by an average value of the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel.
12. The image correction method according to claim 8, wherein the dark pixel correction includes:
judging whether the pixel value of the same-color pixel point adjacent to the first side of the current pixel point is equal to the minimum value in the group of data or not;
And if the pixel value of the same-color pixel adjacent to the first side of the current pixel is equal to the minimum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the second side of the current pixel.
13. The image correction method according to claim 12, wherein the dark pixel correction further includes:
judging whether the pixel value of the same-color pixel point adjacent to the second side of the current pixel point is equal to the minimum value in the group of data or not;
and if the pixel value of the same-color pixel adjacent to the second side of the current pixel is equal to the minimum value in the group of data, correcting the current pixel through the pixel value of the same-color pixel adjacent to the first side of the current pixel.
14. The image correction method according to claim 13, wherein if it is determined that the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel are not equal to the minimum value in the set of data, the current pixel is corrected by an average value of the pixel value of the same-color pixel adjacent to the first side of the current pixel and the pixel value of the same-color pixel adjacent to the second side of the current pixel.
15. The image correction system is characterized by comprising a cache window selection unit, an average value calculation unit, a judgment unit and a correction unit, wherein the cache window selection unit takes an odd-numbered pixel point positioned in the same row as cache window data by taking a current pixel point as a center in an image to be corrected; the average value calculation unit is used for obtaining pixel values of pixel points, which are in the same color with the current pixel point, in the cache window data to form group data, and then removing the maximum value in the group data to calculate the average value and the minimum value in the group data to calculate the average value so as to obtain a first average value and a second average value respectively; the method comprises the steps of obtaining a first adjacent pixel point and a second adjacent pixel point which are adjacent to a current pixel point in the cache window data, then obtaining an average value of pixel values of even number of pixel points which take the first adjacent pixel point as a center and are in the same color as the first pixel point to obtain a third average value, and obtaining an average value of pixel values of even number of pixel points which take the second adjacent pixel point as a center and are in the same color as the second pixel point to obtain a fourth average value; the average value calculating unit is further configured to average the set of data to obtain a fifth average value; the judging unit is used for judging whether the current pixel point meets a first bad point judging condition according to the first average value and the second average value; the judging unit is further configured to judge whether the current pixel point meets a second bad point judging condition according to the first adjacent pixel point, the second adjacent pixel point, the current pixel point, a third average value, a fourth average value and a fifth average value; the judging unit is further used for judging whether the current pixel point meets the first bad point judging condition and the second bad point judging condition at the same time; the correction unit is used for correcting the current pixel point after the judgment unit judges that the current pixel point simultaneously meets the first bad point judgment condition and the second bad point judgment condition.
16. An apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the image correction method according to any one of claims 1 to 14 when executing the instructions of the memory.
17. A computer readable storage medium comprising computer instructions which, when executed by a processor, implement the image correction method of any one of claims 1 to 14.
CN202311631585.2A 2023-11-30 2023-11-30 Image correction method, system, device and computer readable storage medium Pending CN117676359A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311631585.2A CN117676359A (en) 2023-11-30 2023-11-30 Image correction method, system, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311631585.2A CN117676359A (en) 2023-11-30 2023-11-30 Image correction method, system, device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN117676359A true CN117676359A (en) 2024-03-08

Family

ID=90082031

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311631585.2A Pending CN117676359A (en) 2023-11-30 2023-11-30 Image correction method, system, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117676359A (en)

Similar Documents

Publication Publication Date Title
US7366347B2 (en) Edge detecting method
EP3678056B1 (en) Skin color detection method and device and storage medium
US8135237B2 (en) Apparatuses and methods for noise reduction
CN108174057B (en) Method and device for rapidly reducing noise of picture by utilizing video image inter-frame difference
CN103733608B (en) Image processing apparatus and control method therefor
US8737762B2 (en) Method for enhancing image edge
CN112116542B (en) Image contrast enhancement method, device, electronic equipment and storage medium
US20130107083A1 (en) Method of Noise Reduction in Image and Device Thereof
US8165421B2 (en) Method and apparatus for image processing by using stored image
US20110254982A1 (en) Method for detecting/correcting bad pixel in image sensor
CN114998122A (en) Low-illumination image enhancement method
CN111031307A (en) Camera module detection method and device, electronic equipment and medium
JP5262953B2 (en) Image processing apparatus, image processing method, and program
US10319083B2 (en) Image artifact detection and correction in scenes obtained from multiple visual images
CN117676359A (en) Image correction method, system, device and computer readable storage medium
CN106846234B (en) Image video enhancement method, system and equipment based on FPGA
KR20130000665A (en) Method and apparatus for detecting and compensating back light frame
US8054348B2 (en) Noise reduction device and digital camera
Chen et al. Low complexity photo sensor dead pixel detection algorithm
US8442350B2 (en) Edge parameter computing method for image and image noise omitting method utilizing the edge parameter computing method
CN115802029A (en) Image dead pixel detection method and terminal
CN112862686B (en) Demosaicing method, device, equipment and medium based on bright and dark lines
US20150138439A1 (en) Real-time false color reduction system and method for color interpolation
CN116939374B (en) Lens shading correction method and device and electronic equipment
US10701328B2 (en) Image processing device, image processing method, and image processing program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination