A kind of defect pixel detecting method
Technical field
The present invention relates to digital image processing field, relate in particular to, the defect pixel that exists in a kind of digital picture to imageing sensor output carries out the method for detection of dynamic.
Background technology
The array that sensor devices in the digital image input device is made up of a lot of interconnected photosensitive unit, it is converted to the signal of telecommunication with light signal.As a rule, these sensor devices are also not all roses, have some defective photosensitive units and exist.Therefore, may comprise some improper pixels in its output image.
For cost of manufacture being controlled in the acceptable scope, allowing some defect pixels on these optical pickocffs exists, but transducer manufacturer must provide defect pixel before transducer is sold information so just need not carried out the detection of defect pixel to camera manufacturer in follow-up use.Current the most frequently used way is, directly when sensor devices dispatches from the factory, the position such as the coordinate of detected defect pixel is stored in the programmable nonvolatile memory, for example a ROM (read-only memory) or EEROM (electrically erasable read-only memory), after image is hunted down, extracts those pixels and carry out some compensation deals in later stage according to these positional informations again.
The problem of this method is, all will carry out the test of defect pixel when each sensor devices dispatches from the factory, and has greatly improved the cost of sensor devices; And, As time goes on, in use may also can cause new defect pixel because of reasons such as electronic original part are aging, but be not detected and store when dispatching from the factory because of it, so can not be compensated after image is hunted down yet, just can not compensate this pixel, to such an extent as to cause image quality decrease.
The processing method of another kind of defect pixel is, in the process of using, image is carried out real-time detection of dynamic, when finding the defectiveness pixel, it is being compensated, but in traditional defect pixel dynamic detection technology, often only come pixel is judged, so may cause too much erroneous judgement according to the picture quality in the single two field picture, be about to pixel and judged into defect pixel, or missed bad defect pixel.Cause too much pixel to be compensated like this, and that compensation process directly brings is image blurring, causes decrease in image quality.
The existence of these defectives makes said apparatus or method can not reach gratifying result of use in practical operation, so new defect pixel detects solution by demand.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of defect pixel detecting method, improves the accuracy of detection effectively, reduces the appearance of erroneous judgement situation.
For achieving the above object, technical scheme of the present invention specifically is achieved in that
A kind of defect pixel detecting method, its characteristics are, comprising:
Set up the ensemble of communication of a defect pixel;
Set up the rule judging defect pixel and upgrade above-mentioned set;
In use detected two field picture is detected and come above-mentioned defective pixel information set to upgrade according to described rule.
Further, judge whether a pixel is that defect pixel is realized by the following method:
If the value of current pixel is P
M, n, here m represents line number, and n refers to columns, selects following pixel as the related pixel point point of judging current pixel: P
M-2, n+2, P
M+2, n+2, P
M-2, n-2, P
M+2, n-2, P
M-2, n, P
M+2, n, P
M, n-2, P
M, n+2
Calculate the difference value of current pixel point and above-mentioned reference point;
If the minimum difference value judges then that greater than the threshold value of defined in advance this current pixel is a defect pixel.
Further, comprise in the following content one or more in the set of described defective pixel information at least: the positional information of each defect pixel point, the confidence level of each defect pixel point, each defect pixel point have and how long do not have detected and report the record of coming out;
Further, describedly carry out maintenance work and comprise in the following content one or more at least: new defect pixel point is added to the cumulative information of from set, removing, upgrade each pixel in the set in the set, with good pixel falling into the Pixel Information set;
Further, the cumulative information of described each pixel comprises one or more in the following content at least: the confidence level of each defect pixel point, each defect pixel point have how long there is not record detected and that report is come out;
Further, the rule that pixel in the described set is upgraded realizes by following process:
If this defect pixel point among set, does not then add its coordinate information among the set to, and its confidence level and activity time not are set;
If this defect pixel point among set, then corresponding its confidence level of increase and reduce its not value of activity time.
Further, the rule that pixel in the described set is upgraded realizes by following process: if the not activity time of certain point, judge then that it has been pixel and it is removed greater than preset value T among set.
Further, the rule that pixel in the described set is upgraded realizes by following process:
If filled the defect pixel point among the set, come among the set and still have new defect pixel point to add to, among then regulation will be gathered not activity time defect pixel point at most pick out and remove; If there is the not activity time of a plurality of defect pixel points all identical and all be at most, defect pixel point that then will wherein confidence level is minimum picks out and removes.
Further, the rule that pixel in the described set is upgraded realizes by following process: the not activity time value of each the defect pixel point among all will gathering after each the detection adds 1, if or the some pixels in the set are not repeated to detect, then with its not the activity time value add 1;
Further, can the quantity of maximum open ended defect pixel points in the described set be limited;
Further, the quantity of described maximum open ended defect pixel points is 32;
Further, the quantity of described maximum open ended defect pixel points is 64;
Further, stipulate the frequency that described pair set upgrades, that is, can stipulate to upgrade once every certain frame number ability pair set.
As seen from the above technical solution, the invention has the advantages that, the present invention is directed in traditional defect pixel dynamic detection technology, the method of only judging according to the pixel in the single two field picture and detecting defect pixel is improved, design has also been introduced relevant historical information as reference, thereby improved the accuracy that detects greatly, reduced the occurrence probability of good pixel as erroneous judgement situations such as defect pixels.
Description of drawings
Fig. 1 is the schematic diagram of the block of pixels of 5x5 described in the embodiment of the invention.
Embodiment
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in more detail.
Main design philosophy of the present invention is the information by utilizing the accumulation of repeated detection picture frame to obtain, dynamically new detected defect pixel point adds in the set of defect pixel point, and from the set of defect pixel point, remove good pixel, reach good detection and compensation effect.
At first, we advise the set of a defect pixel, adopt specific rule to upgrade the set of defect pixel point simultaneously, comprise the cumulative information etc. that new defect pixel point is added in the defect pixel point set, good pixel is removed and upgrades to each point in the set from set in the present embodiment, certainly, we can also establish the condition of pushing up other, and this does not break away from thought of the present invention, and we utilize the content of a two field picture to detect possible defect pixel point then; Each defect pixel point comprises following message: the x of this defect pixel point, y coordinate; The confidence level of defect pixel point; This defect pixel point has how long there is not record detected and that report is come out.
As shown in Figure 1, be the schematic diagram of a 5x5 block of pixels, suppose that P2 is a current pixel point, ABS represents " taking absolute value ", Min represents " getting minimum value ", then calculates:
diff02=ABS(P2-P0);diff12=ABS(P2-P1);diff32=ABS(P2-P3);
diff42=ABS(P2-P4);diff52=ABS(P2-P5);diff62=ABS(P2-P6);
diff72=ABS(P2-P7);diff82=ABS(P2-P8);
minDiff=min(diff02,diff12,diff32,diff42,diff52,diff62,diff72,diff82);
If minDiff is greater than threshold value Threshold given in advance, then, export the x of P2, the y coordinate because it not and any one connection in its 8 adjoint point, does not judge that it may be the defect pixel point.
We can set and hold N defect pixel point in the set at most, such as 64; Because, can avoid obtaining too many " vacation " defect pixel point by selecting a suitable N value." vacation " defect pixel is put misjudged situation and often might be occurred; The N value is too small, can not hold all " very " defect pixel points down again.Typical N value can obtain by sensor devices manufacturer.
After a two field picture was detected, we began to consider the renewal to the defect pixel set.
Increasing new defect pixel puts in the set:
For each new detected defect pixel point, if this defect pixel point the set among, then can upgrade its confidence level, and the activity time does not subtract 1 with it by following formula:
New confidence level=old confidence level * α+minDiff* (1-α), α=0.9.
If this defect pixel point not among set, then adds it among set to, and its confidence level is made as minDiff as yet, the activity time is not made as-1 with it simultaneously.
From set, remove good pixel:
If the not activity time of certain point greater than certain preset value T, then removes it among set; By selecting a suitable T value, can avoid too frequent removal and add operation.
Upgrade the cumulative information of each point:
The not activity time value of each the defect pixel point among all will gather after each the detection adds 1, if or the some pixels in gathering be not repeated detection, then with its not the activity time value add 1.
When set has been expired:
In some cases, filled the defect pixel point among the set, and still had new defect pixel point will add among the set.At this moment, from set, remove an original defect pixel point, add this new defect pixel point.For this reason, among regulation will be gathered not activity time defect pixel point at most pick out and remove.If there is the not activity time of a plurality of defect pixel points all identical and all be at most, defect pixel point that then will wherein confidence level is minimum picks out and removes.Then, newer defect pixel point is added among the set.
Consider because the adjacent a few two field picture contents in front and back are generally all more similar, so that reduce the frequency that upgrades set, just can stipulate to upgrade once every the K frame.
Suppose that under certain conditions the defect pixel point of " very " is removed, and influences also not too serious from set.For example, certain defect pixel point shows as one and continues highlighted red pixel point, and its peripheral region is a safflower just, in this case this defect pixel point is removed from set, and its harmfulness is also little.As long as scenery changes, it will be detected immediately again, and goes among adding set within the K frame delay.
Suppose that under certain conditions the defect pixel point of " vacation " is added in the set and goes, it can be removed among set within the T*K frame delay along with the variation of scenery.
Should be understood that; the above only is a preferred implementation of the present invention, for those skilled in the art, and under the prerequisite that does not break away from the principle of the invention; can also make some improvement and variation, these improvement and variation also should be considered as protection scope of the present invention.