1. Field of the Invention
The present invention relates to the field of image processing, and more specifically, to a method and an apparatus for measuring response curve of an image sensor.
2. Description of the Related Art
A response curve of a digital image sensor reflects the correspondence between the exposure value when a photograph is taken using the digital image sensor and the pixel value of the image outputted from the image sensor. Generally speaking, the exposure value and the image pixel value exhibit a nonlinear relationship there between. FIG. 1 shows a graph of a response curve of an image sensor. In FIG. 1, the abscissa indicates the exposure value represented by natural logarithm, and the ordinate indicates the pixel value of the image. The pixel value is represented by using 8-bit data, showing 256 values ranging from 0 to 255. By using a response curve of an image sensor, a post processing can be performed on an image captured by the image sensor, so that a complex exposure effect that cannot be realized when the image is taken can be simulated in the post processing. Therefore, the quality of the post processed image can be improved, and further, much more useful information can be extracted from the image.
Different image sensors typically have different response curves. If an inaccurate response curve is used to post process an image, the image obtained through simulation exposure may be distorted and also false image details may be formed. Thus, it is necessary to measure and calculate a response curve individually for each image sensor.
Methods of calculating response curve of an image sensor in the prior art usually make use of a series of images taken with different exposure levels from a same scene. By such methods, the response of pixel values of the image captured by the image sensor to the exposure value is represented as Zij=f(Ei*Δtj). f is a response curve function. Zij represents the pixel value at position i of the j-th image, and Ei represents the scene irradiance where i is a spatial index over pixels. Δtj represents the exposure time where j indexes over exposure times Δtj. The product of Ei and Δtj represents the exposure value. Although the irradiance at a certain position of an image is kept unchanged, that is, Ei remains the same in the images with different exposure levels, the exposure time Δtj differs, such that the pixel values outputted from a same scene after exposure curve mapping are diverse from each other in the images with different exposure levels. Such methods used for calculating response curve need to select several pixel points from the image. Given that the pixel values Zij of the pixel points and the corresponding exposure time Δtj are known, a system of equations is formed according to Zij=f(Ei*Δtj). Then, the response curve f is obtained by solving the system of equations. In some improved methods, the pixel points used in solving the system of equations are screened such that the response curve finally obtained through calculation is smoother and more accurate.
However, these methods require taking photographs from a same scene several times and obtain a series of photographs, and a great number of pixel points of the photographs are needed for the calculation of the response curve. Therefore, the established system of equations for the response curve is large in scale, which results in a great amount of data needed for the calculation and extreme complexity of the solving process.
In addition, taking a series of photographs of a same scene with different exposure durations requires that these photographs should be aligned to the pixel level, such that the correspondence between the pixel values and the exposure values can be accurately reflected. Otherwise, the accuracy of the calculated response curve will be affected. Although some auxiliary devices such as tripod can be used when taking photographs, it is still very difficult to satisfy the above alignment requirement to pixel level. Thus, before calculating the response curve, some special calibration algorithms are needed to perform an alignment calibration on a series of photographs with different exposure levels.