CN117641137A - Method and device for correcting dead pixel of linear array camera - Google Patents
Method and device for correcting dead pixel of linear array camera Download PDFInfo
- Publication number
- CN117641137A CN117641137A CN202311474147.XA CN202311474147A CN117641137A CN 117641137 A CN117641137 A CN 117641137A CN 202311474147 A CN202311474147 A CN 202311474147A CN 117641137 A CN117641137 A CN 117641137A
- Authority
- CN
- China
- Prior art keywords
- gradient
- pixel
- dead pixel
- dead
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000004364 calculation method Methods 0.000 claims abstract description 16
- 230000000875 corresponding effect Effects 0.000 claims description 18
- 238000000605 extraction Methods 0.000 claims description 6
- 230000002596 correlated effect Effects 0.000 claims description 3
- 238000003384 imaging method Methods 0.000 abstract description 14
- 230000002950 deficient Effects 0.000 description 33
- 230000000694 effects Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 6
- 238000001514 detection method Methods 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000012512 characterization method Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000001627 detrimental effect Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000008054 signal transmission Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
- H04N23/84—Camera processing pipelines; Components thereof for processing colour signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/646—Circuits for processing colour signals for image enhancement, e.g. vertical detail restoration, cross-colour elimination, contour correction, chrominance trapping filters
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
Abstract
The application provides a method and a device for correcting dead pixels of a linear array camera. The method is used for correcting the output image of the linear array camera in real time. In the method, in image data shot by a linear array camera, dead pixel pixels in the image data are determined according to brightness parameters of all pixels in the image data. And performing correction calculation on the dead pixel according to the direction gradient corresponding to the dead pixel so as to acquire a correction value of the dead pixel. And correcting the brightness parameter of the dead pixel through the correction value of the dead pixel. The method can be used for correcting the output image of the linear array camera in real time so as to improve the imaging quality of the linear array camera.
Description
Technical Field
The application relates to the technical field of industrial cameras, in particular to a method and a device for correcting dead pixels of a linear array camera.
Background
The linear array camera is a camera adopting a linear array sensor, can realize continuous acquisition of a shot object through relative motion of the shot object and the linear array camera according to a line acquisition mode, and then splice a plurality of lines of images into a complete image for output. The image output by the linear array camera comprises a plurality of pixels, and the image quality is related to the quality of the plurality of pixels.
The defective pixel may be generated in the image acquisition process due to various factors such as parameter setting, shooting environment, manufacturing process, noise interference and the like of the linear array camera, and the defective pixel may reduce the imaging quality of the image, and may be simply called as the defective pixel. The related technology can adjust parameters of the linear camera according to shooting environment, and reduce generation of dead pixel by solving the problem of noise interference.
However, the generation of the dead pixel cannot be avoided by the technology, and the dead pixel still can be generated due to the difference of manufacturing processes in the image acquisition process. Based on the imaging principle of the linear array camera, the whole column data of a certain dead pixel is regarded as dead pixels, namely the dead pixel in the image output by the linear array camera often appears in a column, and the imaging quality of the linear array camera is seriously affected.
Disclosure of Invention
The application provides a method and a device for correcting dead pixels of a linear array camera. The method solves the problem that the imaging quality of the linear array camera is affected because the defective pixel is easy to cause the defective pixel to appear in a row in the imaging result of the linear array camera.
In a first aspect, the present application provides a method for correcting a dead pixel of a line camera, including:
collecting image data shot by a linear array camera;
determining a dead pixel in the image data according to brightness parameters of each pixel in the image data;
performing correction calculation according to the direction gradient corresponding to the dead pixel element to obtain a target correction value of the dead pixel element;
and correcting the brightness parameter of the dead pixel element by using the target correction value.
In some possible embodiments, the determining the dead pixel in the image data according to the brightness parameter of the image data includes:
calculating the brightness mean value and the brightness standard deviation of the image data;
calculating a column brightness average value and a column brightness standard deviation of a first pixel in the image data based on the brightness average value and the brightness standard deviation of the image data, wherein the first pixel is any one pixel in the image data;
and marking the first pixel as a dead pixel if the column brightness average value of the first pixel is outside the column brightness threshold interval of the pixel and/or if the column brightness standard deviation of the first pixel is outside the column brightness standard deviation threshold interval of the pixel.
In some possible embodiments, the performing correction calculation according to the direction gradient corresponding to the dead pixel element, to obtain the target correction value of the dead pixel element includes:
setting a correction data window with a preset size by taking the dead pixel as a center;
selecting at least one direction gradient for correcting the dead pixel based on the gray value of each second pixel in the correction data window; the position of the second pixel in the correction data window is not overlapped with the dead pixel;
and calculating a target correction value of the dead pixel element according to the at least one direction gradient.
In some possible embodiments, the calculating the target correction value of the dead pixel element according to the at least one direction gradient includes:
respectively determining endpoint pixels of each direction gradient corresponding to the dead pixel;
respectively calculating the gray difference value of the endpoint pixels of each directional gradient;
respectively calculating the absolute value of the gray difference value of the endpoint pixel of each direction gradient, wherein the absolute value of each direction gradient is the gradient value of each direction gradient;
and determining a target correction value of the dead pixel according to the gradient value of each direction gradient.
In some possible embodiments, the calculating the target correction value of the dead pixel element according to the at least one direction gradient includes:
determining a target direction gradient according to the gradient values of the direction gradients, wherein the target direction gradient is the direction gradient with the minimum gradient value;
and calculating the gray average value of the endpoint pixels of the target direction gradient, wherein the gray average value is the target correction value.
In some possible embodiments, the selecting at least one directional gradient for correcting the dead pixel based on the gray value of each second pixel in the correction data window includes:
determining at least one gradient template, wherein the gradient template is positioned in the correction data window, template pixels contained in the gradient template are positioned at the periphery of the dead pixel pixels, and template pixels contained in different gradient templates are different;
and determining the direction gradient formed by the template pixels as at least one direction gradient for correcting the dead pixel.
In some possible embodiments, the number of gradient templates is positively correlated with the number of dead pixel elements included in the image data.
In some possible embodiments, the pixel information of the dead pixel is stored in a dead pixel information table, and before the gray difference value of the endpoint pixel of each direction gradient is calculated, the method includes:
determining whether pixel information of two endpoint pixels of the direction gradient comprises a dead pixel mark or not by traversing the dead pixel information table;
the calculating the gray difference value of the endpoint pixels of each direction gradient comprises the following steps:
and if the pixel information of the two endpoint pixels of the direction gradient does not comprise the dead pixel mark, calculating the gray difference value of the endpoint pixels of the direction gradient.
In some possible embodiments, the directional gradient includes a first directional gradient and a second directional gradient, further including:
if the number of the first gradient values of the first direction gradient is equal to 1 or smaller than 1, selecting a second direction gradient for correcting the dead pixel based on the gray value of each second pixel in the correction data window; wherein the end point pixels of the first direction gradient and the second direction gradient which are positioned in the same direction are different.
In some possible embodiments, after the selecting the second direction gradient for correcting the dead pixel element, the method further includes:
calculating a second gradient value of the second directional gradient, and confirming a second correction value of the dead pixel according to the minimum gradient value in the second gradient value;
and calculating the average value of the first correction value and the second correction value to obtain the target correction value of the dead pixel.
In some possible embodiments, the directional gradient includes a lateral gradient, a forward gradient, a reverse gradient; wherein:
the transverse gradient is determined by a row pixel group containing the dead pixel in the correction data window;
the positive gradient is determined by a pixel group in a positive oblique direction taking the dead pixel as a center in the correction data window;
and the anticlockwise gradient is determined by an anticlockwise pixel group taking the dead pixel as the center in the correction data window.
In some possible embodiments, after correcting the luminance parameter of the dead pixel using the correction value, the method further includes:
searching the corrected dead pixel in the dead pixel information table according to the pixel information of the dead pixel;
and changing the pixel information of the corrected dead pixel in the dead pixel information table so that the corrected dead pixel can be used for correcting other dead pixels in the image data.
In a second aspect, the present application provides a dead pixel correction device for a line camera, including: the device comprises an acquisition module, an extraction module and a correction module;
the acquisition module is used for acquiring image data shot by the linear array camera;
the extraction module is used for determining a dead pixel in the image data according to brightness parameters of each pixel in the image data;
the correction module is used for executing correction calculation according to the direction gradient corresponding to the dead pixel element to obtain a target correction value of the dead pixel element;
the correction module is also used for correcting the brightness parameter of the dead pixel element by using the target correction value.
According to the technical content, the application provides a method and a device for correcting dead pixels of a linear array camera. The method is used for correcting the output image of the linear array camera in real time. In the method, in image data shot by a linear array camera, dead pixel pixels in the image data are determined according to brightness parameters of all pixels in the image data. And performing correction calculation on the dead pixel according to the direction gradient corresponding to the dead pixel so as to acquire a correction value of the dead pixel. And correcting the brightness parameter of the dead pixel through the correction value of the dead pixel so as to reduce the dead pixel in the output image data of the linear array camera and improve the imaging quality of the linear array camera. In addition, the method can be used for correcting the output image of the linear array camera in real time based on the setting of the dead pixel information table, so that the correction efficiency of the image data output by the linear array camera is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings that are needed in the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic diagram of dead pixel correction of a line camera according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a calibration data window according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a first direction gradient selection provided in an embodiment of the present application;
fig. 4 is a schematic diagram of determining endpoint pixels according to a dead pixel information table according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a second direction gradient selection provided in an embodiment of the present application;
fig. 6 is a schematic diagram of a corrected dead pixel according to an embodiment of the present application for correcting other dead pixels.
Detailed Description
Reference will now be made in detail to the embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The embodiments described in the examples below do not represent all embodiments consistent with the present application. Merely as examples of systems and methods consistent with some aspects of the present application as detailed in the claims.
As an image acquisition device, the linear array camera has the advantages of wide dynamic range, high resolution, high scanning frequency and the like, and can be applied to scenes such as defect detection and high-precision measurement. Factors that affect the imaging quality of a line camera include, but are not limited to, the manufacturing process of the detector of the line camera, the stability of the signal transmission channel, noise interference. These factors easily cause that the image data output by the linear array camera comprises dead pixel elements (which can be simply called dead pixels), and based on the imaging principle of the linear array camera, the whole column data of the dead pixel elements can be regarded as dead pixels, so that the problem of poor image quality is caused when the image data output by the linear array camera comprises the dead pixels.
Therefore, in the process of using the line camera, real-time correction is required to be performed on the image data output by the line camera to improve the imaging quality of the line camera. For the dead pixel in the image data of the linear array camera, the dead pixel can be classified according to brightness, for example, the dead pixel can be classified into a hot pixel (the dead pixel with brightness far higher than that of the dead pixel of the adjacent pixel), a dead pixel (the dead pixel with brightness far lower than that of the adjacent pixel), and a flickering pixel (the dead pixel with unstable response and neglected brightness).
Based on the above problems, as shown in fig. 1, the present application provides a method for correcting dead pixels of a line camera, so as to correct dead pixels in image data in the process of using the line camera, thereby improving the imaging quality of the line camera. The method comprises the following steps:
s100: collecting image data shot by a linear array camera;
in some embodiments, the image data to be output can be obtained from the line camera in real time, and whether the dead pixel exists in the image data or not can be detected. And correcting the dead pixel under the condition that the dead pixel exists so as to improve the imaging quality of the linear array camera.
It can be understood that in the embodiment of the present application, online detection may be performed on the line camera to correct, in real time, the dead pixel in the image data output by the line camera. The line camera may also perform off-line detection by intensively storing image data output from the line camera, and performing dead pixel detection and dead pixel correction on the stored image data.
S200: determining a dead pixel in the image data according to brightness parameters of each pixel in the image data;
the defective pixel can be classified according to brightness, so that whether the defective pixel exists in the output image of the brightness detection line camera can also be determined. In particular, in some embodiments, the linear camera to be corrected is one of an optical gray-scale linear camera or an infrared linear camera, and the output of the optical gray-scale linear camera or the infrared linear camera is single-channel gray-scale data, so that whether a defective pixel exists in an output image of the optical gray-scale linear camera or the infrared linear camera is judged according to brightness, which is beneficial to improving the accuracy of defective pixel identification and facilitating correction of the defective pixel according to brightness/gray scale.
In some embodiments, the determining the dead pixel in the image data according to the brightness parameter of the image data includes:
calculating the brightness mean value and the brightness standard deviation of the image data;
calculating a column brightness average value and a column brightness standard deviation of a first pixel in the image data based on the brightness average value and the brightness standard deviation of the image data; the first pixel is any one pixel in the image data;
and marking the first pixel as a dead pixel if the column brightness average value of the first pixel is outside the column brightness threshold interval of the pixel and/or if the column brightness standard deviation of the first pixel is outside the column brightness standard deviation threshold interval of the pixel.
Based on the characteristic that the whole column data of the defective pixel of the linear array camera can be regarded as the defective pixel, the column brightness average value and the column brightness standard deviation in the image data can be calculated by solving the brightness average value in the image data to be output by the linear array camera so as to judge whether the defective pixel exists.
In the description of the present embodiment, reference is made to A i Represents the column brightness average of the first pixel, B i Representing a column brightness standard deviation of the first pixel; and a reasonable range of column luminance average values, for example, [ A-A×T ], can be preset A ,A+A×T A ],[B-B×T B ,B+B×T B ]. Wherein T is A Is the brightness average threshold value, T B Is the standard deviation threshold.
It will be appreciated that when A i 、B i All within a reasonable range associated therewith, the first picture element is considered not to be a dead pixel. When A is i 、B i If any one of the pixels is out of a reasonable range related to the pixel, the first pixel is considered to be a dead pixel, and correction is needed.
Judging whether the first pixel is a defective pixel or not according to the brightness, and matching the first pixel with a linear array camera outputting single gray data, thereby being beneficial to improving the identification accuracy of the defective pixel and being beneficial to correcting the defective pixel subsequently.
S300: performing correction calculation according to the direction gradient corresponding to the dead pixel element to obtain a target correction value of the dead pixel element;
the direction gradient can be used for calculating a target correction value of the dead pixel, and the direction gradient corresponding to the dead pixel is at least one. In some embodiments, the performing correction calculation according to the direction gradient corresponding to the dead pixel element, to obtain the target correction value of the dead pixel element includes:
setting a correction data window with a preset size by taking the dead pixel as a center;
selecting at least one direction gradient for correcting the dead pixel based on the gray value of each second pixel in the correction data window;
and calculating a target correction value of the dead pixel element according to the at least one direction gradient.
In the embodiment, the correction data window may be set with the dead pixel as the center, and the correction data window includes a plurality of pixels adjacent to the dead pixel, that is, the second pixel. It will be appreciated that the second pixel is a different pixel to the first pixel (here the first pixel is a dead pixel), and the position of the second pixel in the correction data window does not coincide with the dead pixel.
It will be appreciated that the dead pixel is mainly characterized by its brightness being significantly different from that of the adjacent pixels, so that a suitable directional gradient can be selected by the gray value of the second pixel (which can characterize the pixel brightness) to calculate a correction value for correcting the dead pixel. In addition, the dead pixel is taken as the center, so that the pixels which are symmetrical by taking the dead pixel as the center are easy to uniformly distribute, the length selection of the direction gradient is facilitated, and the brightness value of the second pixel in the selected direction gradient is more similar to that of the dead pixel, so that a better correction effect is obtained.
The preset size of the correction data window may be expressed as mxn, where M and N are both odd numbers for facilitating calculation of the correction value of the dead pixel. The size of the correction data window is excessively large, so that the excessive number of pixels in the correction data window is easy to cause, and the reference meaning of a second pixel far away from the dead pixel to the dead pixel is smaller, so that the selection of the direction gradient is not facilitated. The size of the correction data window is selected to be too small, which tends to result in fewer selectable directional gradients, which is detrimental to calculating the correction value. The preset size of the correction data window can be set according to the actual application. In some embodiments, as shown in fig. 2, a 5×5 preset size is selected as the size of the correction data window.
As shown in fig. 3, after the correction data window is set, a directional gradient may be selected according to the gray value of the second pixel in the correction data window to calculate the correction value of the dead pixel. Namely, according to the direction gradient, calculating the correction value of the dead pixel, including:
respectively determining endpoint pixels of each direction gradient corresponding to the dead pixel;
respectively calculating the gray difference value of the endpoint pixels of each directional gradient;
respectively calculating the absolute value of the gray difference value of the endpoint pixel of each direction gradient;
and determining the correction value of the dead pixel element according to the absolute value of each direction gradient, wherein the absolute value of each direction gradient is the gradient value of each direction gradient.
In the set correction data window, the direction gradient corresponding to the dead pixel is at least one, and in the embodiment of the application, the pixels at two ends of the direction gradient are called endpoint pixels. The gradient value of the directional gradient of the endpoint pixel can be obtained by calculating the gray level difference of the endpoint pixel. The magnitude relation of the gray values of the endpoint pixels of each directional gradient is not determined, so that the calculated gray difference value may be a positive value or a negative value. Therefore, the absolute value of the gray difference value of each direction gradient is needed to be taken, so that the gray difference values of the gradients in each direction are compared, and the gradient value for correcting the dead pixel is screened out.
In some embodiments, the directional gradient may include a lateral gradient, a forward gradient, a reverse gradient; wherein:
the transverse gradient is determined by a row pixel group containing the dead pixel in the correction data window;
the positive gradient is determined by a pixel group in a positive oblique direction taking the dead pixel as a center in the correction data window;
and the anticlockwise gradient is determined by an anticlockwise pixel group taking the dead pixel as the center in the correction data window.
As shown in fig. 3, taking d13 as a dead pixel, the lateral gradient in the directional gradient may be d11-d12-d13-d14-d15, d12-d13-d14; the positive slope gradient may be d 9-d 13-d17; the anticline gradient may be d7-d 13-d19. Wherein, for example, d11 and d15 are the end point pixels of the transverse gradient where they are located, and can be used for determining the transverse gradient. d9 D17 is the endpoint pixel of the positive gradient where it is located and can be used to determine the positive gradient. d7 D19 is the endpoint pel of the anticline gradient where it is located and can be used to determine the anticline gradient.
The gradient value of the transverse gradient where d11, d15 is located may be represented as |d11-d15|, the gradient value of the positive gradient where d9, d17 is located may be represented as |d11-d15|, and the gradient value of the positive gradient where d7, d19 is located may be represented as |d7-d19|.
It should be noted that, the direction gradient selected by taking the dead pixel as the center includes, but is not limited to, the direction gradient described above. However, for the correction of the dead pixel of the linear array camera, the whole row data of the dead pixel is regarded as the dead pixel, so that the selection of the directional gradient needs to take the transverse gradient, the positive gradient and the negative gradient as main gradients, and the longitudinal gradient is avoided as much as possible, so that the accuracy of the correction value is improved.
In some embodiments, when selecting the endpoint pel and the direction gradient, it is necessary to determine whether the endpoint pel is a dead pixel to determine whether the direction gradient in which it is located can be used to calculate the correction value of the dead pixel pel. Under the condition that the endpoint pixel is also a bad pixel, the correction effect of the calculated correction value is poor, even invalid correction is achieved, and the correction efficiency and the imaging quality are affected.
It will be appreciated that each pixel in the image data output by the line camera has pixel information including information describing the pixel, such as position information of the pixel, neighboring dead pixel information, etc. The pixel information may be stored in a bad point information table. Based on the content contained in the pixel information, the number of the dead pixel pixels, the position information of the dead pixel pixels and the neighborhood dead pixel information of the dead pixel pixels can be contained in the dead pixel information table. The bad pixels in the bad information table may also set a flag to distinguish from the non-bad pixels, for example, a flag "1" may be set for the bad pixels, and a flag "0" may be set for the non-bad pixels. The number of marks in the dead pixel information table associated with the image data to be output at a time should be consistent with the resolution of the detector of the line camera to accommodate the pixel information of all the pixels in the image data.
Based on the types of directional gradients described in the above embodiments, a gradient template may be selected in the correction data window to be used for selecting multiple directional gradients to form a more effective correction for the dead pixel. Namely, the selecting at least one direction gradient for correcting the dead pixel based on the gray value of each second pixel in the correction data window comprises the following steps:
determining at least one gradient template, wherein the gradient template is positioned in the correction data window, template pixels contained in the gradient template are positioned at the periphery of the dead pixel pixels, and template pixels contained in different gradient templates are different;
and determining the direction gradient formed by the template pixels as at least one direction gradient for correcting the dead pixel.
The gradient template may refer to a collection of pixels adjacent to the dead pixel, and these pixels are used to construct a directional gradient to correct the dead pixel. The pixels in the gradient template preferentially select pixels adjacent to the dead pixel, and the target correction value calculated according to the pixels adjacent to the dead pixel is more suitable for the dead pixel, so that the gray value (brightness value) of the corrected dead pixel is closer to that of the adjacent pixels, and a better correction effect is obtained.
It should be noted that different combinations of pixels may form different gradient templates, and pixels adjacent to a dead pixel may also include a dead pixel, that is, a case where image data includes consecutive dead pixels. Therefore, a plurality of dead pixel elements may be included in the gradient template, and the correction effect on the dead pixel elements may be poor on the basis of the gradient template including the continuous/plurality of dead pixel elements. At this time, a plurality of gradient templates can be selected to calculate a target correction value for correcting the dead pixel element. That is, the number of gradient templates is positively correlated with the number of dead pixel elements included in the image data, and when the number of directional gradients in the gradient templates selected in advance is insufficient, other gradient templates can be selected to correct the dead pixel elements together with the gradient templates selected in advance, so as to improve the correction effect of the dead pixel elements.
In the embodiment, as shown in fig. 4, the pixel information of the dead pixel is stored in a dead pixel information table, and before the calculating the gray difference value of the endpoint pixel, the method includes:
determining whether pixel information of two endpoint pixels of the direction gradient comprises a dead pixel mark or not by traversing the dead pixel information table;
the calculating the gray difference value of the endpoint pixels of each direction gradient comprises the following steps:
and if the pixel information of the two endpoint pixels of the direction gradient does not comprise the dead pixel mark, calculating the gray difference value of the endpoint pixels of the direction gradient.
When the direction gradient is selected and the endpoint pixels are selected, whether the endpoint pixels are bad pixels or not can be determined by traversing the bad pixel information table. As shown in fig. 3, taking the direction gradient of d11-d12-d13-d14-d15 as an example, whether the pixel information of the endpoint pixels d11, d15 includes a dead pixel mark is queried in the dead pixel information table. Through inquiry, if the endpoint pixels d11 and d15 do not comprise dead pixel marks, the characterization direction gradient can be used for calculating correction values of the dead pixel pixels and calculating gray difference values of the endpoint pixels d11 and d15 of the direction gradient.
In other embodiments, by querying the dead pixel information table, if the dead pixel mark is included in the pixel information of the endpoint pixel d11, the characterizing direction gradient may not be used to calculate the correction value of the dead pixel, and the deleting operation may be performed on the direction gradient, so as to save the operation resource. It can be understood that when judging whether the direction gradient can be used to calculate the correction value of the dead pixel, any one of the endpoint pixels d11 and d15 cannot be the dead pixel, that is, the endpoint pixel d15 is the dead pixel, or when the endpoint pixels d11 and d15 are both the dead pixel, the direction gradient cannot be used to calculate the correction value of the dead pixel.
The judgment basis of the dead pixel is carried out according to the brightness of the dead pixel and the brightness of the adjacent pixel, so that the brightness of the dead pixel is required to be close to the brightness of the adjacent pixel in the process of correcting the dead pixel. Therefore, the minimum gradient value in the gradient values is selected to correct the defective pixel, so that the condition that the brightness of the defective pixel is still obviously different from that of the adjacent pixels after the defective pixel is corrected by the larger value in the gradient values is avoided, and the correction effectiveness is further improved.
In some embodiments, after the gradient values of the gradients in the directions corresponding to the dead pixel pixels are obtained through calculation, the correction value for correcting the dead pixel pixels can be calculated based on the minimum gradient value by sorting the gradient values according to the magnitude. However, when the minimum gradient value is selected, since the selected gradient template may include a plurality of dead pixels, the endpoint pixels based on the directional gradient selected in the gradient template may include dead pixels, and thus the gradient value of the directional gradient including the dead pixels cannot be used as the calculation basis of the final correction value.
It can be appreciated that whether the directional gradient is valid can be determined by determining whether the endpoint pel of the directional gradient is a dead pixel. And then judging whether to select an additional gradient template to jointly calculate the correction value of the dead pixel by judging the number of gradient values obtained by the gradient templates so as to improve the correction effect.
As shown in fig. 5, when there is still a defective pixel in the pixels adjacent to the defective pixel, the end point pixel of the direction gradient may be the defective pixel, and since the direction gradient of the defective pixel, which is the end point pixel, is not used to calculate the target correction value of the defective pixel, the number of gradient values calculated according to the gradient direction is easily insufficient, and thus the correction effect is poor.
Therefore, when determining whether the endpoint pixel of the direction gradient is a dead pixel or not by traversing the dead pixel information table, the method is equivalent to the step of executing the number of statistical direction gradients so as to determine whether the target correction value calculated according to the direction gradient is effective or not.
In some embodiments, it may be determined whether other gradient templates need to be selected based on the number of gradient values of the directional gradient. I.e. the directional gradient comprises a first directional gradient and a second directional gradient:
if the number of the first gradient values of the first direction gradient is equal to 1 or smaller than 1, selecting a second direction gradient for correcting the dead pixel based on the gray value of each second pixel in the correction data window; wherein the end point pixels of the first direction gradient and the second direction gradient which are positioned in the same direction are different.
In the embodiment, when the number of the first gradient values of the first direction gradient is less than 1 or equal to 1, it is considered that a single gradient value is insufficient to perform correction with higher accuracy on the dead pixel, so that the second direction gradient is selected based on the correction data window to increase the direction gradient for calculating the target correction value of the dead pixel. The number of the direction gradients used for calculating the dead pixel target correction value can be increased by selecting the second direction gradients, so that the dead pixel is corrected through the plurality of direction gradients, and the correction effect is improved.
For example, as shown in fig. 4, when d7, d12, and d15 are dead pixels, the first direction gradient can only select the gray difference between d17 and d9 to calculate the first gradient value as the target correction value, that is, the number of the first gradient values is 1, which has low accuracy as the target correction value. Therefore, a second direction gradient is also needed to be selected, namely, the transverse gradients d12-d13-d14 in the second direction gradient are obtained; positive inclined gradient d11-d8, d12-d8; the anticline gradient d14-d8, d15-d8.
The selection manner of the second direction gradient is similar to that of the first direction gradient, and will not be described herein again, it being understood that the endpoint pixels of the first direction gradient and the second direction gradient located in the same direction are different, so as to avoid wasting operation resources when repeatedly selecting the direction gradient. After selecting the second direction gradient, a second gradient value may be calculated according to the second direction gradient, that is, after selecting the second direction gradient for correcting the dead pixel element, further including:
calculating a second gradient value of the second directional gradient, and confirming a second correction value of the dead pixel according to the minimum gradient value in the second gradient value;
and calculating the average value of the first correction value and the second correction value to obtain the target correction value of the dead pixel.
It will be appreciated that the endpoint pel of the second directional gradient may still include a dead pixel, so that a second gradient value of the second directional gradient may also be calculated based on the manner in which the first gradient value is calculated, and the second correction value is validated for use in calculating the target correction value of the dead pixel in conjunction with the first correction value. By setting the direction gradient for multiple times, the calculation accuracy of the target correction value can be improved under the condition that the acquisition basis accuracy of the target correction value is low, and then the correction effect of the dead pixel is improved. In some embodiments, calculating the average value of the first correction value and the second correction value may enable the brightness parameter of the corrected dead pixel to be closer to the brightness parameter of the adjacent pixel, so as to obtain a better correction effect.
S400: and correcting the brightness parameter of the dead pixel element by using the correction value.
The brightness parameter of the dead pixel can be adjusted according to the correction value so as to realize the correction effect. The corrected dead pixel should be relatively close to the brightness of the adjacent pixels so as to ensure the quality of the image output by the linear array camera.
When correcting the image data output by the linear camera, each pixel in the image data is detected by a dead pixel one by one, so that each pixel is not only used as a detected target, but also used for correcting other pixels. I.e. after correcting the luminance parameter of the dead pixel element using the correction value, further comprising:
searching the corrected dead pixel in the dead pixel information table according to the pixel information of the dead pixel;
and changing the pixel information of the corrected dead pixel in the dead pixel information table so that the corrected dead pixel can be used for correcting other dead pixels in the image data.
The corrected dead pixel can also be used as a non-dead pixel for correcting other dead pixels. Therefore, after the defective pixel is corrected, the pixel information of the defective pixel in the defective pixel information table needs to be adaptively modified. For example, a flag "1" for characterizing a dead pixel is changed to a flag "0" for characterizing a non-dead pixel.
It will be appreciated that it is necessary to find the defective pixel in the defective pixel information table according to the pixel information of the corrected defective pixel, and further modify the flag in the pixel information thereof. By modifying the dead pixel information table, the dead pixel can be characterized as corrected, so that the corrected dead pixel can be used as a non-dead pixel to correct other dead pixels in the subsequent dead pixel correction process.
Along the above embodiments, as shown in fig. 6, after the dead pixel d13 is corrected, the dead pixel d13 can be found in the dead pixel information table according to the pixel information of the dead pixel d13, and the mark of the dead pixel d13 is changed from "1" to "0". And when d14 is detected to be a defective pixel, d13-d14-d15 can be used as a direction gradient corresponding to the defective pixel d14 and used for calculating a correction value of the defective pixel d 14.
In the above embodiment, the dead pixel information table is set to store the states of the pixels in the image data (including whether the pixels are dead pixels or not by setting the dead pixel marks), and the dead pixel marks set in the dead pixel information table are changed in real time in combination with the corrected results of the dead pixel pixels, so that the corrected dead pixel pixels can be used for calculating the correction values of other dead pixel pixels, dynamic real-time correction is realized, and improvement of the correction efficiency and accuracy of the dead pixel pixels is facilitated. The real-time characteristic is that the corrected dead pixel is used for calculating correction values of other dead pixels, and for the dead pixels adjacent to the corrected dead pixel, the correction effect is higher than that obtained by calculating the correction value through the pixel with a longer distance because the dead pixels are adjacent to each other, so that the correction effect of the dead pixel is more beneficial to improvement.
In some embodiments, the present application provides a line camera dead pixel correction device, including: the device comprises an acquisition module, an extraction module and a correction module;
the acquisition module is used for acquiring image data shot by the linear array camera;
the extraction module is used for determining a dead pixel in the image data according to brightness parameters of each pixel in the image data;
the correction module is used for executing correction calculation according to the direction gradient corresponding to the dead pixel element to obtain a correction value of the dead pixel element;
the correction module is also used for correcting the brightness parameter of the dead pixel element by using the correction value.
According to the technical content, the application provides a method and a device for correcting dead pixels of a linear array camera. The method is used for correcting the output image of the linear array camera in real time. In the method, in image data shot by a linear array camera, dead pixel pixels in the image data are determined according to brightness parameters of all pixels in the image data. And performing correction calculation on the dead pixel according to the direction gradient corresponding to the dead pixel so as to acquire a correction value of the dead pixel. And correcting the brightness parameter of the dead pixel through the correction value of the dead pixel so as to reduce the dead pixel in the output image data of the linear array camera and improve the imaging quality of the linear array camera. In addition, the method can be used for correcting the output image of the linear array camera in real time based on the setting of the dead pixel information table, so that the correction efficiency of the image data output by the linear array camera is improved.
The foregoing detailed description of the embodiments is merely illustrative of the general principles of the present application and should not be taken in any way as limiting the scope of the invention. Any other embodiments developed in accordance with the present application without inventive effort are within the scope of the present application for those skilled in the art.
Claims (13)
1. The method for correcting the dead pixel of the linear array camera is characterized by comprising the following steps of:
collecting image data shot by a linear array camera;
determining a dead pixel in the image data according to brightness parameters of each pixel in the image data;
performing correction calculation according to the direction gradient corresponding to the dead pixel element to obtain a target correction value of the dead pixel element;
and correcting the brightness parameter of the dead pixel element by using the target correction value.
2. The method of claim 1, wherein said determining a dead pixel in said image data based on a luminance parameter of said image data comprises:
calculating the brightness mean value and the brightness standard deviation of the image data;
calculating a column brightness average value and a column brightness standard deviation of a first pixel in the image data based on the brightness average value and the brightness standard deviation of the image data, wherein the first pixel is any one pixel in the image data;
and marking the first pixel as a dead pixel if the column brightness average value of the first pixel is outside the column brightness threshold interval of the pixel and/or if the column brightness standard deviation of the first pixel is outside the column brightness standard deviation threshold interval of the pixel.
3. The method according to claim 1, wherein the performing correction calculation according to the direction gradient corresponding to the dead pixel element to obtain the target correction value of the dead pixel element includes:
setting a correction data window with a preset size by taking the dead pixel as a center;
selecting at least one direction gradient for correcting the dead pixel based on the gray value of each second pixel in the correction data window; the position of the second pixel in the correction data window is not overlapped with the dead pixel;
and calculating a target correction value of the dead pixel element according to the at least one direction gradient.
4. A method according to claim 3, wherein said calculating a target correction value for said dead pixel element based on said at least one directional gradient comprises:
respectively determining endpoint pixels of each direction gradient corresponding to the dead pixel;
respectively calculating the gray difference value of the endpoint pixels of each directional gradient;
respectively calculating the absolute value of the gray difference value of the endpoint pixel of each direction gradient, wherein the absolute value of each direction gradient is the gradient value of each direction gradient;
and determining a target correction value of the dead pixel according to the gradient value of each direction gradient.
5. A method according to claim 3, wherein said calculating a target correction value for said dead pixel element based on said at least one directional gradient comprises:
determining a target direction gradient according to the gradient values of the direction gradients, wherein the target direction gradient is the direction gradient with the minimum gradient value;
and calculating the gray average value of the endpoint pixels of the target direction gradient, wherein the gray average value is the target correction value.
6. A method according to claim 3, wherein said selecting at least one directional gradient for correcting said dead pixel based on gray values of respective second pixels within said correction data window comprises:
determining at least one gradient template, wherein the gradient template is positioned in the correction data window, template pixels contained in the gradient template are positioned at the periphery of the dead pixel pixels, and template pixels contained in different gradient templates are different;
and determining the direction gradient formed by the template pixels as at least one direction gradient for correcting the dead pixel.
7. The method according to claim 6, comprising:
the number of gradient templates is positively correlated with the number of dead pixel elements included in the image data.
8. The method according to claim 4, wherein the pixel information of the dead pixel pixels is stored in a dead pixel information table, and before the gray difference value of the endpoint pixels of each direction gradient is calculated, respectively, the method comprises:
determining whether pixel information of two endpoint pixels of the direction gradient comprises a dead pixel mark or not by traversing the dead pixel information table;
the calculating the gray difference value of the endpoint pixels of each direction gradient comprises the following steps:
and if the pixel information of the two endpoint pixels of the direction gradient does not comprise the dead pixel mark, calculating the gray difference value of the endpoint pixels of the direction gradient.
9. The method of claim 5, wherein the directional gradient comprises a first directional gradient and a second directional gradient, further comprising:
if the number of the first gradient values of the first direction gradient is equal to 1 or smaller than 1, selecting a second direction gradient for correcting the dead pixel based on the gray value of each second pixel in the correction data window; wherein the end point pixels of the first direction gradient and the second direction gradient which are positioned in the same direction are different.
10. The method of claim 9, wherein after the selecting the second directional gradient for correcting the dead pixel element, further comprising:
calculating a second gradient value of the second directional gradient, and confirming a second correction value of the dead pixel according to the minimum gradient value in the second gradient value;
and calculating the average value of the first correction value and the second correction value to obtain the target correction value of the dead pixel.
11. A method according to claim 3, wherein the directional gradient comprises a lateral gradient, a forward gradient, a reverse gradient; wherein:
the transverse gradient is determined by a row pixel group containing the dead pixel in the correction data window;
the positive gradient is determined by a pixel group in a positive oblique direction taking the dead pixel as a center in the correction data window;
and the anticlockwise gradient is determined by an anticlockwise pixel group taking the dead pixel as the center in the correction data window.
12. The method of claim 6, further comprising, after correcting the luminance parameter of the dead pixel using the correction value:
searching the corrected dead pixel in the dead pixel information table according to the pixel information of the dead pixel;
and changing the pixel information of the corrected dead pixel in the dead pixel information table.
13. The dead pixel correction device of the linear array camera is characterized by comprising the following components: the device comprises an acquisition module, an extraction module and a correction module;
the acquisition module is used for acquiring image data shot by the linear array camera;
the extraction module is used for determining a dead pixel in the image data according to brightness parameters of each pixel in the image data;
the correction module is used for executing correction calculation according to the direction gradient corresponding to the dead pixel element to obtain a correction value of the dead pixel element;
the correction module is also used for correcting the brightness parameter of the dead pixel element by using the correction value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311474147.XA CN117641137A (en) | 2023-11-07 | 2023-11-07 | Method and device for correcting dead pixel of linear array camera |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311474147.XA CN117641137A (en) | 2023-11-07 | 2023-11-07 | Method and device for correcting dead pixel of linear array camera |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117641137A true CN117641137A (en) | 2024-03-01 |
Family
ID=90031255
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311474147.XA Pending CN117641137A (en) | 2023-11-07 | 2023-11-07 | Method and device for correcting dead pixel of linear array camera |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117641137A (en) |
-
2023
- 2023-11-07 CN CN202311474147.XA patent/CN117641137A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7589770B2 (en) | Dead pixel real-time detection method for image | |
CN109741307B (en) | Stray light detection method, stray light detection device and stray light detection system of camera module | |
CN101299239B (en) | Method and device for acquiring character area image and character recognition system | |
CN109685794B (en) | Camera self-adaptive step length DPC algorithm and device for mobile phone screen defect detection | |
CN101459765B (en) | Method and circuit for correcting dead pixel in image signal | |
CN117232396B (en) | Visual detection system and method for product quality of high-speed production line | |
CN115205317B (en) | Bridge monitoring photoelectric target image light spot center point extraction method | |
CN114757853B (en) | Method and system for acquiring flat field correction function and flat field correction method and system | |
JP2002140693A (en) | Image processing parameter determination device, its method and recording medium with recorded image processing parameter determination program | |
JP2010021858A (en) | Pixel defect correction device | |
JP2008298589A (en) | Device and method for detecting positions | |
JPH08292014A (en) | Measuring method of pattern position and device thereof | |
CN110740314A (en) | Method and system for correcting defective pixel of color line array camera | |
CN110443803A (en) | A kind of printed matter picture quality detection method and device | |
CN114187363A (en) | Method and device for obtaining radial distortion parameter value and mobile terminal | |
CN117641137A (en) | Method and device for correcting dead pixel of linear array camera | |
CN109671081B (en) | Bad cluster statistical method and device based on FPGA lookup table | |
JP4579570B2 (en) | Shading method | |
CN114283170B (en) | Light spot extraction method | |
JP4507533B2 (en) | Method for inspecting streaky irregularities in periodic patterns | |
CN111145674B (en) | Display panel detection method, electronic device and storage medium | |
CN116645274A (en) | Image processing method, device, electronic device, and computer-readable storage medium | |
JP2961140B2 (en) | Image processing method | |
CN113920065A (en) | Imaging quality evaluation method for visual inspection system in industrial field | |
CN114429562B (en) | A method and system for assigning labels to training samples of a neural network |
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 |