The present invention relates to an image defect identification method and an image analysis device, and more particularly, to an image defect identification method and an image analysis device capable of automatically finding out dirty or damaged areas in the captured image.
When the camera is manufactured or used, dust may accidentally fall into the casing and stay on the lens or the optical sensor, which results in dark spots on the captured image and reduces the image quality. Conventional solution may manually check the captured image to visually identify whether the dark spots are existed in the captured image, which is extremely labor-intensive. If the lens or the optical sensor is polluted by dust, there has no automatic identification technology that can accurately and rapidly find out the image defect. Besides, the conventional image dirt identification technology divides the captured image into grids, and computes the average brightness of each grid, and then compares the average brightness of each grid with the average brightness of adjacent grids. If the average brightness of one grid is lower than the average brightness of adjacent grids, the area where the foresaid grid is located is considered in dirty. However, due to configuration of the optical elements, brightness of the edge area or the corner area of the captured image is low, which is often misjudged in dirty; the captured image needs to be further divide into smaller grids for small dirt identification, but the smaller grids are easy to be affected by the image correction algorithm and cause a false judgment. Therefore, design of an image analysis technology capable of automatically finding out dirty or damaged areas on the image is an important issue in the surveillance equipment industry.
The present invention provides an image defect identification method and an image analysis device capable of automatically finding out dirty or damaged areas in the captured image for solving above drawbacks.
According to the claimed invention, an image defect identification method is applied to an image analysis device with an image receiver and an operation processor. The image defect identification method includes dividing a detection image acquired by the image receiver into a plurality of pixel groups, transforming one of the plurality of pixel groups into a distribution curve, comparing the distribution curve with a reference curve, and determining an area of the detection image conforming to a specific section of the distribution curve has defect when a difference between the specific section of the distribution curve and a related section of the reference curve is greater than a predefined threshold.
According to the claimed invention, an image analysis device includes an image receiver and an operation processor. The image receiver is adapted to acquire a detection image. The operation processor is electrically connected with the image receiver in a wire manner or in a wireless manner, and adapted to divide the detection image into a plurality of pixel groups, transform one of the plurality of pixel groups into a distribution curve, compare the distribution curve with a reference curve, and determine an area of the detection image conforming to a specific section of the distribution curve has defect when a difference between the specific section of the distribution curve and a related section of the reference curve is greater than a predefined threshold.
The image defect identification method and the related image analysis device of the present invention can sequentially scan all rows or all columns of pixels on the detection image, and compute the distribution curve and the reference curve acquired from the transformation of the filter matrix or the analysis of the intensity distribution applied to each row or each column of pixels for comparison. The reference curve and the distribution curve may be acquired from the same detection image, or the reference curve may be acquired from another reference image rather than the detection image; however, the distribution curve and the reference curve can be preferably acquired from the same image. The image defect (such as the dark spot) may change intensity of related pixels on the detection image, which results in the unsmooth curve, so that two filter matrices of different sizes that both have a curve smoothing effect can be utilized to generate two curves which has different degrees of smoothness in the unsmooth area. The section difference between the distribution curve and the reference curve can be compared to analyze a range and a degree of the defect of the detection image, so as to effectively determine whether the lens or the image sensor of the camera is a defective product.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
The image analysis device 10 can be a camera communicated with the personal computer, or an external apparatus communicated with the camera; the camera can be replaced by any apparatus with an image capturing function. The lens or the image sensor of the camera may be dirty due to long-term use or environmental pollution, or some sensing units of the image sensor may be damaged due to accident. The image analysis device 10 can analyze image content of the detection image provided by the camera to automatically and rapidly find out the image defect. The image defect may be dust stayed on the lens or the image sensor, or abrasion of the lens damaged by hard material, or invalid of the sensing units of the image sensor. Any image defect that can generate an obvious dark spot on the detection image can belong to an application scope of the image defect identification method of the present invention.
Please refer to
Then, step S104 and step S106 can be executed that the operation processor 14 can transform each of the plurality of pixel groups into a distribution curve Cd by each pixel row or each pixel column, and the same matrix model but different matrix parameters can be utilized to transform each of the pixel groups into a reference curve Cr. In the first embodiment, the operation processor 14 can utilize the Gaussian filter matrix, the mean filter matrix, the median filter matrix, the bilateral filter matrix, or any applicable filter matrix to generate the distribution curve Cd and the reference curve Cr. As shown in
Then, step S108 can be executed to compare the distribution curve Cd with the reference curve Cr. If a difference between a specific section of the distribution curve Cd and a related section of the reference curve Cr is smaller than or equal to a predefined threshold, such as the first section Z1 and the second section Z2, the distribution curve Cd and the reference curve Cr may have a high degree of overlapping, and step S110 can be executed to determine an area of the detection image Id conforming to the specific section has no image defect. If the difference between the specific section of the distribution curve Cd and the related section of the reference curve Cr is greater than the predefined threshold, such as the third section Z3 shown in
In the first embodiment, the image defect identification method can utilize the same matrix model but different matrix parameters to transform each of the pixel groups into the distribution curve Cd and the reference curve Cr. If the difference between the specific section of the distribution curve Cd and the related section of the reference curve Cr is smaller than or equal to the predefined threshold, step S114 can be optionally executed after step S110 to generate the distribution curve Cd′ via the filter matrix with other transforming parameters, and further to compare the distribution curve Cd′ with the reference curve Cr for determining whether the difference between the specific sections of two curves is greater than, smaller than or equal to the predefined threshold, so as to verify whether the area of the detection image Id conforming to the foresaid section has the image defect. In the present invention, the filter matrix applied to the distribution curve Cd′ can preferably have the size greater than the size of the filter matrix applied to the reference curve Cr, and smaller than the size of the filter matrix applied to the distribution curve Cd; an actual application of size difference between the distribution curve and the reference curve is not limited to the above-mentioned embodiment and depends on the design demand.
In the first embodiment, the distribution curve Cd and the reference curve Cr can be set from the same detection image Id. The present invention can compute a mean difference between all pixels of the distribution curve Cd and the reference curve Cr of each pixel group of the detection image Id, and compute a pixel difference between one pixel of the distribution curve Cd and a corresponding pixel of the reference curve Cr, and further compute a ratio of the foresaid mean difference to the foresaid pixel difference for deciding the predefined threshold; for example, the foresaid mean difference can be denominator, and the foresaid pixel difference can be numerator, and the ratio computed by one or some pixels that exceeds the predefined threshold can be defined as dirt (which means the image defect). In addition, the predefined threshold may be optionally set as the mean difference between all pixels of the distribution curve Cd and the reference curve Cr of each pixel group of the detection image Id; definition of the predefined threshold can depend on the design demand. In other possible embodiment, the reference curve Cr can be parameter distribution variation of each pixel group of a reference image. The reference image can be an image frame captured by the camera in the uniform illumination field when being just shipped from the factory and has no image defect; in this embodiment, the predefined threshold can be set as the mean difference between all pixels of the detection image Id and the reference image. That is to say, the reference curve Cr can be optionally set from the same detection image Id as the distribution curve Cd, or set from the reference image that has a different source than the distribution curve Cd; application of the reference curve Cr can depend on the design demand.
Please refer to
Please refer to
As shown in
As shown in
In conclusion, the image defect identification method and the related image analysis device of the present invention can sequentially scan all rows or all columns of pixels on the detection image, and compute the distribution curve and the reference curve acquired from the transformation of the filter matrix or the analysis of the intensity distribution applied to each row or each column of pixels for comparison. The reference curve and the distribution curve may be acquired from the same detection image, or the reference curve may be acquired from another reference image rather than the detection image; however, the distribution curve and the reference curve can be preferably acquired from the same image. The image defect (such as the dark spot) may change intensity of related pixels on the detection image, which results in the unsmooth curve, so that two filter matrices of different sizes that both have a curve smoothing effect can be utilized to generate two curves which has different degrees of smoothness in the unsmooth area. The section difference between the distribution curve and the reference curve can be compared to analyze a range and a degree of the defect of the detection image, so as to effectively determine whether the lens or the image sensor of the camera is a defective product.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
111123682 | Jun 2022 | TW | national |