IMAGE CAPTURING DEVICE AND DIGITAL ZOOMING METHOD THEREOF
An image capturing device and a digital zooming method thereof are proposed in the invention. The method includes the following steps. A scene is captured by a primary lens and a secondary lens to generate a primary image and a secondary image. Image rectification is then performed on the primary and the secondary images to obtain two corresponding rectified images. Feature points detected and matched from the two rectified images are used to determine a corresponding overlapping region, respectively. Pixel displacement and depth map in the two overlapping regions could be calculated and estimated. Image zooming and warping techniques are performed on the two rectified images to obtain corresponding warped images using a recalculated homography matrix according to each specific zooming factor. Finally, the two overlapping regions in the warped image are fused by a weighted blending approach to generate a digital zoomed image.
This application claims the priority benefit of Taiwan application serial no. 103139384, filed on Nov. 13, 2014. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.
BACKGROUND OF THE INVENTION1. Field of the Invention
The invention generally relates to an image capturing device and a digital zooming method thereof, in particular, to an image capturing device with dual lenses and a digital zooming method thereof.
2. Description of Related Art
With development in technology, various smart image capturing devices, such as tablet computers, personal digital assistants and smart phones, have become indispensable tools for people nowadays. Camera lenses equipped in high-end smart image capturing devices provide same or better specifications than those of traditional consumer cameras, and some even provide three-dimensional image capturing features or near-equivalent pixel qualities to those of digital single lens reflex cameras.
When such image capturing devices perform digital zoom to enlarge an image, image blur and distortion may occur. In terms of a single lens, digital zoom is performed on a single image via an image processing technique. However, after the image is enlarged, it details may not be preserved. As a zooming factor increases, the image appears more blur and distorted.
On the other hand, in terms of dual lenses, the wide-angle lens may be used for capturing a wide-angle image, and the telephoto lens may be used for capturing a narrow-angle image. Either one of the wide-angle image and the narrow-angle image would be set as a target image for digital zoom. However, throughout the digital zooming process, if the target image needs to be switched to the other image, the viewed image may appear flickering or unsmooth.
Accordingly, to present an image that meets the user's expectation during an image digital process is one of the problems to be solved.
SUMMARY OF THE INVENTIONAccordingly, the invention is directed to an image capturing device and a digital zooming method thereof, where a digital zoomed image with high quality would be provided throughout a digital zooming process.
The invention is directed to a digital zooming method of an image capturing device, adapted to an image capturing device having a primary lens and a secondary lens. The method includes the following steps: capturing a scene by using the primary lens and the secondary lens to generate a primary image and a secondary image; performing image rectification on the primary image and the secondary image to generate a primary rectified image and a secondary rectified image; performing feature point detection on the primary rectified image and the secondary rectified image so as to detect overlapping regions respectively in the primary rectified image and the secondary rectified image, and further obtaining a plurality of pixel displacements and a depth map of the overlapping regions respectively in the primary rectified image and the secondary rectified image; when a zooming factor is between 1 and a primary-secondary image factor, performing image zooming and image warping on the primary rectified image and the secondary rectified image to generate a primary warped image and a secondary warped image according to the zooming factor, the pixel displacements, and the depth map, wherein the primary-secondary image factor is a ratio of the secondary rectified image to the primary rectified image; and performing image fusion on overlapping regions respectively in the primary warped image and the secondary warped image to generate a digital zoomed image.
According to an embodiment of the invention, the step of performing image rectification on the primary image and the secondary image to generate the primary rectified image and the secondary rectified image includes: obtaining a plurality of rectification parameters associated with the primary lens and the secondary lens; and rectifying the primary image and the secondary image to generate the primary rectified image and the secondary rectified image according to the rectification parameters.
According to an embodiment of the invention, the step of performing feature point detection on the primary rectified image and the secondary rectified image so as to detect the overlapping regions respectively in the primary rectified image and the secondary rectified image, and further obtaining the pixel displacements and the depth map of the overlapping regions respectively in the primary rectified image and the secondary rectified image includes: detecting a plurality of feature points from the primary rectified image and the secondary rectified image; identifying a plurality of feature point correspondences to calculate a homography matrix according to color information of a plurality of neighboring points of each of the feature points in the primary rectified image and the secondary rectified image; obtaining the overlapping regions respectively in the primary rectified image and the secondary rectified image according to the homography matrix and accordingly obtaining each of the pixel displacements; and performing stereo matching on each of the feature points in the primary rectified image and the secondary rectified image to obtain the depth map corresponding to each of the feature points.
According to an embodiment of the invention, the primary lens and the secondary lens have different fields of view and same distortion levels. The field of view of the primary lens is greater than the field of view of the secondary lens. The primary-secondary image factor is fixed and prior known. When the zooming factor is between 1 and the primary-secondary image factor, the step of performing image zooming and image warping on the primary rectified image and the secondary rectified image to generate the primary warped image and the secondary warped image according to the zooming factor, the pixel displacements, and the depth map includes: enlarging the primary rectified image to generate an enlarged primary rectified image according to the zooming factor; shrinking the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor; and performing image warping on the enlarged primary rectified image and the shrunken secondary rectified image to generate the primary warped image and the secondary warped image according to the pixel displacements and the depth map, wherein a warping level is associated with the depth map. When the zooming factor is less than 1, only the primary rectified image would be shrunken. When the zooming factor is greater than the primary-secondary image factor, only the secondary rectified image would be enlarged.
According to an embodiment of the invention, the primary lens and the secondary lens have same fields of view and same distortion levels. After the step of performing image rectification on the primary image and the secondary image to generate the primary rectified image and the secondary rectified image, the digital zooming method further includes: performing image binning on the primary rectified image to generate a binned primary rectified image; performing image cropping on the secondary rectified image to generate a cropped secondary rectified image, wherein a size of the binned primary rectified image and a size of the cropped secondary rectified image are the same; and setting the binned primary rectified image and the cropped secondary rectified image respectively as the primary rectified image and the secondary rectified image. When the zooming factor is between 1 and the primary-secondary image factor, the step of performing image zooming and image warping on the primary rectified image and the secondary rectified image to generate the primary warped image and the secondary warped image according to the zooming factor, the pixel displacements, and the depth map includes: enlarging the primary rectified image to generate an enlarged primary rectified image according to the zooming factor; shrinking the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor; and performing image warping on the enlarged primary rectified image and the shrunken secondary rectified image to generate the primary warped image and the secondary warped image according to the pixel displacements and the pixel depth map, wherein a warping level is associated with the depth map. When the zooming factor is less than 1, only the primary rectified image would be shrunken. When the zooming factor is greater than the primary-secondary image factor, only the secondary rectified image would be enlarged.
According to an embodiment of the invention, the primary lens and the secondary lens have same fields of view and different distortion levels, and the distortion level of the primary lens is much less than the distortion level of the secondary lens. After the step of performing image rectification on the primary image and the secondary image to generate the primary rectified image and the secondary rectified image, the method further includes: performing image cropping on a center region of the secondary rectified image to generate a cropped secondary rectified image; and setting the cropped secondary rectified image as the secondary rectified image. When the zooming factor is between 1 and the primary-secondary image factor, the step of performing image zooming and image warping on the primary rectified image and the secondary rectified image to generate the primary warped image and the secondary warped image according to the zooming factor, the pixel displacements, and the depth map includes: enlarging the primary rectified image to generate an enlarged primary rectified image according to the zooming factor; shrinking the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor; and performing image warping on the enlarged primary rectified image and the shrunken secondary rectified image to generate the primary warped image and the secondary warped image according to the pixel displacements and the pixel depth map, wherein a warping level is associated with the depth map. When the zooming factor is less than 1, only the primary rectified image would be shrunken. When the zooming factor is greater than the primary-secondary image factor, only the secondary rectified image would be enlarged.
According to an embodiment of the invention, the step of performing image fusion on the overlapping regions respectively in the primary warped image and the secondary warped image to generate the digital zoomed image includes: setting a first weight and a second weight respectively corresponding to the primary warped image and the secondary warped image according to the zooming factor; performing image fusion on the overlapping regions respectively in the primary warped image and the secondary warped image to generate a fused overlapping image based on the first weight and the second weight; and substituting the overlapping regions respectively in the primary warped image and the secondary warped image by the fused overlapping image to generate the digital zoomed image.
The invention is also directed to an image capturing device including a primary lens, a secondary lens, a storage unit, and at least one processing unit, where the processing unit is coupled to the lens and the storage unit. The storage unit is configured to record a plurality of modules. The processing unit is configured to access and execute the modules recorded in the storage unit. The modules include an image capturing module, an image preprocessing module, a feature analyzing module, an image zooming-warping module, and an image fusion module. The image capturing module is configured to capture a scene by using the primary lens and the secondary lens to generate a primary image and a secondary image. The image preprocessing module is configured to perform image rectification on the primary image and the secondary image to generate a primary rectified image and a secondary rectified image. The feature analyzing module is configured to perform feature point detection on the primary rectified image and the secondary rectified image so as to detect overlapping regions respectively in the primary rectified image and the secondary rectified image, and further obtain a plurality of pixel displacements and a depth map of the overlapping regions respectively in the primary rectified image and the secondary rectified image. The image zooming-warping module is configured to perform image zooming and image warping on the primary rectified image and the secondary rectified image to generate a primary warped image and a secondary warped image according to the zooming factor, the pixel displacements, and the depth map. The image fusion module is configured to perform image fusion on overlapping regions respectively in the primary warped image and the secondary warped image to generate a digital zoomed image.
According to an embodiment of the invention, the image preprocessing module obtains a plurality of rectification parameters associated with the primary lens and the secondary lens, and rectifies the primary image and the secondary image to generate the primary rectified image and the secondary rectified image according to the rectification parameters.
According to an embodiment of the invention, the feature analyzing module detects a plurality of feature points from the primary rectified image and the secondary rectified image, identifies a plurality of feature point correspondences to calculate a homography matrix according to color information of a plurality of neighboring points of each of the feature points in the primary rectified image and the secondary rectified image, obtains the overlapping regions respectively in the primary rectified image and the secondary rectified image according to the homography matrix and accordingly obtains each of the pixel displacements, and performs stereo matching on each of the feature point correspondences in the primary rectified image and the secondary rectified image to obtain the depth map.
According to an embodiment of the invention, the primary lens and the secondary lens have different fields of view and same distortion levels. The field of view of the primary lens is greater than the field of view of the secondary lens. The primary-secondary image factor is fixed and prior known. The image zooming-warping module enlarges the primary rectified image to generate an enlarged primary rectified image according to the zooming factor, shrinks the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor, and performs image warping on the enlarged primary rectified image and the shrunken secondary rectified image to respectively generate the primary warped image and the secondary warped image according to the pixel displacements and the depth map, wherein a warping level is associated with the depth map.
According to an embodiment of the invention, the primary lens and the secondary lens have same fields of view and same distortion levels. The image preprocessing module further performs image binning on the primary rectified image to generate a binned primary rectified image, performs image cropping on the secondary rectified image to generate a cropped secondary rectified image, and sets the binned primary rectified image and the cropped secondary rectified image respectively as the primary rectified image and the secondary rectified image, where a size of the binned primary rectified image and a size of the cropped secondary rectified image are the same. The image zooming-warping module enlarges the primary rectified image to generate an enlarged primary rectified image according to the zooming factor, shrinks the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor, and performs image warping on the enlarged primary rectified image and the shrunken secondary rectified image to respectively generate the primary warped image and the secondary warped image according to the pixel displacements and the depth map, wherein a warping level is associated with the depth map.
According to an embodiment of the invention, the primary lens and the secondary lens have same fields of view and different distortion levels, and the distortion level of the primary lens is much less than the distortion level of the secondary lens. A primary-secondary center image factor between a center region of the primary rectified image and a center region of the secondary rectified image is fixed and prior known. The image preprocessing module further performs image cropping on the center region of the secondary rectified image to generate a cropped secondary rectified image, and sets the cropped secondary rectified image as the secondary rectified image. The image zooming-warping module enlarges the primary rectified image to generate an enlarged primary rectified image according to the zooming factor, shrinks the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor, and performs image warping on the enlarged primary rectified image and the shrunken secondary rectified image to respectively generate the primary warped image and the secondary warped image according to the pixel displacements and the depth map, wherein a warping level is associated with the depth map.
According to an embodiment of the invention, the image fusion module sets a first weight and a second weight respectively corresponding to the primary warped image and the secondary warped image according to the zooming factor, performs image fusion on the overlapping regions respectively in the primary warped image and the secondary warped image to generate a fused overlapping image based on the first weight and the second weight, and substitutes the overlapping regions respectively in the primary warped image and the secondary warped image by the fused overlapping image to generate the digital zoomed image.
In summary, in the image capturing device and the digital zooming method proposed in the invention, by analyzing different imaging properties and distortion levels of the dual lenses, image zooming and image warping are automatically performed on images captured by the dual lenses according to a zooming factor to generate two warped images with similar focal lengths, sizes, and fields of view. The two warped images are fused by their weighted sum, and a digital zoomed image corresponding to the zooming factor would be obtained thereafter. As compared with the existing digital zooming techniques, the image capturing device and the digital zooming method proposed in the invention may provide a digital zoomed image with high quality throughout a digital zooming process.
The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
Reference will now be made in detail to the present embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts. In addition, the specifications and the like shown in the drawing figures are intended to be illustrative, and not restrictive. Therefore, specific structural and functional detail disclosed herein are not to be interpreted as limiting, but merely as a representative basis for teaching one skilled in the art to variously employ the invention.
Referring to
The primary lens 10a and the secondary lens 10b include optical sensing elements for sensing light intensity entering the primary lens 10a and the secondary lens 10b to thereby generate images. The optical sensing elements are, for example, charge-coupled-device (CCD) elements, complementary metal-oxide semiconductor (CMOS) elements, and yet the invention is not limited thereto. Moreover, focal lengths, sensing sizes, fields of view, and distortion levels of the primary lens 10a and the secondary lens 10b may be the same or different. The invention is not limited herein.
The storage unit 20 may be one or a combination of a stationary or mobile random access memory (RAM), a read-only memory (ROM), a flash memory, a hard drive or other similar devices. The storage unit 20 is configured to record a plurality of modules executable by the processing unit 30, where the modules may be loaded into the processing unit 30 for performing digital zoom on an image captured by the image capturing device 100.
The processing unit 30 may be, for example, a central processing unit (CPU) or other programmable devices for general purpose or special purpose such as a microprocessor and a digital signal processor (DSP), a programmable controller, an application specific integrated circuit (ASIC), a programmable logic device (PLD) or other similar devices or a combination of above-mentioned devices. The processing unit 30 is coupled to the primary lens 10a, the secondary lens 10b, and the storage unit 20, and capable of accessing and executing the modules recorded in the storage unit 20.
The aforesaid modules include an image capturing module 121, an image preprocessing module 122, a feature analysing module 123, an image zooming-warping module 124, and an image fusion module 125, where the modules may be loaded into the processing unit 30 for digital zoom.
Referring to both
Next, the image preprocessing module 122 performs image rectification on the primary image and the secondary image to respectively generate a primary rectified image and a secondary rectified image (Step S204). To be specific, the image preprocessing module 122 may calibrate the shift amount of the brightness, the color, and the geometric position of each of the primary image and the secondary image respectively due to the primary lens 10a and the secondary lens 10b.
In the present embodiment, the image preprocessing module 122 may obtain a plurality of rectification parameters associated with the primary lens 10a and the secondary lens 10b. Such rectification parameters may be intrinsic parameters and extrinsic parameters of a camera for image rectification. The intrinsic parameters may be used for describing the transformation between camera coordinates and image coordinates. That is, the camera coordinates may be projected onto a projective plane according to the pinhole imaging principle. The intrinsic parameters may be, for example, focal length, image center, principal point, distortion coefficients, and so forth. The extrinsic parameters are used for describing the transformation between world coordinates and camera coordinates. The extrinsic parameters may be, for example, parameters in associated with the position and the viewing angle of the image capturing device 100 in a three-dimensional coordinate system such as a rotation matrix and a translation vector. The rectification parameters may also be parameters in associated with illumination compensation or color correction. The invention is not limited herein. The image preprocessing module 122 may rectify the primary image and the secondary image according to the aforesaid rectification parameters. The primary image and the secondary image being rectified may be referred to as a “primary rectified image” and a “secondary rectified image” respectively.
Next, the feature analyzing module 123 performs feature point detection on the primary rectified image and the secondary rectified image so as to detect overlapping regions respectively in the primary rectified image and the secondary rectified image, and further obtains a plurality of pixel displacements and a depth map of the overlapping regions respectively in the primary rectified image and the secondary rectified image (Step S206). Each of the overlapping regions is an overlapping portion between the field of view of the primary rectified image and that of the secondary rectified image.
To be specific, the feature analyzing module 123 may detect a plurality of feature points from the primary rectified image and the secondary rectified image by leveraging a feature detection algorithm such as edge detection, corner detection, blob detection, and so forth. Next, the feature analyzing module 123 may identify a plurality of feature point correspondences and obtain the overlapping regions respectively in the primary rectified image and the secondary rectified image.
In an embodiment, the feature analyzing module 123 may identify a plurality of feature point correspondences according to color information of a plurality of neighboring points of each of the feature points in the primary rectified image and the secondary rectified image so as to calculate a homography matrix. The feature analyzing module 123 may not only obtain the pixel displacements of the two overlapping regions via the homography matrix, but may also perform stereo matching due to the similar fields of view so as to estimate the depth map.
To be specific, the feature analyzing module 123 may determine the displacement and shift properties of each feature point correspondence to obtain the pixel displacements thereof. On the other hand, the feature analyzing module 123 may perform stereo matching on each of the feature point correspondences to obtain the pixel depth map. In other words, the feature analyzing module 123 may calculate the depth information of each of the feature point correspondences in the overlapping regions respectively in the primary rectified image and the secondary rectified image and store the depth information in a form of a depth map.
Next, when a zooming factor is between 1 and a primary-secondary image factor, the image zooming-warping module 124 performs image zooming and image warping on the primary rectified image and the secondary rectified image to generate a primary warped image and a secondary warped image according to the zooming factor, the pixel displacements, and the depth map (Step S208). The “primary-secondary image factor” is referred to as a ratio of the secondary rectified image to the primary rectified image, and is fixed and prior known. The “zooming factor” is an enlargement level to be adjusted on the primary rectified image; it may be set by the user or may be a default value of the image capturing device 100. The image zooming-warping module 124 may perform image zooming and image warping on the primary rectified image and the secondary rectified image according to the zooming factor as well as relative displacement, shift, and depth information between the two overlapping regions so as to generate two images with two overlapping regions having similar views and appearances, where the zooming factor of each of the two generated images also meets the user's need. Moreover, a warping level of each of the generated images is associated with the depth map. As the depth value increases, the warping level decreases; as the depth value decreases, the warping level increases. More details on the image zooming and image warping processes will be described in the follow-up embodiments.
Next, the image fusion module 125 performs image fusion on overlapping regions respectively in the primary warped image and the secondary warped image to generate a digital zoomed image (Step S210). To be specific, the image fusion module 125 may set a first weight and a second weight respectively corresponding to the primary warped image and the secondary warped image according to the zooming factor. Next, the image fusion module 125 may perform image fusion on each color pixel of the overlapping regions respectively in the primary warped image and the secondary warped image by a weighted sum based on the first weight and the second weight, where the resulting image is referred to as a “fused overlapping region.” Then, the image fusion module 125 may substitute the overlapping region in the primary warped image by the fused overlapping image so as to generate the digital zoomed image with high quality.
In another embodiment, when the zooming factor is less than 1, the image zooming-warping module 124 may only shrink the primary rectified image to generate a shrunken primary rectified image. Next, the image zooming-warping module 124 may perform image warping on the shrunken primary rectified image to generate the primary warped image and set the primary warped image as the digital zoomed image. On the other hand, when the zooming factor is greater than the primary-secondary image factor, the image zooming-warping module 124 may enlarge the secondary rectified image to generate an enlarged secondary rectified image according to the zooming factor. Next, the image zooming-warping module 124 may perform image warping on the shrunken secondary rectified image to generate the secondary warped image and set the secondary rectified image as the digital zoomed image.
The image capturing device proposed in the invention may be adapted to different sets of lenses. The digital zooming method corresponding to three different sets of lenses will be illustrated hereinafter.
Referring to
In the present embodiment, the image zooming-warping module 124 may enlarge the primary rectified image to generate an enlarged primary rectified image according to the zooming factor. Throughout the enlargement process, a center region of the primary rectified image would gradually alike to the secondary rectified image. The image zooming-warping module 124 may further shrink the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor. Next, the image zooming-warping module 124 may perform image warping on the enlarged primary rectified image and the shrunken secondary rectified image to generate a primary warped image and a secondary warped image according to the pixel displacements and the depth map.
The image fusion module 125 may set a first weight and a second weight respectively corresponding to the primary warped image and the secondary warped image according to a zooming factor. The first weight and the second weight are allocated based on a zooming factor and a factor corresponding to each of the primary image and the secondary image. In the present embodiment, assume that the factors corresponding to the primary image and the secondary image are respectively 1 and 2. When the zooming factor is 1 (i.e., the median of 1 and 2), the image fusion module 125 would set the first weight and the second weight respectively to 0.5. In another embodiment, when the zooming factor is 1.2, the image fusion module 125 would set the first weight and the second weight respectively to 0.8 and 0.2. However, the image fusion module 125 is not restricted to set the two weights based on a linear relationship. In other embodiments, the image fusion module 125 may set the two weights based on other formulas. The invention is not limited herein. After performing image fusion, the image fusion module 125 may generate a digital zooming image which is a relatively smooth, clear, and enlarged image.
Referring to
To be specific, the image preprocessing module 122 may perform image binning on the primary rectified image to generate a binned primary rectified image 410a with a smaller size. In an embodiment, the size of the binned primary rectified image 410a may be ¼ of the size of the primary rectified image 400a. In other words, the image preprocessing 122 may perform 2×2 pixel binning on the primary rectified image 400a to bin each four neighboring pixels of the primary image 400a into one and thereby generate the binned primary rectified image 410a. As compared with the primary rectified image 400a, the binned primary rectified image 410a may be transferred faster and yet with a lower resolution.
On the other hand, the image preprocessing module 122 may perform image cropping on the secondary rectified image to generate a cropped secondary rectified image 410a. In the present embodiment, the size of the cropped secondary rectified image 410b may also be ¼ of the size of the secondary rectified image 400b. In other words, the image preprocessing module 122 may crop a center region 405b with ¼ of the size of the secondary rectified image 400b and thereby generate the cropped secondary rectified image 410b.
Hence, the image preprocessing module 122 may simulate the binned primary rectified image 410a and the secondary rectified image 400b with same sizes and different field of views, and further set the binned primary rectified image and the cropped secondary rectified image respectively as the primary rectified image and the secondary rectified image. Next, similar image processing steps as illustrated in
Referring to
Next, the image preprocessing module 122 may perform image rectification on the primary 500a and the secondary image 500b to generate a primary rectified image and a secondary rectified image. The image preprocessing module 122 may crop the larger proportion of the center region in the primary rectified image (i.e., the region corresponding to the region 505b of the secondary image) to generate a cropped secondary rectified image, and further set the cropped secondary rectified image as the secondary rectified image. The secondary rectified image has a relatively smaller field of view as compared with the primary rectified image, and yet has a higher resolution. The image zooming-warping module 124 may enlarge the primary rectified image to generate an enlarged primary rectified image and shrink the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor. Next, the image zoom-warping module 124 may perform image warping on the enlarged primary rectified image and the shrunken secondary rectified image to respectively generate the primary warped image and the secondary warped image according to the pixel displacements and the depth map of the overlapping regions obtained from the feature analyzing module 123.
It should be noted that, since the secondary rectified image and the primary rectified image have the same fields of view, after lens distortion correction is performed on the outer region 508b in the secondary image 500b, the image capturing device 100 may perform depth estimation on the entire primary rectified image by using the secondary rectified image and the corrected secondary image.
The aforesaid digital zooming method of the image processing device may be summarized by a functional block diagram as illustrated in
Referring to
In summary, in the image capturing device and the digital zooming method proposed in the invention, by analyzing different imaging properties and distortion levels of the dual lenses, image zooming and image warping are automatically performed on images captured by the dual lenses according to a zooming factor to generate two warped images with similar focal lengths, sizes, and fields of view. The two warped images are fused by their weighted sum, and a digital zoomed image corresponding to the zooming factor would be obtained thereafter. As compared with the existing digital zooming techniques, the image capturing device and the digital zooming method proposed in the invention may provide a digital zoomed image with high quality throughout a digital zooming process.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.
Claims
1. A digital zooming method, adapted to an image capturing device having a primary lens and a secondary lens, comprising:
- capturing a scene by using the primary lens and the secondary lens to generate a primary image and a secondary image;
- performing image rectification on the primary image and the secondary image to generate a primary rectified image and a secondary rectified image;
- performing feature point detection on the primary rectified image and the secondary rectified image so as to detect overlapping regions respectively in the primary rectified image and the secondary rectified image, and further obtaining a plurality of pixel displacements and a depth map of the overlapping regions respectively in the primary rectified image and the secondary rectified image;
- when a zooming factor is between 1 and a primary-secondary image factor, performing image zooming and image warping on the primary rectified image and the secondary rectified image to generate a primary warped image and a secondary warped image according to the zooming factor, the pixel displacements, and the depth map, wherein the primary-secondary image factor is a ratio of the secondary rectified image to the primary rectified image; and
- performing image fusion on overlapping regions respectively in the primary warped image and the secondary warped image to generate a digital zoomed image.
2. The digital zooming method of claim 1, wherein the step of performing image rectification on the primary image and the secondary image to generate the primary rectified image and the secondary rectified image comprises:
- obtaining a plurality of rectification parameters associated with the primary lens and the secondary lens; and
- rectifying the primary image and the secondary image to generate the primary rectified image and the secondary rectified image according to the rectification parameters.
3. The digital zooming method of claim 1, wherein the step of performing feature point detection on the primary rectified image and the secondary rectified image so as to detect the overlapping regions respectively in the primary rectified image and the secondary rectified image, and further obtaining the pixel displacements and the depth map of the overlapping regions respectively in the primary rectified image and the secondary rectified image comprises:
- detecting a plurality of feature points from the primary rectified image and the secondary rectified image;
- identifying a plurality of feature point correspondences to calculate a homography matrix according to color information of a plurality of neighboring points of each of the feature points in the primary rectified image and the secondary rectified image;
- obtaining the overlapping regions respectively in the primary rectified image and the secondary rectified image according to the homography matrix and accordingly obtaining each of the pixel displacements; and
- performing stereo matching on each of the feature point correspondences in the primary rectified image and the secondary rectified image to obtain the depth map.
4. The digital zooming method of claim 1, wherein the primary lens and the secondary lens have different fields of view and same distortion levels, wherein the field of view of the primary lens is greater than the field of view of the secondary lens, and wherein when the zooming factor is between 1 and the primary-secondary image factor, the step of performing image zooming and image warping on the primary rectified image and the secondary rectified image to generate the primary warped image and the secondary warped image according to the zooming factor, the pixel displacements, and the depth map comprises:
- enlarging the primary rectified image to generate an enlarged primary rectified image according to the zooming factor;
- shrinking the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor; and
- performing image warping on the enlarged primary rectified image and the shrunken secondary rectified image to generate the primary warped image and the secondary warped image according to the pixel displacements and the depth map, wherein a warping level is associated with the depth map.
5. The digital zooming method of claim 1, wherein the primary lens and the secondary lens have same fields of view and same distortion levels, and wherein after the step of performing image rectification on the primary image and the secondary image to generate the primary rectified image and the secondary rectified image, the digital zooming method further comprises:
- performing image binning on the primary rectified image to generate a binned primary rectified image;
- performing image cropping on the secondary rectified image to generate a cropped secondary rectified image, wherein a size of the binned primary rectified image and a size of the cropped secondary rectified image are the same; and
- setting the binned primary rectified image and the cropped secondary rectified image respectively as the primary rectified image and the secondary rectified image.
6. The digital zooming method of claim 1, wherein when the zooming factor is between 1 and the primary-secondary image factor, the step of performing image zooming and image warping on the primary rectified image and the secondary rectified image to generate the primary warped image and the secondary warped image according to the zooming factor, the pixel displacements, and the depth map comprises:
- enlarging the primary rectified image to generate an enlarged primary rectified image according to the zooming factor;
- shrinking the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor; and
- performing image warping on the enlarged primary rectified image and the shrunken secondary rectified image to generate the primary warped image and the secondary warped image according to the pixel displacements and the pixel depth map, wherein a warping level is associated with the depth map.
7. The digital zooming method of claim 1, wherein the primary lens and the secondary lens have same fields of view and different distortion levels, wherein the distortion level of the primary lens is much less than the distortion level of the secondary lens, and wherein after the step of performing image rectification on the primary image and the secondary image to generate the primary rectified image and the secondary rectified image, the digital zooming method further comprises:
- performing image cropping on a center region of the secondary rectified image to generate a cropped secondary rectified image; and
- setting the cropped secondary rectified image as the secondary rectified image.
8. The digital zooming method of claim 7, wherein when the zooming factor is between 1 and the primary-secondary image factor, the step of performing image zooming and image warping on the primary rectified image and the secondary rectified image to generate the primary warped image and the secondary warped image according to the zooming factor, the pixel displacements, and the depth map comprises:
- enlarging the primary rectified image to generate an enlarged primary rectified image according to the zooming factor;
- shrinking the secondary rectified image to generate a shrunken secondary rectified image; and
- performing image warping on the enlarged primary rectified image and the shrunken secondary rectified image to generate the primary warped image and the secondary warped image according to the pixel displacements and the depth map, wherein a warping level is associated with the depth map.
9. The digital zooming method of claim 1, wherein the step of performing image fusion on the overlapping regions respectively in the primary warped image and the secondary warped image to generate the digital zoomed image comprises:
- setting a first weight and a second weight respectively corresponding to the primary warped image and the secondary warped image according to the zooming factor;
- performing image fusion on the overlapping regions respectively in the primary warped image and the secondary warped image to generate a fused overlapping image based on the first weight and the second weight; and
- substituting the overlapping regions respectively in the primary warped image and the secondary warped image by the fused overlapping image to generate the digital zoomed image.
10. The digital zooming method of claim 1, wherein when the zooming factor is greater than the primary-secondary image factor, the digital zooming method further comprises:
- enlarging the secondary rectified image to generate an enlarged secondary rectified image according to the zooming factor;
- performing image warping on the shrunken secondary rectified image to generate the secondary warped image according to the pixel displacements and the depth map, wherein a warping level is associated with the depth map; and
- setting the secondary warped image as the digital zoomed image.
11. The digital zooming method of claim 1, wherein when the zooming factor is less than 1, the digital zooming method further comprises:
- shrinking the primary rectified image to generate a shrunken primary rectified image;
- performing image warping on the shrunken primary rectified image to generate the primary warped image according to the pixel displacements and the pixel depth map, wherein a warping level is associated with the depth map; and
- setting the primary warped image as the digital zoomed image.
12. An image capturing device comprising:
- a primary lens;
- a secondary lens;
- a storage unit, recording a plurality of modules; and
- one or more processing unit, coupled to the primary lens, the secondary lens and the storage unit, and accessing and executing the modules recorded in the storage unit, wherein the modules comprise: an image capturing module, capturing a scene by using the primary lens and the secondary lens to generate a primary image and a secondary image; an image preprocessing module, performing image rectification on the primary image and the secondary image to generate a primary rectified image and a secondary rectified image; a feature analyzing module, performing feature point detection on the primary rectified image and the secondary rectified image so as to detect overlapping regions respectively in the primary rectified image and the secondary rectified image, and further obtaining a plurality of pixel displacements and a depth map of the overlapping regions respectively in the primary rectified image and the secondary rectified image; an image zooming-warping module, when a zooming factor is between 1 and a primary-secondary image factor, performing image zooming and image warping on the primary rectified image and the secondary rectified image to generate a primary warped image and a secondary warped image according to the zooming factor, the pixel displacements, and the depth map, wherein the primary-secondary image factor is a ratio of the secondary rectified image to the primary rectified image; and an image fusion module, performing image fusion on overlapping regions respectively in the primary warped image and the secondary warped image to generate a digital zoomed image.
13. The image capturing device of claim 12, wherein the image preprocessing module obtains a plurality of rectification parameters associated with the primary lens and the secondary lens, and rectifies the primary image and the secondary image to generate the primary rectified image and the secondary rectified image according to the rectification parameters.
14. The image capturing device of claim 12, wherein the feature analyzing module detects a plurality of feature points from the primary rectified image and the secondary rectified image, identifies a plurality of feature point correspondences to calculate a homography matrix according to color information of a plurality of neighboring points of each of the feature points in the primary rectified image and the secondary rectified image, obtains the overlapping regions respectively in the primary rectified image and the secondary rectified image according to the homography matrix and accordingly obtains each of the pixel displacements, and performs stereo matching on each of the feature point correspondences in the primary rectified image and the secondary rectified image to obtain the depth map.
15. The image capturing device of claim 12, wherein the primary lens and the secondary lens have different fields of view and same distortion levels, wherein the field of view of the primary lens is greater than the field of view of the secondary lens, and wherein when the zooming factor is between 1 and the primary-secondary image factor, the image zooming-warping module enlarges the primary rectified image to generate an enlarged primary rectified image according to the zooming factor, shrinks the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor, and performs image warping on the enlarged primary rectified image and the shrunken secondary rectified image to respectively generate the primary warped image and the secondary warped image according to the pixel displacements and the depth map, wherein a warping level is associated with the depth map.
16. The image capturing device of claim 12, wherein the primary lens and the secondary lens have same fields of view and same distortion levels, and the image preprocessing module further performs image binning on the primary rectified image to generate a binned primary rectified image, performs image cropping on the secondary rectified image to generate a cropped secondary rectified image, and sets the binned primary rectified image and the cropped secondary rectified image respectively as the primary rectified image and the secondary rectified image, wherein a size of the binned primary rectified image and a size of the cropped secondary rectified image are the same.
17. The image capturing device according to claim 16, wherein when the zooming factor is between 1 and the primary-secondary image factor, the image zooming-warping module enlarges the primary rectified image to generate an enlarged primary rectified image according to the zooming factor, shrinks the secondary rectified image to generate a shrunken secondary rectified image according to the zooming factor, and performs image warping on the enlarged primary rectified image and the shrunken secondary rectified image to generate the primary warped image and the secondary warped image according to the pixel displacements and the pixel depth map, wherein a warping level is associated with the depth map.
18. The image capturing device according to claim 11, wherein the primary lens and the secondary lens have same fields of view and different distortion levels, wherein the distortion level of the primary lens is much less than the distortion level of the secondary lens, and wherein the image preprocessing module further performs image cropping on a center region of the secondary rectified image to generate a cropped secondary rectified image, and sets the cropped secondary rectified image as the secondary rectified image.
19. The image capturing device according to claim 18, wherein when the zooming factor is between 1 and the primary-secondary image factor, the image zooming-warping module enlarges the primary rectified image to generate an enlarged primary rectified image according to the zooming factor, shrinks the secondary rectified image to generate a shrunken secondary rectified image, and performs image warping on the enlarged primary rectified image and the shrunken secondary rectified image to generate the primary warped image and the secondary warped image according to the pixel displacements and the depth map, wherein a warping level is associated with the depth map.
20. The image capturing device according to claim 12, wherein the image fusion module sets a first weight and a second weight respectively corresponding to the primary warped image and the secondary warped image according to the zooming factor, performs image fusion on the overlapping regions respectively in the primary warped image and the secondary warped image to generate a fused overlapping image based on the first weight and the second weight, and substitutes the overlapping regions respectively in the primary warped image and the secondary warped image by the fused overlapping image to generate the digital zoomed image.
21. The image capturing device according to claim 12, wherein when the zooming factor is greater than the primary-secondary image factor, the image zooming-warping module further enlarges the secondary rectified image to generate an enlarged secondary rectified image according to the zooming factor, performs image warping on the shrunken secondary rectified image to generate the secondary warped image according to the pixel displacements and the depth map, and sets the secondary warped image as the digital zoomed image, wherein a warping level is associated with the depth map.
22. The image capturing device according to claim 12, wherein when the zooming factor is less than 1, the image zooming-warping module shrinks the primary rectified image to generate a shrunken primary rectified image, performs image warping on the shrunken primary rectified image to generate the primary warped image according to the pixel displacements and the depth map, and sets the primary warped image as the digital zoomed image, wherein a warping level is associated with the depth map.
Type: Application
Filed: Dec 15, 2014
Publication Date: May 19, 2016
Inventors: Hong-Long Chou (Hsinchu County), Yi-Hong Tseng (Hsinchu City), Wen-Yan Chang (Miaoli County), Yu-Chih Wang (Tainan City), Tsan-Wei Wang (Taitung County), Yi-Yi Yu (Kaohsiung City)
Application Number: 14/571,021