APPARATUS AND METHOD FOR FOCAL LENGTH ADJUSTMENT AND DEPTH MAP DETERMINATION
20170374354 · 2017-12-28
Inventors
Cpc classification
B64U2101/30
PERFORMING OPERATIONS; TRANSPORTING
H04N13/239
ELECTRICITY
H04N23/959
ELECTRICITY
H04N2013/0081
ELECTRICITY
B64C39/024
PERFORMING OPERATIONS; TRANSPORTING
H04N13/271
ELECTRICITY
International classification
Abstract
A method for focal length adjustment includes capturing scene images of a scene using a first imaging device and a second imaging device of an imaging mechanism, determining a distance between an object of interest in the scene and the imaging mechanism based on the scene images of the scene, and automatically adjusting a focal length of the imaging mechanism according to the distance.
Claims
1. A method for focal length adjustment, comprising: capturing scene images of a scene using a first imaging device and a second imaging device of an imaging mechanism; determining a distance between an object of interest in the scene and the imaging mechanism based on the scene images of the scene; and automatically adjusting a focal length of the imaging mechanism according to the distance.
2. The method of claim 1, wherein determining the distance further comprises: obtaining a depth map of the scene from the scene images; selecting the object of interest in the scene; and calculating the distance of the object of interest according to the depth map of the scene.
3. The method of claim 2, wherein obtaining the depth map includes calculating a disparity of the scene images.
4. The method of claim 3, wherein calculating the disparity includes optimizing a global energy function.
5. The method of claim 4, wherein optimizing the global energy function includes summing a disparity energy function and a scaled smoothing term.
6. The method of claim 5, wherein optimizing the global energy function further includes obtaining the disparity energy function by accumulating a minimum disparity of coordinates for pixels in the scene images.
7. The method of claim 5, wherein optimizing the global energy function further includes, for all neighbors of a pixel, accumulating scaled trigger functions of a disparity between two neighboring pixels to obtain the scaled smoothing term.
8. The method of claim 2, further comprising optimizing the depth map by using a non-partial optimizing equation.
9. The method of claim 8, further comprising obtaining a Jacobi iteration of the non-partial optimizing equation by using a recurrence filtering.
10. The method of claim 2, wherein selecting the object of interest in the scene includes receiving outside instructions to select the object of interest.
11. The method of claim 10, wherein receiving the outside instructions includes identifying the object of interest selected on either of the scene images.
12. The method of claim 1, further comprising: aggregating data items in a plurality of directions to obtain a directional energy function for each of the directions; and accumulating the directional energy functions in the directions to obtain the energy function.
13. The method of claim 12, wherein aggregating the data items includes obtaining energy functions in a predetermined number of directions.
14. The method of claim 12, wherein aggregating the data items includes obtaining the directional energy function in one of the directions by summing a corresponding smoothing item and a dynamic planning in the one of the directions.
15. The method of claim 14, wherein summing the corresponding smoothing item and the dynamic planning includes presenting the dynamic planning of a pixel in the one of the directions with a recurrence based on the directional energy functions of neighbors of the pixel in the one of the directions.
16. The method of claim 15, wherein aggregating the data items includes calculating an energy by the recurrence based on the energy functions of the neighbors of the pixel in a horizontal direction.
17. The method of claim 1, further comprising reducing noise by performing at least one of matching the scene images or identifying respective unique features of the scene images.
18. The method of claim 1, further comprising compensating an error based on factors at least selected from a group consisting of baseline lines of the first imaging device and the second imaging device, an actual distance of two adjacent pixels, the focal lengths of the first imaging device and the second imaging device, and the depth between the object of interest and the first imaging device and the second imaging device.
19. A focal length adjustment apparatus, comprising: an imaging mechanism including a first imaging device and a second imaging device configured to capture scene images of a scene; a distance assembly configured to determine a distance between an object of interest in the scene and the imaging mechanism based on the scene images of the scene; and a focal length adjusting assembly configured to automatically adjust a focal length of the imaging mechanism according to the distance.
20. A non-transitory computer-readable storage medium storing program codes that, when executed by a computer, cause the computer to: determining a distance between an object of interest in a scene and an imaging mechanism including a first imaging device and a second imaging device based on scene images of the scene captured by the first imaging device and the second imaging device; and generating an instruction to automatically adjusting a focal length of the imaging mechanism according to the distance.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0149]
[0150]
[0151]
[0152]
[0153]
[0154]
[0155]
[0156]
[0157]
[0158]
[0159] It should be noted that the figures are not drawn to scale and that elements of similar structures or functions are generally represented by like reference numerals for illustrative purposes throughout the figures. It also should be noted that the figures are only intended to facilitate the description of the embodiments. The figures do not illustrate every aspect of the described embodiments and do not limit the scope of the present disclosure.
DETAILED DESCRIPTION OF THE EMBODIMENTS
[0160] Since currently-available focal length adjustment systems are incapable of providing an automatic focal length adjustment for imaging systems, a focal length adjustment apparatus and method are provided for adjusting focal length automatically and serving as a basis for a wide range of applications, such as applications on unmanned aerial vehicles (UAVs) and other mobile platforms. This result can be achieved, according to one embodiment disclosed herein, by a focal length adjustment apparatus 110 as illustrated in
[0161]
[0162] An example of images 199 of the scene 100 obtained by the imaging mechanism 130 are shown in
[0163] Although shown and described with reference to
[0164] The imaging devices 131, 132 of
[0165] Each of the imaging devices 131, 132 can sense light and convert the sensed light into electronic signals that can be ultimately rendered as an image. Exemplary imaging devices 131, 132 suitable for use with the focal length adjustment apparatus 110, include, but are not limited to, commercially-available cameras (color and/or monochrome) and camcorders. Suitable imaging devices 131, 132 can include analog imaging devices (for example, video camera tubes) and/or digital imaging devices (for example, charge-coupled device (CCD), complementary metal-oxide-semiconductor (CMOS), N-type metal-oxide-semiconductor (NMOS) imaging devices, and hybrids/variants thereof). Digital imaging devices, for example, can include a two-dimensional array of photosensor elements (not shown) that can each capture one pixel of image information. Either of the imaging devices 131, 132 can be, for example, an electro-optical sensor, a thermal/infrared sensor, a color or monochrome sensor, a multi-spectral imaging sensor, a spectrophotometer, a spectrometer, a thermometer, and/or a illuminometer. Furthermore, either of the imaging devices 131, 132 can be, for example, an Red-Green-Blue (RGB) camera, an ultrasonic camera, a laser camera, an infrared camera, an ultrasound camera or a Time-of-Flight camera. However, the imaging devices 131, 132 can be alternatively of the same type. Similarly, the focal lengths of the imaging devices 131, 132 can be the same and/or different without limitation to the scope of the present disclosure.
[0166] An exemplary first imaging device 131 and second imaging device 132 are shown in
[0167] In some embodiments, the focal length adjustment apparatus 110 (shown in
[0168] Although shown and described as being the UAV 400 in
[0169] Various communication methods can be used for remote communication between the imaging mechanism 130 and the focal length adjustment apparatus 110. Suitable communication methods include, for example, radio, Wireless Fidelity (Wi-Fi), cellular, satellite, and broadcasting. Exemplary wireless communication technologies include, but are not limited to, Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband CDMA (W-CDMA), CDMA2000, IMT Single Carrier, Enhanced Data Rates for GSM Evolution (EDGE), Long-Term Evolution (LTE), LTE Advanced, Time-Division LTE (TD-LTE), High Performance Radio Local Area Network (HiperLAN), High Performance Radio Wide Area Network (HiperWAN), High Performance Radio Metropolitan Area Network (HiperMAN), Local Multipoint Distribution Service (LMDS), Worldwide Interoperability for Microwave Access (WiMAX), ZigBee, Bluetooth, Flash Orthogonal Frequency-Division Multiplexing (Flash-OFDM), High Capacity Spatial Division Multiple Access (HC-SDMA), iBurst, Universal Mobile Telecommunications System (UMTS), UMTS Time-Division Duplexing (UMTS-TDD), Evolved High Speed Packet Access (HSPA+), Time Division Synchronous Code Division Multiple Access (TD-SCDMA), Evolution-Data Optimized (EV-DO), Digital Enhanced Cordless Telecommunications (DECT), and others.
[0170] Alternatively and/or additionally, the imaging mechanism 130 can be at least partially incorporated into the focal length adjustment apparatus 110. The imaging mechanism 130 thereby can advantageously serve as a component of the focal length adjustment apparatus 110.
[0171] As shown in
[0172] Referring now to
where c.sub.x and c.sub.y represent respective center coordinates of the imaging devices 131, 132, x.sub.i and y.sub.i represent the coordinates of the object 120 of interest in one or both of the images 199A (left) and 199B (right), Tis the baseline (in other words, the distance between the center coordinates of the imaging devices 131, 132), and f is a rectified focal length of the imaging devices 131, 132, i is an index over multiple objects 120 of interest and/or over multiple selected points of an object 120 of interest that can be used to determine the object distance Z, and d is the binocular disparity between the images 199A(1) and 199B(r), represented here as:
d.sub.i=x.sub.i.sup.l−x.sub.i.sup.r (Equation 4)
[0173] The focal length adjustment apparatus 110 can include any processing hardware and/or software needed to perform image acquisition, focal length adjustment, calibration, and any other functions and operations described herein. Without limitation, the focal length adjustment apparatus 110 can include one or more general purpose microprocessors (for example, single or multi-core processors), application-specific integrated circuits, application-specific instruction-set processors, graphics processing units, physics processing units, digital signal processing units, coprocessors, network processing units, audio processing units, encryption processing units, and the like. In certain embodiments, the focal length adjustment apparatus 110 can include an image processing engine or media processing unit, which can include specialized hardware for enhancing the speed and efficiency of image capture, filtering, and processing operations. Such operations include, for example, Bayer transformations, demosaicing operations, noise reduction operations, and/or image sharpening/softening operations.
[0174] In certain embodiments, the focal length adjustment apparatus 110 can include specialized hardware and/or software for performing focal length adjustment and parameter calibration. For example, specialized hardware and/or software can be provided for functions including, but are not limited to, reconstructing a three-dimensional depiction of the object 120 of interest using the two-dimensional images via stereopsis, determining whether a focal length adjustment is needed based on a distance between the imaging mechanism 130 and the object 120 of interest, determining an optimal focal length, conveying control signals to any components of the focal length adjustment apparatus 110 for focal length adjustment.
[0175] In some embodiments, the focal length adjustment apparatus 110 can include one or more additional hardware components (not shown), as desired. Exemplary additional hardware components include, but are not limited to, memories (for example, a random access memory (RAM), static RAM, dynamic RAM, read-only memory (ROM), programmable ROM, erasable programmable ROM, electrically erasable programmable ROM, flash memory, secure digital (SD) card, etc.), and/or one or more input/output interfaces (for example, universal serial bus (USB), digital visual interface (DVI), display port, serial ATA (SATA), IEEE 1394 interface (also known as FireWire), serial, video graphics array (VGA), super video graphics array (SVGA), small computer system interface (SCSI), high-definition multimedia interface (HDMI), audio ports, and/or proprietary input/output interfaces). Without limitation, one or more input/output devices (for example, buttons, a keyboard, keypad, trackball, displays, and a monitor) can also be included in the focal length adjustment apparatus 100, as desired.
[0176] In some embodiments, the image acquisition, focal length adjustment, calibration, and any other functions and operations described herein for the focal length adjustment apparatus 110 can be achieved by software running on a conventional processor or a general purpose computer, such as a personal computer. The software can be operated with suitable hardware discussed above as desired. The software, for example, can take any form of source code, object code, executable code and machine readable code. The source code can be written in any form of high-level programming languages, including but not limited to, C++, Java, Pascal, Visual B and the like.
[0177] Turning now to
[0178] As seen from
[0179] In an embodiment of the present disclosure, the depth estimation mechanism 7011 receives a first image 199A (shown in
[0180] An exemplary depth map 800 is depicted in
[0181] Returning to
[0182] In another embodiment, the object determination mechanism 7012 enables to receive outside oral instructions from, for example, an operator of the focal length adjustment apparatus 110. Optionally, the oral instructions can be a pre-set name of the object 120 of interest.
[0183] Alternatively and/or additionally, the object determination mechanism 7012 can be enabled to automatically determine the object 120 of interest based on a judgment under at least a pre-set rule. Any rule for the judgment can be set as desired. For example, the pre-set rule may comprise that the object 120 of interest is determined if the object 120 of interest is approaching the first and the second imaging devices 131, 132 and/or if the object 120 of interest is within a certain distance from the first and the second imaging devices 131, 132.
[0184] Based on the depth map from the depth estimation mechanism 7011 and the information about the object 120 of interest from the object determination mechanism 7012, the calculating mechanism 7013 can be enabled to calculate the distance between the imaging mechanism 130 and the object 120 of interest. In some embodiments, the calculating mechanism 7013 calculates the distance in real time.
[0185] Based on the calculated distance, the focal length assembly 702 can be enabled to automatically adjust the focal length of the imaging mechanism 130, for example, in real time, with a tracking learning detection method based on gray level information of the object 120 of interest serving as initial values.
[0186] If a user wants to focus the imaging mechanism 130 on a particular object, for example, the object determination mechanism 7012 can enable the user to draw a frame on the display showing the images of the scene 100 to frame in the object 120 of interest to be tracked. The frame can be in any suitable dimension, size or shape, including, but not limited to, a shape of a rectangular, a square or a circle or even an irregular shape. Optionally, the user can be enabled to click the display screen(s) to confirm the selection. By using the depth map 800 (shown in
[0187] Referring now to
[0188] A detailed process 901 of determining the distance between the imaging mechanism 130 and the object 120 of interest is illustrated in
[0189] In an embodiment, a depth map is obtained by calculating a disparity of scene images from the first and second imaging devices 131, 132. In the field of obtaining a depth map, an energy function is usually computed over a subset of the whole image. In one embodiment, a global energy function is optimized to obtain a disparity global energy. Specifically, the disparity global energy can be calculated by summing a disparity energy function and a scaled smoothing term.
[0190] An exemplary optimizing can be illustrated by the following equation:
E(d)=E.sub.d(d)+pE.sub.s(S) (Equation 5)
[0191] wherein d indicates the disparity between the first and the images of the scene, E.sub.d(d) is a data term, which indicates the disparity energy function and E.sub.s(d) indicates a smoothing term.
[0192] The data term E.sub.d(d) comprises a Birchfield-Tomasi data term which can be obtained in accordance with the equation:
wherein, I.sub.L represents the first image of the scene 100 captured by the first imaging device 131 and I.sub.R represents the second image of the scene 100 captured by the second imaging device 132 respectively; x in I.sub.L(x) represents a horizontal coordinate of a pixel in the first image and x′ in I.sub.R(x′) represents a horizontal coordinate of the pixel in the second image; (x, y) represents coordinates of a pixel in the scene 100.
[0193] The introducing of the Birchfield-Tomasi data term which is a data term often used in image sampling/matching resolves a problem of incorrect image matching by utilizing a matching precision of sub pixels, which is a pixel dissimilarity measure that is insensitive to image sampling. The contents of IEEE Transactions on Pattern Analysis and Machine Intelligence (1998) explaining the Birchfield-Tomasi data term is incorporated here by reference.
[0194] Other data terms may be adopted as the data term in Equation 5 when calculating the disparity global energy.
[0195] The smoothing term E.sub.s(d) can be presented by an energy function of differential of disparity, which can be obtained by, for all neighbors of a pixel with the coordination of (x,y), summing scaled trigger functions of a disparity between two neighboring pixels. Specifically, the smoothing term E.sub.s(d) can be obtained in accordance with the equation as follows:
E.sub.s(Δd)=Σp.sub.1T(|d(x, y)−d(x′,y′)|==1)+p.sub.2T(|d(x,y)−d(x′,y′)|>1) (Equation 11)
wherein, (x, y) represents the coordinates of the pixel of the first image and (x′,y′) represents the coordinates of the pixel of the second image; p.sub.2 and p.sub.1are two adjustable weights, and usually p.sub.2≧p.sub.1 and the summation sign is for all neighbors of (x,y) in which four domains are usually used, T is a trigger function which is triggered when the conditions in the parentheses are true.
[0196] In order to optimize the smoothing term E.sub.s(d), a fastest dynamic planning is utilized by aggregating data terms in a plurality of directions to obtain a directional energy function for each of the directions and accumulating the directional energy functions in the directions to obtain the energy function. In an embodiment, four or eight directions are selected to aggregate data terms. Other numbers of directions, such as three, five or ten directions, can be selected without limitation.
[0197] In an embodiment, an energy function in one direction can be obtained by summing its corresponding smoothing term and the dynamic planning in this direction. A dynamic planning in one direction can be presented by a recurrence based on the energy functions of its neighbors in this direction. For example, energy functions of one pixel's neighbors in the horizontal direction are presented as L(x−1, y, d), L(x−1, y, d+1), L(x−1, y, d−1) and L(x−1, y, d′). Specifically, an energy function in horizontal direction is obtained in accordance with the equation:
wherein, the energy received at the coordinates (x, y, d) is defined as L(x, y, d), which is presented as a recurrence based on the energy of neighbors L(x−1, y, d), L(x−1, y, d+1), L(x−1, y, d−1)and L(x−1, y, d′).
[0198] Furthermore, a best depth is obtained by seeking the disparity value that minimizes the summation of energy in a plurality of directions. In an embodiment, the best depth is obtained in accordance with the equation:
d*=argmin.sub.dΣL(x, y, d) (Equation 13)
wherein, d*indicates the best depth, L(x, y, d) indicates an energy function in one direction.
[0199] As an embodiment, some noise is reduced by matching the first and second scene images and/or identifying respective unique features of the first and second scene images while setting the disparity as −1.
[0200] The present disclosure also optimizes the depth map obtained by the depth estimation mechanism 7011. As described above, the global energy function is optimized by compensating errors of the depth estimation mechanism 7011. Specifically, the errors can be compensated by following equations:
by combining Equations 14 and 15, we get:
on the other hand, we have:
by combining Equations 17 and 18, we get:
wherein [0201] f=focal length (mm) [0202] D=depth (depth between the object and the imaging plane, mm) [0203] a=baseline (the distance between the central lines of the two imaging devices, mm) [0204] b=actual distance of two adjacent pixels (mm) [0205] d=disparity (measured in pixel)
[0206] Therefore, the depth estimation errors are within a range of [−x, x], and the estimated depth is in a range of [D−x, D+x]. The above error analysis and the compensation are based on following assumptions. For example, the error estimation is based on an assumption that camera calibration parameters are completely correct and an average error of the disparity map is a theoretical value for 1 pixel. An actual calibration can introduce errors, and a depth estimation error may exceed 1 pixel. Therefore, the above data of errors reflects a trend only. As a reference: an average error of a depth estimation in four testing maps by using the first ranked stereo matching process, Middelbury, is 1.29+0.14+6.47+5.70/4=3.4 (pixel). Even under a situation with no noise, no alteration of light beams and calibration parameters are correct, and the current best process presents an average error for all points as 3.4 pixels.
[0207] A few schematic charts showing the errors of the focal length adjustment apparatus 110 and the compensation effect for the errors are depicted in
[0208]
[0209] Although shown and described as being the non-linear relationship in
[0210]
[0211] Although shown and described as being the non-linear relationship in
[0212]
[0213] As shown in
[0214] In addition, triangles ADE and O.sub.1O.sub.2E are similar because CD is parallel to O.sub.1O.sub.2. Therefore, we can get Equation 15:
[0215] By combining Equations 14 and 15, we can reach Equation 16:
[0216] For same reasons, Equation 19 can be deducted from a combination of a similarity relationship of triangles AHO.sub.2 and a similarity relationship of FGO.sub.2 and O.sub.1O.sub.2C. In both Equations 16 and 19, D is the actual depth between the scene 100 and the imaging plane, a is the baseline between the two image devices 131, 132, b is the distance of two adjacent pixels and f is the focal length of the imaging devises 131, 132, as shown in
[0217] Although shown and described as being the same absolute value for −x and +x in
[0218] Based on the characteristics of the estimated errors shown in
E(d)=Σ|d(x,y)−d*(x,y)|.sup.2+Σexp(|I.sub.L(x,y)−I.sub.L(x′,y′)|+|x′−x|+|y′−y|)|d(x,y)−d(x′y′)| (Equation 18)
in which, d* (x, y) indicates the optimal depth map and d(x,y) is the estimated depth map; I(x,y) represents the intensity of the image; x,y are the coordinates of the pixel in an image coordinate; x′,y′ are the coordinates of an adjacent pixel of x,y in the same image.
[0219] Similarly to the operations performed by the object determination mechanism 7012 and the calculating mechanism 7013, in step 9012 of
[0220] A stereoscopic imaging system configured to conduct the aforementioned operations to perform automatic focal length adjustment can be obtained according to any embodiment of the present disclosure.
[0221] Furthermore, a computer program product comprising instructions for automatically adjusting focal length of a stereoscopic imaging system having at least two imaging devices in accordance with the aforementioned operations can be obtained according to an embodiment of the present disclosure. In some embodiments, the method for automatically adjusting focal length according to the present disclosure can be achieved by an ordinary computing device, such as a personal computer and/or a microcomputer.
[0222] The disclosed embodiments are susceptible to various modifications and alternative forms, and specific examples thereof have been shown by way of example in the drawings and are herein described in detail. It should be understood, however, that the disclosed embodiments are not to be limited to the particular forms or methods disclosed, but to the contrary, the disclosed embodiments are to cover all modifications, equivalents, and alternatives.