1. Field of the Invention
The present invention relates to a camera with an interchangeable lens, such as an SLR (Single Lens Reflex) camera. In particular, it relates to a camera with a distortion-correction function.
2. Description of the Related Art
In a camera, image distortion occurs in a picture due to the characteristics of an optical lens. Distortion aberration varies with the lens's position along the optical axis. For example, the distortion aberration at a telephoto angle is different from that at a wide angle. In a digital camera, image distortion can be corrected by the image correction process, wherein the coordinate information of image points, i.e., individual pixels, is modified by utilizing aberration data measured in advance. For example, the distortion correction process is carried out within the focal mange of a zoom (telephoto) lens that produces a large degree of distortion. Also, an image may be divided into a plurality of minute areas, and the distortion correction process may be performed on each minute area.
The characteristics of image distortion vary with a target object's distance, the focal length, and so on. Consequently, the amount of distortion aberration data necessary for correcting the distortion becomes excessively large. In particular, in the case of a camera equipped with an interchangeable lens unit, ouch as an SLR-type camera, distortion aberration data must be prepared for attachable lenses at all focal lengths, resulting in a further increase in the distortion aberration data that must be stored.
An object of the present invention is to provide a camera, apparatus, and method for correcting distortion, and a computer program that is capable of correcting image distortion accurately while restricting the amount of data necessary for distortion correction.
A camera according to the present invention has an interchangeable lens unit removably attached to a camera body, and an image generating processor that generates image data of a subject captured by the lens unit. A memory provided in the lone unit stores distortion data. The distortion data is associated with an approximation function, which represents a correspondence relationship between image height and distortion aberration. Then, the distortion data includes at least one of, coefficient data of the approximation function, and sample data of the image height and the corresponding distortion aberration.
In the present invention, the camera has an approximation function processor, and a distortion correction processor. The approximation function processor defines an approximation function used for the generated image data on the basis of the distortion data read from the memory. The distortion correction processor carries out a distortion correction process on the image data based on the distortion aberration of each image point which is calculated by the defined approximation function.
An apparatus for correcting image distortion, according to another aspect of the present invention, has: a data-reading processor that reads distortion data from a memory provided in the lens unit; an approximation function processor that defines an approximation function used for an object image captured by an interchangeable lens, on the basis of the distortion data; a distortion aberration calculator that calculates the distortion aberration of each image point using the defined approximation function; and a distortion correction processor that carries out distortion correction processing on the image data on the basis of the calculated distortion aberrations.
A computer-readable medium that stores a program for correcting image distortion, according to another aspect of the present invention, has a data-reading process code segment that reads distortion data from a memory provided in an interchangeable lens unit, an approximation function process code segment that defines an approximation function used for an object image, formed by the interchangeable lens unit, on the basis of the distortion data; a distortion aberration calculation coda segment that calculates a distortion aberration of each image point by the defined approximation function; and a distortion correction process code segment that carries out a distortion correction process to the image data on the basis of the calculated distortion aberrations.
A method for correcting image distortion, according to another aspect of the present invention, includes: a) reading distortion data from a memory provided in an interchangeable lens unit; b) defining an approximation function used for an object image captured by the interchangeable lens unit, on the basis of the distortion data, c) calculating the distortion aberration of each image point using the defined approximation function; and d) carrying out distortion correction processing on the image data on the basis of the calculated distortion aberration.
The present invention will be better understood from the description of the preferred embodiments of the invention set forth below together with the accompanying drawings, in which:
Hereinafter, the preferred embodiments of the present invention are described with reference to the attached drawings.
An SLR-type digital camera 10 is equipped with an interchangeable lens unit 10A, which is removably attached to a camera body 10B. A release button 15 is operated by the user to take a picture, and a mode dial 13 is operated to set picture mode or playback mode. In the lens unit 10A, a photographic optical system (not shown) with a zoom lens is provided. Zooming can be performed in AF (Auto Focus) mode or MF (Manual Focus) mode.
The digital camera 10 is equipped with an image-signal processor 20 and a system control circuit 30, and a memory card 36 is removably installed in the camera body 10B. The system control circuit 30, including a CPU, a ROM unit and a RAM unit, connects with a release full-push switch 38, a release half-push switch 40, and a mode switch 41. The system control circuit 30 detects an operation signal when the mode dial 13 or the release button 15 is operated by the user. A program for controlling camera operations is stored in the ROM of the system control circuit 30. When the electrical power button (not shown) is turned on, a picture mode that allows the user to take a picture is set.
In the picture mode, light passing through a photographic optical system 12, reaches a quick-return mirror 21, and is reflected toward a pentagonal prism (not shown). Thus, a target subject is viewed via a viewfinder (not shown) provided on the back surface or the cameras body 10R. Also, the light is directed to a focus detector 23 by a sub-mirror 21A provided behind the quick-return mirror 21.
When the release button 15 is depressed halfway, the brightness of the object is detected by an exposure detector 25. Then, exposure values, i.e., shutter speed and F number (aperture value) are calculated. At the same time, a series of focusing lenses, provided in the photographic optical system 12, are driven by a lens driver 29 to focus the object image formed by the photographic optical system 12. Herein, the phase-difference detecting method is applied for an AF adjustment process. Namely, a focus adjustment process is carried out on the basis of a pair of photodetectors in the focus detector 22
When the release button 15 is fully depressed, the is photographing operation is carried out. Namely, the quick-return mirror 21 moves outside the light path, and a shutter 14 opens for a given period in accordance with a control signal fed from an exposure controller 26. Thus, an object image is formed on a CCD 16, and one-frame's worth of analog image pixel signals is generated. The image-pixel signals are read from the CCD 16 by driving signals fed from a CCD driver 27.
The image-pixel signals are amplified by an amplifier 17 and converted to digital image signals. Various processes, such as white balance adjustment, gamma correction, and so on, are carried out on the digital image signals in the image-signal processor 20 in order to generate the image data. The image data is temporarily stored in a frame memory (not shown), and is transmitted to the system control circuit 30.
As described below, the image data is subjected to a distortion correction process in the system control circuit 30 to correct for image distortion due to the optical photographic system 12. The distortion-corrected image data is compressed using a known method (e.g., JPEG method) in the recording processor 34, and is recorded on the memory card 36.
When playback mode is set, a playback process is carried out. Namely, the compressed image data is read from the memory card 36, and is expanded in the recording processor 34. The reconstructed image data is fed to an LCD driver 22 via the system control circuit 30 and the image-signal processor 20. The LCD driver 22 drives an LCD monitor 24 so that the recorded image is displayed on the LCD monitor 24.
Distortion data, associated with image distortion due to the photographic optical system 12, is stored in a ROM 11 provided in the lens unit 10A. When the lens unit 10A is attached to the camera body 10B, the connection is detected by pins (not shown) provided at a connecting portion of the camera body 10B, and the distortion data in the ROM 11 is fed to the system control circuit 30. The system control circuit 30 calculates distortion aberrations over the entirety of the images on the basis of the data, and carries out the distortion correction process.
In
The value or the distortion aberration D (=100×(y−y′)y)) varies with focal length. In
In
The distortion aberration curve M2, which is defined by plotting values of distortion aberrations, can be represented by an approximation function. A curve of the distortion aberration is generated by one of the following formulae.
Formula (1) represents a 6th-degree approximation polynomial. Six coefficients (a to g) are defined. Formula (2) is a 3rd-degree approximation polynomial, which is composed of a term to the third power and a term to the first power. Two coefficients (k, 1) are also defined. Finally, formula (3) is a 3rd-degree since function, defined by its third-power sine function and the term associated with an angle. Two coefficients, s and t, are defined. In
The coefficients of each approximation function vary with focal length. In the present embodiment, 4 series of coefficient data, which is defined for each focal length, is stored in the ROM 11 of the lens unit 10A, and it is read from the ROM 11 when the lens unit 10A is attached to the camera body 10B, and then the coefficient data is stored in the RAM of the system control circuit 30. Coefficients of the curves shown in
a=−4.045×10−9
b=1.843×10−7
c=1.322×10−6
d=1.254×10−5
e=6.558×103
f=1.154×10−4
g=2.214×10−4 (4)
k=3.8×10−4
l=2.8×10−2 (5)
s=1.97
t12.4 (6)
In
In
Comparing
In
In Step S101, i is set to 1, and in Step S102, j is set to 1. Namely, the first pixel P to be processed, (the “object pixel”), is set to the pixel P having the coordinates (1, 1). In Step S103, the value of the image height “y” of the selected pixel P is calculated. The image height y is obtained by calculating the distance between the pixel center point c and the object pixel P.
In Step S104, coefficients of the approximation function, corresponding to the focal length at the photograph, are selected from the series of coefficient data stored in the RAM of the system control circuit 30. Then, an approximation function is defined on the basis of the selected coefficients. Note that, a series of focal length data, which is associated with the positions of the focusing lenses, is stored in the ROM 11 in advance, and when taking a picture, the system control circuit 30 detects the focal length on the basis of the positions of the focusing lenses and the series of focal length data. Herein, we treat the case of barrel distortion (see
In Step S105, the value of the image height y, which is calculated in Step S103, is substituted for the 3rd-degree approximation sine function determined in Step S104. Thus, the distortion aberration D (%) is calculated. Then, based on the calculated distortion aberration D, the image height y′ corresponding to an image with distortion is calculated. The pixel having the imaqe height y′ is denoted “P′”.
In Step S106, the coordinates (i′, j′) of the pixel P′, which are based on the image distortion, are calculated. The pixel r and the pixel P′ have the relationship given in the following formula.
(i−ic):(i−i′)=y:(y−y′)
(j−jc):(j−j′)=y:(y−y′) (7)
Based on the formula (7), the coordinates (i′, j′) of the pixel P′ are obtained. Note that the first, second, third, and fourth quadrants are defined with respect to the original, i.e., the pixel center point C, and the calculation of the coordinates (i′, j′) is carried out in each quadrant.
In Step S107, the coordinates (i′, j′) of the pixel P′ are replaced with the coordinates (i, j) of the pixel P. Namely, pixel information for the pixel P′, i.e., pixel value, is moved to the position of the pixel P, where it belongs. In this manner, the pixel information for pixel P is decided. In other words, pixel P is corrected to compensate for the distortion in the image.
The coordinate i is incremented by 1 (Step S108), and it is determined whether the coordinate i exceeds Imax (Step S109). When it is determined that the coordinate i does not exceed Imax, the process returns to Step S103. On the other hand, when it is determined that the coordinate i exceeds Imax, the coordinate j is incremented by 1 (Step S110), and it is determined whether the coordinate j exceeds Jmax. When the coordinate does not exceeds Jmax, the process returns to Step 8102.
Stops S102 to S109 are repeatedly performed, in which one line's worth of pixels along the abscissa are corrected in order. When all pixels are corrected, the distortion correction process is terminated.
Thus, in the first embodiment, the series of coefficient data associated with approximation functions, which are prepared in each focal length, is stored in the ROM 11 of the lens unit 10A. When the lens unit 10A is attached to the camera body 10B, the series of coefficient data is fed to the camera body ion. Then, when a picture is taken, coefficient data corresponding to a focal length which was determined during the photographing action is selected, so that an approximation function may be determined. The distortion aberration of each pixel is calculated an the basis of the approximation function, and the distortion correction process is carried out by the calculated distortion aberrations.
Since the distortion aberration can be obtained accurately by using the approximation function, the storage of large amounts of plot data for image heights and distortion aberrations is not needed, and the distortion aberration can be calculated rapidly. Also, since only the coefficient data is stored in the ROM 11, the capacity of the ROM 11 may be small, and accurate distortion correction may be carried out with a small amount of data. The amount of coefficient data is particularly small in the case of the 3rd-degree approximation sill function.
Note that an approximation function may be defined in accordance with the characteristics of a lens unit. A function other than the above approximation function, such as a trigonometric function, may be used instead. The distortion correction process may be carried out by a known method other than the method explained above, and exclusive hardware may perform the distortion correction process.
Next, the second embodiment is explained with reference to
In the second embodiment, the number “m” of sample values of image heights and corresponding distortion aberrations is stored in the ROM 11. For example, three sample values of image heights and distortion aberrations as shown in the following table are stored. The sample values are measured in advance at approximately 5 mm intervals, and these sample values are prepared for each focal length.
When a picture is taken, the number “m” of image heights and distortion aberrations is selected according to focal length, and a linear approximation function is defined from plots of the selected sample data. As shown an
As shown in
The third embodiment is explained with reference to
When a picture is taken, the number “m” of image heights and distortion aberration is selected according to the detected focal length. Then, based on the selected sample values, coefficients of an approximation polynomial of m−1 degrees are obtained. Note that a method for calculating the number “m−1” of coefficients is generally well known. In
The fourth embodiment is explained with reference to
Similarly to the first embodiment, an approximation function of n degrees is obtained from coefficient data of the approximation function of n degrees. Then, a linear approximation function is obtained from the number “m” of coordinate data of the approximation function of n degrees. In
The fifth embodiment is explained with reference to
Note that a compact camera or a cellular phone with camera function may be applied instead of the SLR camera.
Finally, it will be understood by those skilled in the arts that the foregoing description is of preferred embodiments of the device, and that various changes and modifications may be made to the present invention without departing from the spirit and scope thereof.
The present disclosure relates to subject matter contained in Japanese Patent Application No. 2007-091160 (filed on Mar. 30, 2007), which is expressly incorporated herein by reference, in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2007-091160 | Mar 2007 | JP | national |