Image processing apparatus and method
Technical field
The present invention relates to image processing field, relate in particular to image processing apparatus and the method for bad point detection.
Technical background
In image processing process, run into the problem that bad point detects through regular meeting.In general, the generation of bad point all is that the corresponding photosensitive pixel in the imageing sensor is out of joint, such as when an imageing sensor generates image, no matter the external environment condition value that how to change some pixel in the image of generation always remains unchanged, this just shows that the corresponding photosensitive pixel of described imageing sensor is bad point (dead pixel), and pixel corresponding in the image is also referred to as bad point.Also have in addition some bad points more hidden, though that be exactly its pixel value along with environmental evolution its size of conversion because the problem of the photosensitive pixel of its imageing sensor itself makes its pixel value may be slightly bigger or slightly little than standard value.These bad points are detected as bad point owing to its influence than conference under situation about having, and not quite and not can be detected as bad point owing to its influence in some cases.
Dead pixel detection method generally is that each pixel is compared with pixel on every side, and the difference of its value is then thought this pixel bad point greater than a bad point threshold value (dpd_threshold).After bad point detection, follow-uply also need to carry out other processing, wherein just comprise the processing that image is gained and amplifies, the gain amplification here is a step in the automatic exposure process, after finishing, each automatic exposure all needs to generate a time for exposure parameter and digital gain parameter, wherein with the automatic exposure parameter value imageing sensor is exposed, with the digital gain parameter whole the image that generates carried out digital gain and amplify.Carrying out after the gain process, originally is not the pixel of bad point in the image, may just become the bad point that influences picture quality.
And in the image handling process, bad point detection is front, multiply by digital gain after, and the value of bad point threshold value (dpd_threshold) is forever constant.Like this when detecting bad point, the bad point that those are slight, owing to be not more than the bad point threshold value with the difference of surrounding pixel point and do not detect, if this moment, the brightness of image did not need multiply by digital gain (digital gain) when being digital gain=1, these slight bad points are difficult for being discovered.If but be in a darker environment this moment, and image will multiply by digital gain and improve brightness, and this moment, these slight bad points and the difference between the surrounding pixel point will be strengthened, and will see that obvious bad point is arranged on the screen.
Summary of the invention
In view of this, one object of the present invention is to provide a kind of image processing apparatus, and they can adaptive all bad points that detect.
Another object of the present invention is to provide a kind of image processing method, and they can adaptive all bad points that detect.
In order to achieve the above object, the image processing apparatus that provides according to an aspect of the present invention, it comprises that bad point detects module, compensating bad point module, digital gain adjusting module and digital gain module.Described digital gain adjusting module is used for determining the value of digital gain and sending it to digital gain module and the bad point detection module.Described bad point detection module is used for ratio with threshold constant and described digital gain value as the bad point detection threshold value, and according to surrounding pixel point and bad point detection threshold value each pixel is carried out bad point detection.Described compensating bad point module is used for according to the surrounding pixel point pixel that is identified as bad point being carried out compensating bad point.Described digital gain module, after carrying out bad point detection according to described digital gain value to the amplification that gains of each pixel.
Further, when coming the remarked pixel value with 0~255 number range, the span of threshold constant is [28,35].
Further, described threshold constant is 32.
Further, after each automatic exposure program locking, digital gain adjusting module all can redefine a digital gain value.
Further, the span of described digital gain is [1,3].
Further, the absolute value of difference that detects threshold value and current pixel point and vertical lower pixel greater than bad point at the absolute value of the difference of current pixel point and vertical direction pixel is during greater than bad some detection threshold value, or the absolute value of difference that detects threshold value and current pixel point and the right-hand pixel of level greater than bad point at the absolute value of the difference of current pixel point and horizontal left pixel is during greater than bad some detection threshold value, and the identification current pixel point is a bad point.
Further, concrete dead pixel compensation method is: the pixel point value summation back of the upper and lower, left and right that will badly put is average, gives described bad point with the mean value assignment.
A kind of image processing method that provides according to an aspect of the present invention, it comprises: step 100, determine digital gain value; Step 200 as the bad point detection threshold value, is carried out bad point detection according to surrounding pixel point and bad point detection threshold value to each pixel with the ratio of threshold constant and described digital gain value; Step 300 is carried out compensating bad point according to surrounding pixel point to the pixel that is identified as bad point; Step 400, after bad point detection according to described digital gain value to the amplification that gains of each pixel.
Further, after each automatic exposure program locking, in step 100, all to redefine a digital gain value.
Further, when representing pixel value with 0~255 number range, threshold constant is 32.
Like this, in the technical scheme that the present invention proposes, the bad some threshold value (dpd_threshold) that bad point is detected associates with digital gain (digital gain), and the value of digital gain is big more, the value of bad some threshold value is more little, so just can adaptively detect all bad points.
Description of drawings
Fig. 1 is the structured flowchart of an embodiment of image processing apparatus of the present invention;
Fig. 2 is the flow chart of an embodiment of image processing method of the present invention.
Embodiment
Below in conjunction with Figure of description the specific embodiment of the present invention is described.
In the technical scheme that the present invention proposes, the bad point threshold value (dpd_threshold) of bad point detection is associated with digital gain (digital gain), the value of digital gain is more big, and the value of bad point threshold value is more little, so just can adaptively detect all bad points.
Please refer to shown in Figure 1ly, it shows the block diagram of an embodiment of image processing apparatus of the present invention, and described image processing apparatus comprises that bad point detects a module 10, compensating bad point module 20, digital gain adjusting module 30 and digital gain module 40.
Described bad point detection module 10 is used for according to surrounding pixel point and bad point detection threshold value (dpd_threshold) each pixel being carried out bad point detection, concrete bad point detection mode can be: at the absolute value of the difference of current pixel point and vertical direction pixel greater than the absolute value of the difference of bad point detection threshold value and current pixel point and vertical lower pixel during greater than the bad point detection threshold value, or at the absolute value of the difference of current pixel point and horizontal left pixel greater than the absolute value of the difference of bad point detection threshold value and current pixel point and the right-hand pixel of level during greater than the bad point detection threshold value, the identification current pixel point is bad point.Certainly, the mode of bad point detection can also adopt other any modes known to a person of ordinary skill in the art.Described bad point detection threshold value can obtain according to a threshold constant, and this threshold constant can obtain through experiment repeatedly, and when the pixel value that represents with 0~255 number range, the span of threshold constant can be [28,35], and its best value is 32.
Described compensating bad point module 20 is used for according to the surrounding pixel point pixel that is identified as bad point being carried out compensating bad point, concrete dead pixel compensation method can be: the pixel point value summation back of the upper and lower, left and right that will badly put is average, gives described bad point with the mean value assignment.Certainly, dead pixel compensation method can also adopt other any modes known to a person of ordinary skill in the art.In addition, be not identified as the pixel of bad point just directly by the described digital gain module 40 of compensating bad point module 20 arrival.
Described digital gain adjusting module 30 is used for determining the value of digital gain (digital gain) and sends it to digital gain module 40 and bad some detection module 20, the span of described digital gain can be [1,3], described bad point detects module 20 ratio of threshold constant and described digital gain value is detected threshold value as bad point, described digital gain module 40 after go bad a little detection according to described digital gain value to the amplification that gains of each pixel.Wherein, after each automatic exposure program locking, digital gain adjusting module 30 all will redefine a digital gain value and send to digital gain module 40 and bad some detection module 20, has so just guaranteed that described bad point detects the variation that threshold value is followed digital gain value.
Like this, bad some threshold value dpd_threshold and digital gain (digital gain) that bad point is detected associate, and the value of digital gain is big more, and the value of bad some threshold value dpd_threshold should be more little, so just can adaptively detect all bad points.
It should be noted that, also may have additional other image processing modules at bad between detection module, compensating bad point module and digital gain module, bad some detection module, compensating bad point module and the digital gain module that therefore can not limit among the present invention must be linked in sequence successively.
Please refer to shown in Figure 2ly, it shows the schematic flow sheet of an embodiment of image processing method of the present invention, and this method comprises the steps.
Step 100 is determined digital gain and is sent to digital gain module 40 and bad point detection module 20.
Step 200, as the bad point detection threshold value, described bad point detection module 10 is carried out bad point detection according to surrounding pixel point and bad point detection threshold value to each pixel with the ratio of threshold constant and described digital gain value.
Step 300, described compensating bad point module is carried out compensating bad point according to surrounding pixel point to the pixel that is identified as bad point, is not identified as the pixel of bad point just directly by compensating bad point module 20.
Step 400, described digital gain module 40 after bad point detection according to described digital gain value to the amplification that gains of each pixel.
After each automatic exposure program locking, in step 100, all to redefine a digital gain value, so just guaranteed that described bad point detection threshold value follows the real-time change of digital gain value.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement etc., all should be included within protection scope of the present invention.