Image sensor detection method and image dynamic detection method and correction method
By filtering and judging the number and continuity of the second bright spots of abnormal pixels in the image sensor, distinguishing and correcting dynamic bad points, the abnormal brightness problem caused by dynamic bad points in the image is solved, and accurate identification of positive and negative samples and rapid correction of bad points are achieved.
Patent Information
- Application Number
- CN202510104977.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-01-23
Smart Images

Figure CN119545206B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image detection, and in particular relates to an image sensor detection method and an image dynamic detection method and correction method. Background Art
[0002] There are usually two types of bad pixels in image sensors: static bad pixels and dynamic bad pixels. Static bad pixels have fixed positions and are generally not affected by parameters such as temperature and gain. They can be corrected offline, that is, the bad pixel information is pre-collected and stored inside the camera, and then the fixed-position bad pixels of each frame are corrected. Corresponding to this are dynamic bad pixels, which are affected by the environment such as temperature and gain. Under certain circumstances, they will not behave abnormally, but as the temperature and gain increase, the probability of dynamic bad pixels will also increase. At the same time, they are affected by cosmic rays or CMOS / CCD semiconductor characteristics. Dynamic bad pixels show random distribution characteristics, and their distribution area and time in the image are completely random.
[0003] For some specific detection scenarios, the overall grayscale value of a normal image is very small, such as less than 2DN (8bit), but there may be some areas to be detected that are brighter. There are about 3×3~5×5 areas in the image that are brighter. The purpose is to detect these abnormally bright areas. However, the camera output is affected by noise and dynamic bad pixels at the same time, which makes some areas in the image abnormally bright. Now it is necessary to use certain features in the image to distinguish the normal bright area (positive sample) and the dynamic cluster bad pixel area (negative sample), and correct the negative sample.
[0004] Therefore, in order to solve the above problems, the present invention provides an image sensor detection method and an image dynamic detection method and correction method. Summary of the invention
[0005] The purpose of the present invention is to overcome the above problems existing in the prior art and to provide an image sensor detection method and an image dynamic detection method and correction method.
[0006] In order to achieve the above technical objectives and the above technical effects, the present invention is implemented through the following technical solutions:
[0007] An image sensor detection method, comprising:
[0008] The corresponding abnormal pixel points whose second bright spots in the rectangular array area with any abnormal pixel point in the abnormal cluster point as the center and containing two layers of outer neighborhood single-pixel rectangular rings are less than the number threshold are screened as bad pixels; wherein the abnormal pixel points are confirmed by judging whether the gray value of the corresponding pixel channel is greater than or equal to the abnormal pixel point reference threshold;
[0009] The corresponding abnormal pixel points with less than three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel points that reach a preset number threshold are screened as bad pixels; wherein the three consecutive second bright spots are all in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point.
[0010] Furthermore, by setting a bright spot threshold, it is confirmed that the pixel points whose pixel channel grayscale values are greater than or equal to the bright spot threshold are the second bright spots, so as to obtain the number of the second bright spots by counting.
[0011] Furthermore, determining whether there are three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point includes: selecting any pixel point in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point as the starting point, and determining whether there is a second bright spot in a clockwise or counterclockwise order, and counting the number of consecutive second bright spots.
[0012] Furthermore, the image information to be detected is processed based on FPGA, and calculations are performed in sequence with every five rows of data as a calculation cycle, so as to obtain the detection results of the middle row data.
[0013] Furthermore, when the image information to be detected includes RGB multi-channel data, the bad pixels corresponding to each RGB channel are detected independently.
[0014] The present invention also provides an image dynamic detection method, which uses the above-mentioned image sensor detection method to detect bad pixels in abnormal cluster points, and also includes isolated bad pixel detection:
[0015] The position information of abnormal pixels in the image to be detected is extracted, and statistics are performed on whether there are other abnormal pixels in the outer neighborhood single-pixel rectangular ring area centered on the abnormal pixel to determine whether the abnormal pixel belongs to an abnormal cluster point, thereby screening out isolated abnormal pixels as bad pixels.
[0016] The present invention also provides a method for dynamic image correction, using the above detection method, comprising:
[0017] Screening and obtaining bad pixel information in the image information to be detected to confirm the position information of the bad pixel to be corrected;
[0018] The normal points within the predetermined range of the same row as the bad point to be corrected are obtained, and the grayscale value of the bad point to be corrected is replaced by the grayscale value of the closest normal point.
[0019] Furthermore, if there is no normal point within the predetermined range of the same row as the bad point to be corrected, the gray value of the bad point to be corrected is replaced by the gray value of the closest normal point within the predetermined range of the previous row.
[0020] The present invention also provides an image dynamic correction system, comprising:
[0021] The first bad pixel analysis module is used to extract the position information of abnormal pixels in the image information to be detected, and count whether there are other abnormal pixels in the outer neighborhood single-pixel rectangular ring area centered on the abnormal pixel, so as to determine whether the abnormal pixel belongs to an abnormal cluster point, thereby screening out isolated abnormal pixels as bad pixels; wherein, the abnormal pixel is confirmed by determining whether the gray value of the corresponding pixel channel is greater than or equal to the abnormal pixel reference threshold;
[0022] The second bad pixel analysis module is used to screen out the corresponding abnormal pixel points whose number of second bright spots in the rectangular array area centered on any abnormal pixel point in the abnormal cluster point and containing two layers of outer neighborhood single-pixel rectangular rings is less than the number threshold as bad pixels;
[0023] The third bad pixel analysis module is used to screen the corresponding abnormal pixel points with less than three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel points that reach a preset number threshold as bad pixels.
[0024] The present invention also provides a computer-readable storage medium, comprising a computer program, wherein the computer program implements the above detection method when executed by a processor.
[0025] The beneficial effects of the present invention are:
[0026] (1) The present invention combines the corresponding abnormal pixel points with insufficient number threshold and the judgment method of no continuous second bright spot, effectively utilizes the spatial distribution characteristics of positive samples and negative samples, and combines the spatial distribution statistical information to accurately identify positive samples and negative samples, providing a reliable correction basis for bad pixel correction.
[0027] (2) The present invention combines the detection results of bad pixels and fully utilizes the grayscale values of normal pixels in the same row to achieve rapid correction of the grayscale values of bad pixels.
[0028] (3) The present invention can reasonably judge isolated abnormal pixels and second bright spots that meet the scene requirements by setting abnormal pixel reference thresholds, bright spot thresholds and quantity thresholds in actual scenes. The parameter settings are flexible and the application range is wide.
[0029] (4) The present invention can quickly realize the statistics of consecutive second bright spots through the statistics and judgment of the grayscale values of the neighborhood sequence, and provide an algorithm basis for the recognition of the spatial distribution characteristics of positive samples.
[0030] (5) The present invention can process the image information to be detected based on FPGA, making full use of the parallel processing characteristics of FPGA, greatly improving the data processing speed, and can realize real-time data processing based on row data. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0032] Figure 1 It is a flow chart of the detection method in the present invention;
[0033] Figure 2 It is a schematic diagram of the detection position in the present invention;
[0034] Figure 3 It is a schematic diagram of different positions of detection points in the positive sample area in the present invention;
[0035] Figure 4 This is a schematic diagram of the principle of determining the second bright spot in the present invention;
[0036] Figure 5 It is a flow chart of the FPGA-based detection method in the present invention;
[0037] Figure 6 is a schematic diagram of the correction method in the present invention;
[0038] Figure 7 It is a schematic diagram of the G channel detection principle in the present invention;
[0039] Figure 8 It is a schematic diagram of the R channel detection principle in the present invention;
[0040] Fig. 9 This is a schematic diagram of the principle of determining the second bright spot of the G channel in the present invention;
[0041] Fig.10 This is a schematic diagram of the principle of determining the second bright spot of the R channel in the present invention;
[0042] Fig.11 It is a structural block diagram of the correction system in the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] At present, by distinguishing the normal bright area (positive sample) and the dynamic cluster bad pixel area (negative sample), and comparing the positive and negative sample features, it is found that the positive sample is caused by the bright object, and there are large gray values in the 3×3~5×5 area in the image. Negative samples appear randomly, and the probability of them appearing in the same 3×3~5×5 area is small. The regional distribution of positive samples is also special and not random. In addition, positive samples should have a "peak point" feature. Therefore, in the neighborhood of abnormal pixels, by counting the number of large gray values twice, positive samples and negative samples can be preliminarily distinguished. Example 1
[0045] like Figure 1 As shown, this embodiment first provides an image sensor detection method, which specifically includes the following steps:
[0046] Step 1: Screen the corresponding abnormal pixel points as bad pixels whose second bright spots in the rectangular array area centered on any abnormal pixel point in the abnormal cluster point and containing two layers of outer neighborhood single-pixel rectangular rings are less than the number threshold; wherein the abnormal pixel point is confirmed by judging whether the grayscale value of the corresponding pixel channel is greater than or equal to the abnormal pixel point reference threshold.
[0047] The grayscale mean of the image in the 3×3 domain is counted, and a grayscale threshold parameter param1 is set, that is, the reference threshold of abnormal pixels. Points greater than or equal to the threshold are considered abnormal pixels, and bad pixels must be greater than or equal to the threshold. Positive samples should also contain abnormal pixels.
[0048] Among them, the rectangular array area centered on any abnormal pixel point in the abnormal cluster point and containing two layers of outer neighborhood single-pixel rectangular rings represents a 5×5 area centered on any current abnormal pixel point in the abnormal cluster point.
[0049] As a specific implementation of the present invention, a bright spot threshold is set to confirm that the pixel points whose pixel channel grayscale values are greater than or equal to the bright spot threshold are second bright spots, so as to obtain the number of second bright spots by counting.
[0050] The second bright spot is the bright spot, which is obtained by comparing with the bright spot threshold. An adjustable parameter param2, the bright spot threshold, is set in advance. This parameter is used to distinguish whether a certain pixel value belongs to the second bright spot. It is important to distinguish param2 from parameter param1. Param1 is used to determine whether it is an abnormal pixel, and param2 is used to determine whether it is the second bright spot. An abnormal pixel must be the second bright spot, but the second bright spot is not necessarily an abnormal pixel, because the grayscale value of the brighter area to which the positive sample belongs may also be smaller than param1.
[0051] In order to further determine whether the abnormal pixel points in the abnormal cluster points belong to positive samples or negative samples, a fixed parameter param3, namely the quantity threshold, is introduced and set. According to the characteristic difference between positive and negative samples, it is determined whether the number of the second bright spots reaches the quantity threshold, so as to screen out the corresponding abnormal pixel points that are less than the quantity threshold as bad pixels; wherein, the rectangular array area with the abnormal pixel point in the abnormal cluster point as the center and containing two layers of outer neighborhood single-pixel rectangular rings is a 5×5 area, as follows:
[0052] Take a 5×5 area centered on the detection position (x, y), and count the number of pixels in the area that are greater than or equal to param2 as a. If a < param3, it is considered a bad pixel, and the subsequent pixel replacement strategy is used to replace it, and then the judgment of the pixel point is terminated. This value needs to be adjusted dynamically according to the actual situation. The positive sample shows that the second bright spot exists in the 3x3 area in the image, while the negative sample appears randomly, and the probability of the second bright spot appearing in the same 3x3 area is small. If a >= param3, it is necessary to further judge the 3×3 area centered on the detection position (x, y), as shown in step 2:
[0053] Step 2: Screen the corresponding abnormal pixel points with less than three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point that reaches the preset number threshold as bad pixels. Among them, the three consecutive second bright spots are all in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point.
[0054] According to the result of step one, the distribution of the second bright spots in the adjacent positions of the corresponding abnormal pixel points that reach the preset threshold number is counted, and it is determined whether there are three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point, that is, the eight-connected neighborhood, so as to screen out the corresponding abnormal pixel points with less than three consecutive second bright spots as bad pixels.
[0055] like Figure 3 As shown in the figure, if the pixel point (x, y) belongs to the positive sample area, there should be a continuous area with a larger gray value in its 3×3 area. The dot matrix shadow represents the pixel point (x, y), and the diagonal shadow represents the area that should appear continuously (the diagonal shadow pixel point is the second bright spot, that is, the gray value is greater than or equal to param2).
[0056] Then, if the pixel point (x, y) is at the 4 vertex positions of the positive sample 3×3 area, its distribution should be Figure 3 (a)~(d); if the pixel point (x, y) is at the midpoint of the 4 edges of the 3×3 region of the positive sample, its distribution should be Figure 3 (e)~(h); if the pixel point (x, y) is at the center point of the 3×3 area of the positive sample, its distribution should be Figure 3In either case, there are at least three connected second bright spot pixels.
[0057] Therefore, it is determined whether there are three consecutive second bright spots (i.e. oblique shadow pixels) in the 8-neighborhood of the pixel point (x, y). If so, the pixel point (x, y) is considered to be a positive sample area pixel, otherwise the pixel point (x, y) is a bad pixel and is replaced.
[0058] As a specific implementation of the present invention, judging whether there are three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point includes: selecting any pixel point in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point as the starting point, determining whether there is a second bright spot in a clockwise or counterclockwise order, and counting the number of consecutive second bright spots. Specifically as follows:
[0059] In order to determine whether there are three consecutive second bright spots in the 8-neighborhood of the pixel point (x, y), the following method can be used: a certain neighborhood pixel point can be fixed as the starting point, and the grayscale values of the 8-neighborhood pixels can be regarded as an array in clockwise or counterclockwise order, which is recorded as array. Taking (x+1, y) as the starting point and counterclockwise as an example, the corresponding grayscale value is recorded as I (x+1,y) , then array= [I (x+1,y) ,I (x+1,y-1) ,I (x,y-1) ,I (x-1,y-1) ,I (x-1,y) ,I (x-1,y+1) ,I (x,y+1) ,I (x+1,y+1) ,I (x+1,y) ,I (x+1,y-1) ], note that the array array has 10 elements, of which I (x+1,y) ,I (x+1,y-1) It needs to be repeated at the beginning and end of the array, such as Figure 4 As shown by the arrow. Set a counter b (initial value is 0) and check whether the grayscale value in the array is less than param2. If so, set b=0; otherwise, set b=b+1. When b>=3 exists, stop judging and consider the pixel point (x, y) to be a positive sample area pixel. Otherwise, continue judging until the last element of the array. Example 2
[0060] This embodiment also provides an image dynamic detection method, which uses the above-mentioned image sensor detection method to detect bad pixels in abnormal cluster points, and also includes isolated bad pixel detection:
[0061] The position information of abnormal pixels in the image to be detected is extracted, and statistics are performed on whether there are other abnormal pixels in the outer neighborhood single-pixel rectangular ring area centered on the abnormal pixel to determine whether the abnormal pixel belongs to an abnormal cluster point, thereby screening out isolated abnormal pixels as bad pixels.
[0062] The above-mentioned outer neighborhood single-pixel rectangular ring area represents eight connected neighborhoods centered on the abnormal pixel point. After screening out the isolated abnormal pixel points as bad points, the corresponding grayscale values are replaced by a preset replacement strategy. Cluster points usually refer to a group of pixels that are closely arranged together, and abnormal cluster points are a collection of non-isolated abnormal pixels.
[0063] like Figure 2 As shown, assuming the detection position is (x, y), if the eight-connected neighborhood of the position (such as Figure 2 If there is no other pixel point greater than or equal to param1 in the grid shaded area shown in the figure, the point is considered to be an isolated bad point and is replaced; otherwise, the point is part of an abnormal cluster point and the next step of detection and judgment is carried out.
[0064] Since FPGA has significant advantages in image processing, it can realize highly parallel data processing, thereby greatly improving the speed of image processing. Therefore, for the above steps, the image information to be detected can be processed based on FPGA, and calculations can be performed in sequence with every five rows of data as a calculation cycle, so as to obtain the detection results of the middle row data. The specific process is as follows:
[0065] like Figure 5 As shown in the figure, for 12-bit image data, define the abnormal pixel reference threshold param1, which is an adjustable parameter with a value range of [0, 4095] and a bit width of 12 bits. Define the bright spot threshold param2, which is an adjustable parameter. The value can be set to approximately 1 / 10 to 1 / 5 of param1, with a value range of [0, 1023] and a bit width of 10 bits. Define a quantity threshold param3 = 7 (usually set to a fixed value) to determine the number of pixels greater than or equal to param2 in a 5×5 area, with a value range of [0, 25] and a bit width of 5 bits.
[0066] The entire process only performs counting accumulation and logical judgment operations in the 5×5 area.
[0067] After the camera is reset, the FPGA is in an empty state without any data; this is the starting point;
[0068] For the first two lines of data, add them to the buffer and output them directly;
[0069] Continue to receive the 3rd and 4th lines of data and fill the data into the buffer in sequence;
[0070] FPGA receives the 5th row of data and adds it to the buffer area. Starting from the 5th row of data, FPGA has obtained a 5-row matrix, and based on these 5 rows, it creates a 5x5 processing area for the identification of positive and negative samples and the replacement of bad pixels, and outputs the 3rd row of filtering results.
[0071] After completing the calculation of the current row, move the data of row 1 out of the buffer, and move the data of rows 2, 3, 4, and 5 forward; fill the position of row 5 with the data of the current row, and update the buffer for the calculation of the next row;
[0072] For the last two rows of data, output directly. Example 3
[0073] The second aspect of the present invention further provides a method for dynamic image correction, using the above detection method, comprising:
[0074] Screening and obtaining bad pixel information in the image information to be detected to confirm the position information of the bad pixel to be corrected;
[0075] The normal points within the predetermined range of the same row as the bad point to be corrected are obtained, and the grayscale value of the bad point to be corrected is replaced by the grayscale value of the closest normal point.
[0076] If a pixel is determined to be a bad pixel, it will be replaced with adjacent pixels in the same row. Figure 6 As shown in the figure, the dot matrix shadow points indicate the current bad pixel position to be replaced, the square shadow points indicate normal pixels, the oblique line shadow points indicate bad pixels adjacent to the current point, and the white points are ignored. The grayscale value of the dot matrix shadow bad pixel will be replaced with the grayscale value of the nearest square shadow normal point. If the pixels of the left 1, left 2, right 1, and right 2 of the dot matrix shadow bad pixel are all bad pixels, no operation will be performed.
[0077] If the above conditions are not met, that is, there are no normal points within the predetermined range of the same row of the bad point to be corrected, the gray value of the bad point to be corrected is replaced with the gray value of the closest normal point within the predetermined range of the previous row. If the same row does not meet the conditions, normal pixels between adjacent rows are searched, and the pixels in the same column of the previous row are used first. If the pixels in the same column of the previous row are also bad pixels, the adjacent left 1, left 2, right 1, and right 2 pixels are used.
[0078] The image information to be detected in the above embodiments 1-3 may come from either a black and white camera or a color camera. When the image information to be detected includes RGB multi-channel data, the bad pixels corresponding to each RGB channel are detected independently. The detection method includes:
[0079] The image information to be detected formed by each RGB channel is obtained respectively, the position information of the abnormal pixel points of each RGB channel is extracted, and the outer neighborhood single-pixel rectangular ring area centered on the abnormal pixel points of each RGB channel is counted to determine whether there are other abnormal pixels, so as to determine whether the abnormal pixel points belong to abnormal cluster points, thereby screening out isolated abnormal pixels as bad pixels; wherein, the abnormal pixel points are confirmed by determining whether the grayscale value of the corresponding pixel channel is greater than or equal to the abnormal pixel reference threshold, and the outer neighborhood single-pixel rectangular ring area is composed of the eight channels closest to the abnormal pixel points in the same channel.
[0080] The number of second bright spots in the rectangular array area centered on the abnormal pixel points in the abnormal cluster points of each RGB channel and containing two layers of outer neighborhood single-pixel rectangular rings is counted to determine whether the number threshold is reached, so as to screen out the corresponding abnormal pixel points that are less than the number threshold as bad pixels; the rectangular array area consists of the sixteen channels in the same channel that are closest to the outer neighborhood single-pixel rectangular ring area.
[0081] The distribution of the second bright spots in the adjacent positions of the corresponding abnormal pixel points that reach the preset number threshold of each RGB channel is counted, and it is determined whether there are three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point, so as to screen out the corresponding abnormal pixel points with less than three consecutive second bright spots as bad pixels; among which, the three consecutive second bright spots are all in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point.
[0082] The following describes in detail the detection method of the image information to be detected from the color camera through Examples 4-6: Example 4
[0083] As the fourth embodiment of the present invention, when the image information to be detected is obtained by a true color camera, that is, the RGB data of the corresponding positions can be directly obtained at all pixel positions, at this time, the above-mentioned detection method can be used to perform bad pixel detection on each RGB channel of all pixel positions respectively. Example 5
[0084] As the fifth embodiment of the present invention, when the image information to be detected is obtained by a pseudo-color camera, that is, each pixel position can only directly obtain the R / G / B data of the corresponding position, and other channel data need to be obtained through interpolation processing. First, the RGB data of all pixel positions are obtained through interpolation processing, and then the above-mentioned detection method is used to perform bad pixel detection on each RGB channel of all pixel positions.
[0085] From the algorithm point of view, interpolation processing is divided into two aspects: interpolation and edge determination. For the Bayer format, the estimation of the G / B channel needs to be completed for the R pixel position, the estimation of the R / B channel needs to be completed for the G pixel position, and the estimation of the R / G channel needs to be completed for the B pixel position. Regardless of the Bayer format, the sampling frequency of G is twice that of R / B, so the estimation of the G channel at the R / B position can be completed first based on the characteristic that G has more information.
[0086] Generally speaking, it is divided into three stages: (1) complete the estimation and edge calculation of the G channel at the R / B position (depending on the edge result); (2) complete the estimation of the R / B channel at the G position (not dependent on the edge result); (3) complete the estimation of the B / R channel at the R / B position (depending on the edge result). These three stages are completed in sequence, and the calculation of the latter stage needs to depend on the result of the previous stage. Example 6
[0087] like Figure 7-10 As shown, as the sixth embodiment of the present invention, when the image information to be detected is obtained by a pseudo-color camera, different from the fifth embodiment, this embodiment directly uses the R / G / B data already obtained for each pixel point, directly performs bad pixel detection on the R / G / B channel data of all pixel positions using the above detection method, and then performs interpolation processing on the corrected image data.
[0088] It can be seen from Example 5 that the basis for bad pixel detection of each RGB channel is to first obtain RGB data of all pixel positions through interpolation processing, and the RGB valuation obtained by interpolation is different from the actual value. In particular, the existence of random bad pixels may affect the calculation result of RGB valuation. Therefore, Example 6 performs interpolation processing after bad pixel detection and correction, which greatly improves the accuracy of data processing.
[0089] Considering the different positional relationships of the RGB channels in the Bayer format, the detection process of each channel is described in detail below:
[0090] When performing bad pixel detection on the G channel:
[0091] like Figure 7As shown, for the image information to be detected formed by the G channel, the position information of the abnormal pixel points of the G channel is extracted, and the statistics are performed on whether there are other abnormal pixel points in the outer neighborhood single-pixel rectangular ring area centered on the abnormal pixel point of the G channel, so as to determine whether the abnormal pixel point belongs to an abnormal cluster point, thereby screening out isolated abnormal pixel points as bad pixels; wherein, the abnormal pixel point is confirmed by determining whether the grayscale value of the corresponding pixel channel is greater than or equal to the abnormal pixel point reference threshold, and the outer neighborhood single-pixel rectangular ring area is composed of the eight G channels closest to the abnormal pixel point in the same G channel, and the adjacent G channels are connected by the vertex angles, and the center lines of the eight G channels form a rectangle.
[0092] The number of second bright spots in the 5×5 area centered on the abnormal pixel point in the abnormal cluster point of the G channel is counted to determine whether the number threshold is reached, so as to screen out the corresponding abnormal pixel points that are less than the number threshold as bad pixels; the rectangular array area is composed of 5×5 areas in the same G channel, and adjacent G channels are connected by vertex angles.
[0093] Count the distribution of second bright spots in the adjacent positions of the corresponding abnormal pixel points that reach the preset number threshold of the G channel, and determine whether there are three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point, so as to screen out the corresponding abnormal pixel points with less than three consecutive second bright spots as bad pixels; among which, the three consecutive second bright spots are all in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point.
[0094] When performing bad pixel detection on the R channel:
[0095] like Figure 8 As shown, for the image information to be detected formed by the R channel, the position information of the abnormal pixel points of the R channel is extracted, and the statistics are performed on whether there are other abnormal pixel points in the outer neighborhood single-pixel rectangular ring area centered on the abnormal pixel point of the R channel, so as to determine whether the abnormal pixel point belongs to an abnormal cluster point, thereby screening out isolated abnormal pixel points as bad pixels; wherein, the abnormal pixel point is confirmed by determining whether the grayscale value of the corresponding pixel channel is greater than or equal to the abnormal pixel point reference threshold, and the outer neighborhood single-pixel rectangular ring area is composed of the eight R channels closest to the abnormal pixel point in the same R channel, and there is a G channel between adjacent R channels, and the centers of the eight R channels are connected to form a square.
[0096] The number of second bright spots in the 5×5 area centered on the abnormal pixel in the abnormal cluster of the R channel is counted to determine whether the number threshold is reached, so as to screen out the corresponding abnormal pixel points that are less than the number threshold as bad pixels; the rectangular array area is composed of a 5×5 area in the same R channel, and there is a G channel between adjacent R channels.
[0097] Count the distribution of second bright spots in the adjacent positions of the corresponding abnormal pixel points that reach the preset number threshold of the R channel, and determine whether there are three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point, so as to screen out the corresponding abnormal pixel points with less than three consecutive second bright spots as bad pixels; among which, the three consecutive second bright spots are all in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point.
[0098] The bad pixel detection for the B channel is the same as that for the R channel.
[0099] The specific method for judging whether there are three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area in the G channel is as follows:
[0100] like Fig. 9 As shown in the figure, in order to determine whether there are three consecutive second bright spots in the 8-neighborhood of the G channel pixel point (x, y), the following method can be used: fix a certain neighborhood pixel point as the starting point, and treat the grayscale values of the 8-neighborhood pixels as an array in clockwise or counterclockwise order, recorded as array. Taking (x+1, y-1) as the starting point and counterclockwise as an example, the corresponding grayscale value is recorded as G (x+1,y-1) , then array = [G (x+1,y-1) , G (x,y-2) , G (x-1,y-1) , G (x-2,y) , G (x-1,y+1) , G (x,y+2) , G (x+1,y+1) , G (x+2,y) , G (x+1,y-1) , G (x,y-2) ], note that the array has 10 elements, of which G (x+1,y-1) , G (x,y-2) It needs to be repeated at the beginning and end of the array, such as Fig. 9 As shown by the arrow. Set a counter b (initial value is 0) and check whether the grayscale value in the array is less than param2. If so, set b=0; otherwise, set b=b+1. When b>=3 exists, stop judging and consider the pixel point (x, y) to be a positive sample area pixel. Otherwise, continue judging until the last element of the array.
[0101] The specific method for judging whether there are three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area in the G channel is as follows:
[0102] like Fig.10As shown in the figure, in order to determine whether there are three consecutive second bright spots in the 8-neighborhood of the G channel pixel point (x, y), the following method can be used: fix a certain neighborhood pixel point as the starting point, and treat the grayscale values of the 8-neighborhood pixels as an array in clockwise or counterclockwise order, recorded as array. Taking (x+2, y) as the starting point and counterclockwise as an example, the corresponding grayscale value is recorded as G (x+2,y) , then array = [G (x+2,y) , G (x+2,y-2) , G (x,y-2) , G (x-2,y-2) , G (x-2,y) , G (x-2,y+2) , G (x,y+2) , G (x+2,y+2) , G (x+2,y) , G (x+2,y-2) ], note that the array has 10 elements, of which G (x+2,y) , G (x+2,y-2) It needs to be repeated at the beginning and end of the array, such as Fig.10 As shown by the arrow. Set a counter b (initial value is 0) and check whether the grayscale value in the array is less than param2. If so, set b=0; otherwise, set b=b+1. When b>=3 exists, stop judging and consider the pixel point (x, y) to be a positive sample area pixel. Otherwise, continue judging until the last element of the array.
[0103] The determination of whether there are three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area in the B channel is the same as that in the R channel. Example 7
[0104] like Fig.11 As shown, the third aspect of the present invention further provides an image dynamic correction system, comprising:
[0105] The first bad pixel analysis module is used to extract the position information of abnormal pixels in the image information to be detected, and count whether there are other abnormal pixels in the outer neighborhood single-pixel rectangular ring area centered on the abnormal pixel, so as to determine whether the abnormal pixel belongs to an abnormal cluster point, thereby screening out isolated abnormal pixels as bad pixels; wherein, the abnormal pixel is confirmed by determining whether the grayscale value of the corresponding pixel channel is greater than or equal to the abnormal pixel reference threshold.
[0106] The second bad pixel analysis module is used to screen out the corresponding abnormal pixel points whose number of second bright spots in the rectangular array area centered on any abnormal pixel point in the abnormal cluster point and containing two layers of outer neighborhood single-pixel rectangular rings is less than the number threshold as bad pixels.
[0107] The third bad pixel analysis module is used to screen the corresponding abnormal pixel points with less than three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel points that reach a preset number threshold as bad pixels.
[0108] The present invention also provides a real-time detection system for random cluster bad pixels. For the abnormal points or abnormal cluster points that have been clearly identified as non-isolated in the prior art, the bad pixel detection can be directly performed through the second bad pixel analysis module and the third bad pixel analysis module.
[0109] The specific detection methods implemented between the modules of the correction system can refer to the specific steps in the above embodiments 1-3. Example 8
[0110] A fourth aspect of the present invention further provides a computer-readable storage medium, comprising a computer program, wherein the computer program implements the above-mentioned detection method when executed by a processor.
[0111] In practical applications, the computer-readable storage medium may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.
[0112] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0113] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0114] Computer program code for performing the operation of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0115] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0116] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.
Claims
1. An image sensor detection method, characterized in that: include: The corresponding abnormal pixel points whose second bright spots in the rectangular array area with any abnormal pixel point in the abnormal cluster point as the center and containing two layers of outer neighborhood single-pixel rectangular rings are less than the number threshold are screened as bad pixels; wherein the abnormal pixel points are confirmed by judging whether the gray value of the corresponding pixel channel is greater than or equal to the abnormal pixel point reference threshold; The corresponding abnormal pixel points with less than three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel points that reach a preset number threshold are screened as bad pixels; wherein the three consecutive second bright spots are all in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point.
2. The image sensor detection method according to claim 1, characterized in that: By setting a bright spot threshold, it is confirmed that the pixel points whose pixel channel grayscale values are greater than or equal to the bright spot threshold are second bright spots, so as to obtain the number of second bright spots by counting.
3. The image sensor detection method according to claim 2, characterized in that: Determining whether there are three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point includes: selecting any pixel point in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel point as the starting point, and determining whether there is a second bright spot in a clockwise or counterclockwise order, and counting the number of consecutive second bright spots.
4. An image sensor detection method according to any one of claims 1 to 3, characterized in that: The image information to be detected is processed based on FPGA, and calculations are performed in sequence with every five rows of data as a calculation cycle, so as to obtain the detection results of the middle row data.
5. An image sensor detection method according to any one of claims 1 to 3, characterized in that: When the image information to be detected includes RGB multi-channel data, the bad pixels corresponding to each RGB channel are detected independently.
6. A method for detecting image dynamics, characterized in that: Using an image sensor detection method according to any one of claims 1 to 5, bad pixels in abnormal cluster points are detected, and isolated bad pixel detection is also included: The position information of abnormal pixels in the image to be detected is extracted, and statistics are performed on whether there are other abnormal pixels in the outer neighborhood single-pixel rectangular ring area centered on the abnormal pixel to determine whether the abnormal pixel belongs to an abnormal cluster point, thereby screening out isolated abnormal pixels as bad pixels.
7. A method for dynamic image correction, using the detection method according to claim 6, characterized in that: include: Screening and obtaining bad pixel information in the image information to be detected to confirm the position information of the bad pixel to be corrected; The normal points within the predetermined range of the same row as the bad point to be corrected are obtained, and the grayscale value of the bad point to be corrected is replaced by the grayscale value of the closest normal point.
8. The method for dynamic image correction according to claim 7, characterized in that: If there is no normal point within the predetermined range of the same row as the bad point to be corrected, the gray value of the bad point to be corrected is replaced by the gray value of the closest normal point within the predetermined range of the previous row.
9. An image dynamic correction system, characterized in that: include: The first bad pixel analysis module is used to extract the position information of abnormal pixels in the image information to be detected, and count whether there are other abnormal pixels in the outer neighborhood single-pixel rectangular ring area centered on the abnormal pixel, so as to determine whether the abnormal pixel belongs to an abnormal cluster point, thereby screening out isolated abnormal pixels as bad pixels; wherein, the abnormal pixel is confirmed by determining whether the gray value of the corresponding pixel channel is greater than or equal to the abnormal pixel reference threshold; The second bad pixel analysis module is used to screen out the corresponding abnormal pixel points whose number of second bright spots in the rectangular array area centered on any abnormal pixel point in the abnormal cluster point and containing two layers of outer neighborhood single-pixel rectangular rings is less than the number threshold as bad pixels; The third bad pixel analysis module is used to screen the corresponding abnormal pixel points with less than three consecutive second bright spots in the outer neighborhood single-pixel rectangular ring area centered on the corresponding abnormal pixel points that reach a preset number threshold as bad pixels.
10. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed by a processor, the detection method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Information processing method and electronic equipment
CN105450909A