This application is the U.S. national phase of International Application No. PCT/GB2006/004602 filed 8 Dec. 2006 which designated the U.S. and claims priority to European Patent Application No. 05257796.2 filed 19 Dec. 2005, the entire contents of each of which are hereby incorporated by reference.
This invention is concerned with focus control and finds application in cameras, or indeed any optical device where the focus of an image needs to be adjusted.
Traditionally there are two approaches to auto-focus: Active (bouncing infra-red from the scene to calculate a distance) and passive (which maximises the intensity difference between adjacent pixels). One example of the second category is described by Geusebrock et al. “Robust autofocusing in microscopy”, Cytometry, vol 39, No. 1 (1 Feb. 2000), pp. 1-9. Here, a ‘focus score’ is obtained for images taken at different focus settings, and best focus is found by searching for the optimum in the focus curve. Both of these approaches have problems, including when the active beam is obscured by fog or mist, where cameras only focus at the centre of the frame, when there's low contrast across the image, or when the subject matter is horizontally oriented.
In application EP1286539A it was described a method of focusing in which a decision as to which part of an image to focus upon (i.e. the subject) is taken by analysing the image to obtain for each picture element a score indicating the degree of dissimilarity of the element and its environment from the remainder of the image: the subject is that part of the image having a high score (i.e. high degree of dissimilarity). The method of generating the score is discussed in greater detail in U.S. Pat. No. 6,934,415.
Some embodiments of the invention will now be described, by way of example, with reference to the accompanying drawings.
In
Focus control is performed by a control unit, in the form of a suitable program-controlled processor 4, which has access to a store 5 with storage areas 51 for buffering digital images captured by the pickup device 1 and a storage area 52 for a control program. It is also able to control the focussing motor 3 via a drive interface 6.
The operation of the control program in setting the focus is focussing is shown in the flowchart of
At Step 103 an image from the Image pickup device 1 is loaded into the buffer 51. This image is then subjected at 104 to visual attention analysis to produce a score S. Details of this analysis will be given below.
At Step 105, the score S is tested to see if it exceeds Smax: if so, then at 106 Smax is set to this new maximum value and the index kmax is set to the corresponding value of k; otherwise these values are left unaltered.
Then at step 107 the counter k is incremented and at 108 a check is performed as to whether the counter k is below a limit K. If this test returns the answer “yes” the process moves to step 109 where the motor 3 is controlled to move the lens focus setting by one step. If the “home” position of the lens corresponds to focussing on infinity then each step involves moving the lens to a position a little further from the pickup device 1. The process then repeats from Step 103, until the counter k reaches the limit K—that is to say, a number of steps that brings the lens to its “near” focussing position (furthest from the pickup device 1).
When the test at 108 returns “yes”, this means that all K focus positions have been tested, the maximum score is held in Smax and, more particularly the index kmax indicated the number of steps from “home” at which this maximum score—which is deemed to correspond to the optimum focus setting—was found. All that remains, therefore is (Step 110) to move the lens to this position—either directly or by returning the lens to the “home position and then issuing kmax step commands to the motor.
One the focus has been set, a photograph may then be taken in the usual way. Alternatively, if desired, (for a digital still image) if one retains all the trial images captured at step 103 in the buffer 5, one could then simply select the image from the buffer that corresponds to the index kmax.
The above example showed the invention in use in a still, digital camera; naturally it could also be applied to a video camera that captures moving pictures. It could be applied to a camera that takes photographs on conventional film, or any optical device that focuses a real image: In those cases of course the pickup device would be additional to the existing camera.
Turning now to the analysis at Step 104 that generates the score S, this is similar to the process described in U.S. Pat. No. 6,934,415, which analyses an image to generate for each pixel x a visual attention measure Cx. Here however it is required only one measure S for the whole image, which can be obtained simply by taking the sum of all the measures Cx for the individual pixels.
If it is desired to focus preferentially on the centre (or any other defined area) of the image, then S could be the sum of measures in respect of just those pixels that lie within the central (or other) area. If preferred, in the interests of speeding up processing, the score could be generated not for every pixel in the image (or area under consideration) but for a subset of those pixels, subsampled on a regular grid, or at random.
The method of generating S will now be described in detail with reference to the flowchart of
The image stored in the buffer 51 is arranged as an array A of pixels x where each pixel has colour intensities (rx, gx, bx) attributed to it. Initially the score S is set to zero (Step 201).
A pixel x0 is then selected from the array A (Step 202), and its intensity value (rx, gx, bx) is stored in a test pixel register. A count of the number of pixel comparisons Ix (stored in a comparison counter) is set to zero (step 203).
The next step (205) is the random selection of a number of points in the vicinity of the test pixel x0. This region is defined by a distance measure ux (typically in units of pixels). Thus, n pixels xj are selected such that
dist(xj−xj-1)<ux
The distance used may be any of those conventionally used, such as the Euclidean distance or the “city block distance between the positions within the image of the two pixels. If the horizontal and vertical coordinates of xj are p(xj) and q(xj) then the Euclidean distance is
√{square root over ([p(xj)−p(xj-1)]2+[q(xj)−q(xj-1)]2)}{square root over ([p(xj)−p(xj-1)]2+[q(xj)−q(xj-1)]2)}{square root over ([p(xj)−p(xj-1)]2+[q(xj)−q(xj-1)]2)}{square root over ([p(xj)−p(xj-1)]2+[q(xj)−q(xj-1)]2)}
whilst the city block distance is
|p(xj)−p(xj-1)|+|q(xj)−q(xj-1)|
Typically n=3, and ux=1. For ux=1, the pixels are contiguous, but, in general the pixels may not necessarily neighbour one another or be contiguous in any sense.
A pixel y0 is now selected randomly (step 206) from the array A to be the current comparison pixel whose Identity is stored in a comparison pixel register.
The value of Ix stored in the comparison counter is incremented (step 207): if a limit L is exceeded, no further comparisons for the test pixel x are made: either another pixel is selected (Step 208) and processed from Step 203, or if all (or sufficient) pixels have been dealt with, the process terminates.
Assuming that L has not yet been exceeded, the contents of the neighbour group definition register are then used to define a set of pixels forming a test group xj and a set of pixels forming a comparison group yj, each pixel yj of the comparison group having the same positional relationship to the comparison pixel y as the corresponding pixel xj in the test group has to the test pixel x (Step 209).
The calculation processor then compares each of the pixels xj with the corresponding pixel yj, using a set of threshold values Δrx, Δgx and Δbx.
A pixel y is identified as being similar to a test pixel x if:
|ry−rx|<Δrx and
|gy−gx|<Δgx and
|by−bx<Δbx.
If all the pixels Xj in the test group are similar to their corresponding pixels V1—in the comparison group, the process is repeated by selecting a new set of neighboring pixels (Step 205) and a new comparison pixel y0 (Step 206). If one, or more pixels Xj in the test group are not similar to the corresponding pixel y, in the comparison group, in accordance with the similarity definition above, the score S stored in the anomaly count register is incremented (Step 210). Another comparison pixel y0 is randomly selected and stored in the comparison pixel register (return to Step 206) and the neighbor group definition retrieved from the neighbor group definition store is used to supply a new comparison neighbor group to the comparison group register for comparison with the test group stored in the test group register. A set of pixels Xj is retained in the test group register so long as it continues to fail to match other parts of the image. Such a set represents a distinguishing feature of the locality of x—the more failures to match that occur, the more distinctive it is. The more comparison pixels y that the test pixel x fails to provide matches for, the higher the score S becomes.
When the process has finished, the final value of S is the measure of visual attention for the image Al x, and is the number of attempts (from a total of number of attempts equal to L multiplied by the number of pixels considered) for which the inherent characteristics (i.e. the colors) of randomly selected neighbors of pixel x failed to match the corresponding neighbors of randomly selected pixels y. A high value indicates a high degree of mismatch for pixels of the image with the rest of the image.
As noted above, the process may be repeated, from step 203, for every pixel in the image as the test pixel, so that the value S is in effect the sum of scores for every pixel x in the array A. Typically, L may be set to be 100.
As described above, comparisons are performed for the neighboring pixels Xj, yj, j=i, . . . n; however, if desired, the original or root pixels may also be included, the comparisons being performed for j=0, . . . , n.
Note too that, whilst preferred, it is not essential that the analysis loop of
Note that where subsampling is used as discussed above, only a subset of pixels are chosen as pixels x; however it is preferable that the neighboring pixels are chosen from the full image
A Canon EOS 300D camera was used to photograph the same scene whilst focusing at different distances, from 11 cm to 39 cm, as shown In
Thus we see that, by computing a total VA scores for the entire image a measure of overall interest can be found. In turn, if the total score is compared against multiple candidate images, it can be used to help decide which is most interesting, and possibly best if used to control a camera's auto-focus.
However, by computing the global interest level within each frame, then slightly changing the focus, it's possible for the camera to quickly lock onto the focus distance at which the frame is most interesting. Indeed, this could be used to determine the depth of field of the image, by seeing how much the focus can be changed without a significant drop in overall score.
There are a huge number of other applications—anywhere where there are parameters that need changing to optimize an output image could potentially benefit from VA being used to automatically choose the best values.
| Number | Date | Country | Kind |
|---|---|---|---|
| 05257796 | Dec 2005 | EP | regional |
| Filing Document | Filing Date | Country | Kind | 371c Date |
|---|---|---|---|---|
| PCT/GB2006/004602 | 12/8/2006 | WO | 00 | 5/30/2008 |
| Publishing Document | Publishing Date | Country | Kind |
|---|---|---|---|
| WO2007/071918 | 6/28/2007 | WO | A |
| Number | Name | Date | Kind |
|---|---|---|---|
| 4646352 | Asai et al. | Feb 1987 | A |
| 5113454 | Marcantonio et al. | May 1992 | A |
| 5200820 | Gharavi | Apr 1993 | A |
| 5303885 | Wade | Apr 1994 | A |
| 5703968 | Kuwahara et al. | Dec 1997 | A |
| 5790413 | Bartusiak et al. | Aug 1998 | A |
| 5825016 | Nagahata et al. | Oct 1998 | A |
| 5867813 | Di Pietro et al. | Feb 1999 | A |
| 5978027 | Takeda | Nov 1999 | A |
| 6091844 | Fujii et al. | Jul 2000 | A |
| 6094507 | Monden | Jul 2000 | A |
| 6111984 | Fukasawa | Aug 2000 | A |
| 6240208 | Garakani et al. | May 2001 | B1 |
| 6260059 | Ueno et al. | Jul 2001 | B1 |
| 6266676 | Yoshimura et al. | Jul 2001 | B1 |
| 6282317 | Luo et al. | Aug 2001 | B1 |
| 6304298 | Steinberg et al. | Oct 2001 | B1 |
| 6389417 | Shin et al. | May 2002 | B1 |
| 6480629 | Bakhmutsky | Nov 2002 | B1 |
| 6483937 | Samuels | Nov 2002 | B1 |
| 6499009 | Lundberg et al. | Dec 2002 | B1 |
| 6590937 | Ogura et al. | Jul 2003 | B1 |
| 6778699 | Gallagher | Aug 2004 | B1 |
| 6934415 | Stentiford | Aug 2005 | B2 |
| 6996291 | Nahum | Feb 2006 | B2 |
| 7142689 | Hayashi et al. | Nov 2006 | B2 |
| 7546236 | Stentiford | Jun 2009 | B2 |
| 7620249 | Stentiford | Nov 2009 | B2 |
| 20010013895 | Aizawa et al. | Aug 2001 | A1 |
| 20010030759 | Hayashi et al. | Oct 2001 | A1 |
| 20020081033 | Stentiford | Jun 2002 | A1 |
| 20020126891 | Osberger | Sep 2002 | A1 |
| 20020168117 | Lee et al. | Nov 2002 | A1 |
| 20040130733 | Morita et al. | Jul 2004 | A1 |
| 20050031178 | Park | Feb 2005 | A1 |
| 20050074806 | Skierczynski et al. | Apr 2005 | A1 |
| 20050143976 | Stentiford | Jun 2005 | A1 |
| 20050169535 | Stentiford | Aug 2005 | A1 |
| 20060050993 | Stentiford | Mar 2006 | A1 |
| 20070116354 | Stentiford | May 2007 | A1 |
| 20080075372 | Stentiford | Mar 2008 | A1 |
| Number | Date | Country |
|---|---|---|
| 0098152 | Jan 1984 | EP |
| 1126411 | Aug 2001 | EP |
| 1 286 539 | Feb 2003 | EP |
| 1 286 539 | Feb 2003 | EP |
| 1286539 | Feb 2003 | EP |
| 1 533 996 | May 2005 | EP |
| 1 533 996 | May 2005 | EP |
| 1417721 | Dec 1975 | GB |
| EP1286539 | Feb 2003 | GB |
| 03-238533 | Oct 1991 | JP |
| 03-238566 | Oct 1991 | JP |
| 06-245064 | Sep 1994 | JP |
| 07-027537 | Jan 1995 | JP |
| 10-260773 | Sep 1998 | JP |
| 2000-207420 | Jul 2000 | JP |
| 2000-512790 | Sep 2000 | JP |
| 02-50066 | Feb 2002 | JP |
| 2003-187217 | Jul 2003 | JP |
| 8201434 | Apr 1982 | WO |
| 9003012 | Mar 1990 | WO |
| 9905639 | Feb 1992 | WO |
| 9847061 | Oct 1998 | WO |
| 9960517 | Nov 1999 | WO |
| 0033569 | Jun 2000 | WO |
| 0131638 | May 2001 | WO |
| 0161648 | Aug 2001 | WO |
| 0221446 | Mar 2002 | WO |
| 02098137 | Dec 2002 | WO |
| 03081523 | Oct 2003 | WO |
| 03081577 | Oct 2003 | WO |
| 2004042645 | May 2004 | WO |
| 2004057493 | Jun 2004 | WO |
| 2005057490 | Jun 2005 | WO |
| 2006030173 | Mar 2006 | WO |
| 2006131701 | Dec 2006 | WO |
| 2007012798 | Feb 2007 | WO |
| 2007071918 | Jun 2007 | WO |
| Number | Date | Country | |
|---|---|---|---|
| 20090310011 A1 | Dec 2009 | US |