AUTOFOCUSING
Field of the Invention
The present invention relates to a method for estimating in an optical system the distance between an object and a focal plane belonging to a first image which reproduces the object according to the preamble of claim 1, an arrangement in an optical system according to the preamble of claim 13, a memory medium comprising a computer program according to the preamble of claim 16, a microscope system 'according to claim 18, a method for processing a digital image according to the preamble of claim 19, a computer program according to claim 20 and a digital memory medium according to claim 21.
Cross reference to related applications: This application claims benefit from Swedish patent application no SE-0004046-9, filed November 1 , 2000, and US provisional patent application no US-60/263914 , filed January 25, 2001. Background Art
Optical systems, such as microscopes, should be focused, i.e. the interesting object or the interesting part of an object should be within the focal depth of the system. This can normally be achieved by adjusting the optics of the system or by moving the interesting object.
As regards scanning microscope systems, the problem of focusing is particularly pronounced. One example of using such a scanning system is when scanning of a medical specimen, such as a blood smear on a slide, is carried out with a wholly or partly automated microscope. A large number of digital microscope photographs of cells (for example white blood cells) are taken to find out whether cells of pathologic character are present in the specimen.
The scanning optical system must then supply images at high speed while at the same time the images supplied
must be well focused as regards interesting objects within the field of view of the image. Between two consecutive images, the specimen is moved transversely to the optical axis of the system so that a new field on the slide can be reproduced.
In such scanning, continual refocusing are necessary, since the slide is seldom plane and since the mechanism which moves the object transversely cannot be assumed to be perfect in the sense that no displacement along the optical axis occurs. If the system should be able to supply new, well-focused images at, for instance, the frequency 50 Hz, focusing must take place both quickly and in a reliable manner.
The focusing can be said to have two steps. In a first step, the focus deviation, i.e. the distance between the focal plane of the optical system, in which plane the system reproduces objects with an optimal sharpness, and the object is estimated. In a second step, the optical system can be adjusted, or the reproduced object can be displaced so as to get closer to the focal plane of the optical system. The small displacements that are necessary to carry out the second step can be provided in a relatively reliable manner by means of geared stepping motors or with piezoelectric crystals. A comparatively more difficult problem is to provide, in the first step, in a quick, easy and inexpensive manner, a reliable estimate of the focus deviation.
The estimate of the focus deviation is based on a focus measuring principle, i.e. a method which generates a focus measure, i.e. a measure of how well-focused the system is. The focus measuring principle can be active or passive, as will be explained below. The focus measure can be relative, for instance the random sample variance of the pixel intensities of the image, or absolute, i.e. a direct measure of the focus deviation.
An example of an active focus measuring principle is to use infrared light which is emitted by the optical
system and which is reflected by the object that is to be reproduced. Such focus measuring principles are used in many still cameras with autofocusing. The drawback of such a principle is, except that it requires an extra light source, extra optics, extra sensors and special calibration, that it functions in a satisfactory manner only if it is the interesting object or partial object in, for example, a sample which reflects the infrared light and not, for example, a cover glass applied to the sample .
From now on only passive focus measuring principles will be discussed. When passive focus measuring principles are used, use is made of the information from one or more receiving image sensors to obtain a focus measure. A good relative focus measure should then have its maximum or minimum at the optimal focus. An example of focus measures in passive measurements is the pixelwise sample variance in an image . A poorly focused and thus more blurred image will then give a lower sample variance than a better focused and, thus, more contrasty image.
However, it is not sure that it will be possible to estimate the focus deviation only on the basis of one such image. It may be that the imaged object per se is fairly poor in contrast and thus gives a low sample variance, which indicates a great focus deviation although the image is comparatively well focused. Even if this is not the case, it is not possible to know from a single value of the sample variance in which direction the imaged object is to be moved in order to obtain the optimal focus. A system based on such a focus measuring principle will therefore be adjusted in the wrong direction in the first attempt in 50% of the cases and will therefore be slow. Besides a scanning microscoping stops.
A possible method of making such a focus measuring principle quicker is to supply the system with extra optics which enables calculation of focus measures in several image planes at the same time. An example of such
1 XI 3 d 4-1 1 d d υ 01 P" r-l Ti CQ -H
Φ 0 tn -H d Φ -H fjl 0 CQ d 0 Ti 4-1 Φ CQ
90 CO Φ -P CQ φ 0 d d XI rH -H 1 1 4-1 Ti d 4-1 fd Φ 0 d 4-1 rH d 1 -H -H χ| -H Φ
U 0 d ti TJ -H rd is rd CQ 0 U P Φ -H U u M rd rd 0 CQ 4-1 Ti 4-1 xi
Φ φ -H d φ φ Φ 4-> υ -H ti O ft 3 Ti >. Ti Φ X. d υ -H O Φ 4-1
© en rC! d 3 4-1 CQ rH td 4-1 Φ -H ti U 3 r4 3 d Ti CQ rd 4 fjl Φ Ti φ 3 4-1 d fd EH a rd -H rd 3 0 fjl 4-) f O 0 Φ fd o -H CQ XI rd rd Φ
3 u U φ I 0 -H rd ft & -H t
3 3 O u 4-) ti rd 4J ^ CQ φ 4 4-1 XI rH > in -H • ti Φ 4-) XI 4-1 4J 3 0 0 O υ CQ 4J ft fd φ Φ xi O 4->
∞ ft rd
H φ CQ ft d CQ CQ -H CJ rd o rd 3 rd u φ 4-> f l >, xi - 4-1 xl U Φ Φ xi 3 03 •H Φ Φ r d 4-4 φ CQ ti rd TJ rd X. 4-> o Φ -JJ rH α. Φ d tn φ 0 ft 4-) rd 3 Ti 3 CQ -n XI Φ 3 4-1 Φ ϋ rd rH
5H fd -H 4-> d CQ P
" 4J ti CQ P
~ d Ti
Φ rH X. XI 4-1 4-> -H Ti TJ fd φ ti rd CJ rH xi r-l I CQ -H J-l CQ o rd ti
^ -H rd 0 rH rH 4-> fd 0 u rd Φ d XI d tJ) 4-1 0 -H
EH ft ) Φ rd CQ 4-1 -H H TJ XI rd rd υ -H d J 4J -H rd 4-1 fd Φ 4-1 rd CQ CQ Φ -H d 4-1 Φ .. 4-> s
3 4-1 rH -H d xi -H O CQ 4-1 rH Ti
• Φ rH rd 3 TJ φ 3 3 SD φ -H -H φ J rd £ rH ti -H 4-> Ti ft Xi Φ 4-> en fd rH Xi d rH d 0 Φ rd -H r-i 3 rd fjl ti ft TJ -H Ti CQ d CQ 4-1 CQ ϋ σ. ϋ rH ϋ Φ CQ 0 X. 3= rd rH -H 0 d φ Φ Φ 4-1 O ti rd rH -H O Φ D 0 rd P 3 Φ -H 4-> 4-> 0 rH M 3 fd u Ti d Φ fjl N d 3 -H rd XI CQ XI ■r-ι
». 4-1 CQ φ CQ o 4-> • Φ Φ 4-> U 0 -H 0 d Φ fd -H rd Φ 4-1 -. ϋ 4-> φ £ X! m Φ φ O d CQ 3 X! 3 rd ~ 0 rd -H rd & 3 ti rH XI CQ ft O CQ O
H Φ H ϊ X! 4-1 φ 3 fjl 0 Φ rH co 4-1 4 -P Φ ft 4-> -H φ ti 4-! 4-1 a CQ σ\ 0 φ CQ 4-> > Φ rd ^ d 4 3 υ H TJ
» d d Φ 4J XI fd O Φ rH td X. > rd tn d rH Φ -H jl d φ -H X! 4J CJ x- 4-1 Φ 4 XI φ 3 tn rd
IT) ti rd 0 Φ φ d -H X! υ tn tn rd 0 3 d rd > CQ rd fd O fjl CQ XI CQ • φ rd -H
1 rd φ 3 υ -H 0 X. d d d 4J -H -H ^ d ti ti U rd 4-1 - -H Φ 4-1 3 4-1
^ <! a Φ d 4J 4-) ti rd 0 -H ^ rd Ti o -H Ti 0 -H rd O φ 3 rd i CQ u CQ -H
1 φ ti 0 4-> -H rd d ft TJ 4J rH TJ m 01 rH C 0 -H 4-i X! 4-1 d -H X! rH Ti rd d rd w CQ rd s ϋ CQ x— Φ Φ Q Φ r4 H d υ 0 Φ XI 4-1 υ rd 4 H d X. rd CQ Ti ft
ID Φ P 03 Φ > -H X! 0 -H u 3 X. 4-> rd rd rd rH 4-1 fd rd 4 d φ CQ • ti CQ u Φ Φ TJ o 3 Ti o υ -H 4-> φ -H CQ ft CQ 0 P Φ CQ Φ 0 Ti d φ 3 >i ti rH d r4 0 -H φ υ -H rH 4-) rd rd 3 O -H CQ ti CQ tJ1 4J xi -H XI CJ φ
-H ti Φ 4-> 0 φ rd 0 ft X! x. d rd rd O rH ^ Φ 4J rd rH -H φ ϋ 4J Ti 4-1 φ u i 4-> •H Ό c -H rd u 0 rd rH o fjl φ U . rd Ti J X! rd 4-1 Φ Φ w
Ti +J CQ !*! rd 4-) Φ fd rH J u υ d jl x- rH fjl 0 υ Φ >i •r-i d d -. Ti
Φ >i φ rH d d XI Φ ft u fd -H fd O C rH 0 CQ d xi Xi O Φ ti rH X. 0 & CQ Ti 0
CQ ! CQ rH rH Φ Φ 4-> XI CQ d Φ 0 Ti 3 4-) rd 4-> P -H 4-> U 4-1 XI rji rH O o Ti d ti
0 4-> J rH X 0 rH -n 4-1 3 r4 -H 3 υ O Ul Φ -H 4J Φ rd Ti d ti rd ft rH ■rH I & I > 4-) -H
3 d rd d 4-1 -H rd X! rd O fjl -H -H 4J o d 3 XI Φ Ti •H Φ Φ : O φ
U & U 0 Φ ti H o φ 4-1 4-) u 0 tn ti υ rH d rd 4-1 o 4H 0 a XI 4-1 4J i 4J £ 4J ti
CO P u -H φ 4-1 υ fd o d fji u rd -H rH -H φ rH φ 4-) O rd d 4-> td i CQ
-H CQ υ > φ Φ 4-> rd Φ -H 4-. Φ -H 0 rd 4-> Ti O u ft Φ Φ XI -. φ 3 -H Φ ti φ
TJ Ti Ti -H φ XI XI υ d -n X! TJ n S-l φ CQ XJ X! EH TJ 3 CQ >. CQ d -H rd rH -H XI φ 4-1 φ 4-1 CQ 4-> 4-) φ -H X. Φ rd 4-) H ft 3 CJ) O O ft rd 4J φ O CQ X! CQ Φ 4-1 CQ ft 4-1 4->
CQ CQ 0 CQ 4-J 0 -n 3 0 TJ o φ -H υ 4-1 CQ Φ • CQ ti Φ φ Φ CQ 3
-H P rd P U) 4-1 X. -H Tf CQ υ 4J TJ u 4-) f l d 4-> P" 4-1 d fjl £ Φ Ti -H Φ 0
CQ φ CQ d XI ■ 0 O rH CQ CQ d Φ υ Φ CQ rd fjl Φ CQ d fd U ft d φ 4-> d CQ XI 4J
£ φ M ti 0 Φ Φ -H P rd o rd 4J rd d ti S-i -H rH Φ CQ Φ ti -H rH Φ CQ rd 4-1
Φ rH ϋ u 3 d rd u d XI U 3 p" CQ 3 0 -H 4-1 ft •H U rd CQ fd X! -H d 4-1
4-1 rd rd d -H Φ d ti <; EH O 4-) TJ 3 & jl rd TJ s 4-1 rd X! d XI CQ d H 4-1 CQ
CQ X. -H 0 rd rd rd rH 4-1 υ 0 φ £ Φ d ti 3 rH O Φ rd CQ φ φ Φ Φ 0 O Φ
>i CQ 4-1 4-1 XI -H 3 4J Φ ti 4 O ft •H fjl o rd -H rd tjl 4-1 u tjl CJ tn -H CQ
CQ ti rd f H d 4-) H 3 Φ •r-i ft CQ υ O CQ O υ 4-> υ Φ rd CQ φ 0 fd d td 4-> Φ O o
0 0 M d φ 0 -H rd 3 rd XI X! φ >i o CQ k υ 0 CQ 0 XI 3 •H XI ti 3 rd 3 rd d rH rd CQ Ti rd ft u & n ft 4-1 0 CQ rd CQ Φ ft rd 4-> Φ 4-1 4-> -H Ti 4J ft 4-1 -H CJ 0 J o O
sharpest appearance. How much the sharper image has to be made more blurred (or the more blurred image be made sharper) in order for the two images to have the same sharpness is a measure of how much closer to the partial object the focal plane of the sharper image is positioned. If the first and the second image are equally sharp/ unsharp, it may be assumed that the partial object is positioned midway between the focal plane of the two images. If the relative distance between the focal planes is known, the distance between each of these and the partial object can be estimated.
Such a method has appeared to produce reliable estimates very quickly. The estimates provide information, not only about the degree of a focus deviation, but also about what sign it has, i.e. in which direction the optics of the system or the object is to be adjusted. Normally no extra optics is necessary to accomplish the system, which results in an inexpensive measuring method.
Preferably, the method further comprises the steps of generating a first set of secondary images based on the first image, by different degrees of modification of the sharpness in the first image; estimating a first set of correlations between overlapping parts of on the one hand at least a subset of said first set of secondary images and, on the other hand, the second image; identifying the degree of modification of the sharpness which results in the greatest among said correlations, where- upon the identified degree is used when estimating the distance between the object and the focal plane of the first image.
Correlation between overlapping parts of two images yields a very good measure of how equal the sharpness in the images is.
According to a preferred embodiment, the method further comprises the steps of generating a second set of secondary images based on the second image, by different degrees of modification of the sharpness in the sec-
φ 1 CQ CQ 4-1 φ CQ 4-1 i CJ CQ Ti d td XI -H 0 φ rH rd 4-1 0 CQ 1 d rH td xi 4-1 ~ Φ 1 * rH 1
90 CQ d rd 0 4-1 44 Φ φ 4-1 CQ X! 4J CQ 1 CQ CQ Φ rd fd fd
Tf d 4-1 d d 0 ti -H 0 0 CQ -H 3 4-1 CQ ■ 4J U Φ CQ CQ d d CQ XI 4-1 Φ ϋ f 0 CQ 0 0 -H Φ 4-1 CQ -. . Ti 0 Φ ti Φ XI Φ -H . Φ rd Φ 4 XI Φ -H . o -H rd -H 4-> T! rd fjl Φ Φ rH S 0 d φ 4-1 4-1 d Ti > ti d d 4-1 > 4-1 Φ
4-1 Φ x 4-1 rd ■H rH d d d Φ CQ X! xi d ft 4 0 X! ft CQ 0 fi 4 ft d rd 0 -H Ti ω rd rH Ti rd rH CQ Φ -H fd ft CQ • 4J 0 rH rH 0 4-1 ti CQ XI -H ti -H u 4-1 a Ti rd
! - rH d CJ Φ d ti rH rH ti Φ Φ >1 ti φ -H rd -H 4-1 0 rd Φ 4-1 rH rd 0 0 £
H Φ 4-1 td -H ti 0 ti P ft td rH d rH φ 3 4-1 XI 4-4 d rH Xi d Φ 4-1 Φ XI Ti d 3 ζj ti rd 4H ti α O CQ X! ft X. 4-> rd CQ φ rd CQ CQ ft £ d -H CQ Φ 0 d . φ
0- ti CQ -H 0 υ rd rH CQ CQ ti rd rH φ CJ d 3 -H Φ ti Φ ti £ -H 0 CQ CQ X!
0 Ti φ 4-1 0 0 φ rd CQ rd rH -H rH -H Φ rd φ -U d Φ rd M CQ P φ ti 4J -H d CQ ϋ d tn d 4-1 4-1 3 ϋ Φ Φ XI Φ 4-1 ft 4-1 xi -H ti ti rd XI XI CJ Φ 0 XI 0 rd 4J 0 Φ 0 td rd Φ 4-1 d 0 0 XI d CQ 4-1 3 -H 4J CQ P rd rH 4-1 CQ -H ti &. 4-1 4-1 £ rd •H d 4-1
4H XI 3 Ti 0 -H φ 4-1 4-1 ft Φ >~ -H Ti CQ CQ ft ft P ft ti ti ϋ 4-> ft
0 -H -H CQ 4-1 ti φ ti d CQ O 4-1 P rd >1 φ J1 Φ 4-1 Φ 0 -H td ti Φ φ 4-> d 4-1 rd Φ 4-1 rd X! ft td 3 0 rd φ Φ rH rH Xi Φ ti 0 ft 4-1 4-1 rH fd ti
4-> d Ti φ Φ Φ ti XI O XI 4-1 ■H Ti CD 3 XI rd d 4-1 rd XJ rd CQ -H Φ xi rd
Φ o ti ■H CQ . CQ P 4-1 CQ x CQ d φ Φ 4 ϋ 0 4-1 d Φ d Ti ti CQ
CQ rd rd rd J d 4-1 CQ CQ fd XI CQ Φ φ 0 4-4 CQ φ 0 rH rd 0 ti CQ
Φ Ti CQ Ti 4-1 TJ ϋ Ti 0 Φ 0 CQ 4J rd CQ 4-> CQ 4-1 4-1 0 -H 4-1 tn -H td ti 3 0 1 Φ
Ti XI d d d fd d -H XI Φ rd M φ ti rd rd •H 0 rd 4J 4 ϋ d 4J d 4-1 0 d 0 O 0 td -U 4-1 d d tn u -. ti Φ ti φ d XI £ td CQ ti fd rd
0 CJ Φ CJ Q o rd fjl 0 ft -H 4J ϋ P tn > d 0 CJ -U -H CJ d ti φ 4-1 £ £ u d φ XI φ rH Φ rH 4-> J tn d -H ti >i P Φ d d d ϋ d -H φ -H -H d -H 0 φ -H 0 -H φ 0 CQ EH CQ fd CQ Φ ϋ -H d -H 4-> rd rH tJ tn φ -H ■H J 0 4-1 > 4-1 XI φ TJ 4-H -H -H CQ 4-1 4-1 > CQ • Φ 4-1 -H ti rd X! Φ td £ rd rH O φ rd £ £ d -H 4-1 rd φ -H CQ
4-1 4-1 • TJ CQ Ti Φ -H •r-i -H CQ ti CJ CQ 4-1 . 3 -H d Φ • CJ -H 0 Ti td P φ 4-1 Φ rd 0 o Φ -H -H d P 4-> X. Ti rd 2 -H td rH -H Ti rd rH CQ CQ ft TJ -H -. Ti J 0 rH 0 rd Ti tn rd rd rH rd 0 o φ rH 4-1 φ 3 Φ o Φ & rd CQ φ φ 4-1 d 0 φ £ Φ m CQ 3 0 d tn CQ 4-1 rd CQ 4-1 rd ti 3 ti X. -H xi -H Φ 4-1 4 0 Φ tn -H -H o CQ ti -H i O d 4-> Φ 3 -H 4-1 > rd Φ Ό Ti 4-1 X -H XI g CQ fd rH Φ ti rd 4-1 Ti -H £ TJ ti Φ 0 4-1 4-> -H
-H ti CQ ■H 3 CQ ft xi φ Φ CQ 0 0 4-1 4-1 φ rd 3 rH ϋ £ -H 0 4J φ φ -H 0 XI rH CQ Φ 4
4J td 0 ». ti 4-1 3 4-1 xi Ti rd 3 4-1 ti rd Φ -H rd d Φ -H TJ £ P~ X! td U 4J rH Φ £ rd rd ft i 4-> ti Φ -H CQ O 4-1 o ft o φ rH X fd X! 0 rH φ 4-1 CQ rd rH
3 d CQ 4-4 4-1 4-1 Φ o d >i 0 φ ft rd 4-> d 0 4 4-1 4-1 Ti £ Φ 0 d 4-1 4-1 ti rH Φ
-H tjl 0 rd 4J Φ Ti X. 4J XI φ fd ft 0 4-1 ti d CQ d XI 0 TJ X! 0 H CQ Φ φ ti
4-> d J -H tn 3 Ti rd rd Φ d 4-1 CQ £ Φ rd a Φ ■H d 0 CQ 4-> d a ϋ -H -H M ti
CQ -H Φ 4-1 d -H -H Φ £ rd Φ Ti rd ti 0 CQ 0 ft 3 Ti φ J -H 0 0 rd -H Φ • Xi CQ ϋ 0
Φ ft CQ -H 4J rd ti CQ 4-1 Ti φ -. φ 0 CJ -H 4-1 CQ rd -H φ φ ^ J 4-> XI 4-1 d 4-> rd -H CJ ft Φ 4-1 CQ CQ tn Ti Φ Φ td ti i ti 0 Ti Ti Ti £ CQ Φ >ι 4-> £ rd -H Φ P
Ti fd Ti i ti Φ rH XI tn 3 ti rH υ x rd d tn rH d 0 φ 4J tn rH ι tn CQ £ rd -. J i d rH -H J rd 4-1 Φ Φ rd φ X. Φ d φ rd Φ Φ rd X) X. d ti rH -H 3 Ti d rd ti fd 4-1 TJ o xi -H φ 3 φ 4-1 rd Ti rd CQ J -H -H g 0 X. Xi £ rd -H -H φ 4-> 0 rH d rd fd φ CQ CQ -H 4-1 1 ϋ -H Xi Φ ti ■H -H Ti Ti >i 4H φ ■H 4-1 -H ti 4-> TJ 4-1 4-1 CQ TJ M rd
■•- 3
> Ti rd XI d ti φ td CQ td ti 0 4 Ti Φ d ti 4-1 Φ υ Φ
Φ 0 4-1 d 0 CQ ϋ CQ CQ rd 4J >1 4-1 CQ CQ 0 CQ CQ d φ Ti 4J 4-1 0 0 Φ rd >-< ■H CQ X! Ti tn 0 rd CQ -H Φ -H 4-> CQ rH CQ φ 4-1 0 -H 4-> CJ CQ CQ -H φ d d CQ Φ u X! Ti CJ 3 CQ d rd d XI rH d XI CQ Xi CQ it d -H ti CQ fd xi 0 ϋ Φ d XI £ 0 rd ti rH Ti CJ 4-1 -. -H d c φ rH rd
3 Φ 4J rd -H £ -H EH -H -H 0 rd O En d d rd EH 1 -H -H Φ ! Ti rd Φ d rH
-H Φ Φ ti ti Ti 4-1 XI φ ft Φ φ 4J 4J 4-1 -H .. Φ CQ 3 φ ft -H CQ
S CQ Φ Q x d & Ti U rH rd CQ ti 3 > -H CQ rH d £ tJ ϋ ti & d J 4 X) Xi ti Ti 0 3 φ Φ φ -H Φ rd 0 CQ ti Φ rH 0 ti Ti Φ td rd 0 d Φ P 4J P d -H 0 XI XI φ XI 4-1 4-1 0 XI X! 0 -H XI rd -H 0 d in rH XI 4-1 -H
0 X) CQ 0 ϋ rd 4-1 u 4-1 4-> d rd 0 Ti CQ X! rd ft 4-1 40 ϋ 4J 4-1 rd 4-1 ft CQ -H 4-1
In an alternative embodiment the modification of sharpness and estimation of correlation may be carried out on row-sums or column-sums of pixel values in the respective images. This improves the speed of the calculations .
Preferably, the first image is generated by means of light within a first wavelength range and the second image is generated by means of light within a second wavelength range which is at least partly different from the first wavelength range.
According to such a method, use is made of the fact that the optics has insufficient longitudinal color correction. No extra sensor need then be used but the first and second image can still be recorded without readjustment of the optics .
According to an alternative embodiment, the first image is generated before an adjustment, known as regards amount and sign, of the optics of the system, and the second image is generated after said adjustment.
This results in a simple and reliable measuring method in systems in which such adjustment takes place for some other reason.
According to a second alternative embodiment, the first image is generated before a displacement, known as regards amount and sign, of the object in relation to a focal plane of the optical system, and the second image is generated after said displacement .
This results in a simple and reliable measuring method in systems where such displacement takes place for some other reason.
According to a third alternative embodiment, the first image is recorded by means of a first image sensor, and the second image is recorded by means of a second image sensor.
This results in a quick and accurate estimate of the above-mentioned focus deviation in systems where there is no, or only a small, color correction insufficiency.
1 1 -. 1 Φ 1 Ti 4->
1 rH X. 0 Φ ft 4-1 1 φ d 3 1 d CJ 1 0 CQ
-H rd 0 4-1 XI ti J Φ rd 4-J Φ ti CQ tn rd -H ft rd 1 Φ φ 4-J 1 d Φ ti
90 4-> 4-J J 4-1 fd Φ 4-1 XI ti d Xi ti 3 d 1 rH ti d -|— > Ti 4-1 £ -H 4J φ
-H CQ 0 Φ rd xi ■r-i 0 4-1 P φ 4-1 4 Φ U -H £ ft 4-> rd 4-J -H
Tf X) 0 0 rd -U f 1 Φ 4-1 XI rH tn φ CQ X. • rH £ -H 4 0 tn 0 CQ XI CQ 0 Ti rH U d rH 3
© •- 4J CQ rd d XI 0 CQ φ 0 ft Φ d P 4-1 d J rH ti CQ ti Ti -H SH 5 Φ ft d ti rd rd ϋ -H 4-> -H J 4-1 tn -H >- ft 0 rd -H -H d Φ rd rd 4-1 £ 0 ti £
O 0 0 CQ XI 0 > rH Φ CQ d rd d d £ Φ rH φ J 4-1 Φ 4-4 rd Xl CQ ω rH -H rd xl 0
-H 4-1 Ti Φ 4-1 4-1 4-> ■H XI rd rd rd d 0 0 xi Φ xi 0 xi 4J -H rH ti CQ
CΛ d CJ
4-> d ϋ XI -H rd d 4-> X! 4-> rH d ti 3= -H ϋ 4-> XI EH 4-1 Φ 4-> Φ ^ d 3 td tn
H o d 3 td 3, J Φ Ti XI P CQ ti -H ti 0 4-> XI XI ft d 0 -H ti 0 CQ -H fd
U φ Φ TJ -H XI 0 4-> J d φ -H rd rd XI d rd Φ • rd 4-1 tn 4 ti Φ • CQ ti ft 4-1
0- > 4-1 4-J 0 XI 4-> 3 Φ Φ XI Ti rH Ti CQ Φ £ d 4-1 d rd Φ Ti Φ rH ft Φ d Ti
CQ u ti £ 0 Φ 4J -H φ Φ > tn Φ rd J CQ 4-1 -H 4J i <= φ J CQ ft 4-1 φ d
-H >•< φ ft 3 ti CQ >•< & d 3 -H XI ω d d 4-> rH Φ rd 0 rd CQ 4-1 CQ d Φ ti CQ > rd
CQ φ Φ 0 0 rH 4 d -H 4-1 4J ft -H -H CQ ft -n XI 4-J XI Φ rd rd tn rd Φ
Φ X! rH t l ti 4-1 Φ rH Φ 0 0 CQ -H Φ CQ >, X! Φ -H 4-1 ) X! 4 £ rd -> Φ -H Φ xi rH 0 rd 4-1 Φ rd X! d Ti 4-> Φ -H CQ rH 0 XI d TJ rH CQ 4-> d P XI ft
4-> rd X! 3 CQ ti •H Φ M CQ 0 rH CQ xl ti rd CJ rd 0 0 φ Φ -H d -H & 4J Φ 0
CJ d CJ -H Φ d tn 4-> Φ tn Φ 3 rd 4-1 ft rH J Φ -H rH 3 CQ rd J tn Ti rd £ Xl V
4-1 ■H rd -H CJ rd Φ d U rd Ti tn ti Φ £ rd O XI XI ft d rd Ti 0 -U 4-1 ra
0 4J X! Ti d Φ Ti Φ d 3 •H rd φ Φ xi 4-4 0 J 4-1 4-1 ti Φ tJ rd 3 d Ti Φ J P 0 ft d & d rd 3 CQ rd ■H rd 4J X. d 4J 0 u -H rH 0 Φ Φ 4J -H £ rd -H 0 _ ti
4-1 0 Φ 0 4-> rd CQ 4-1 CQ d Φ 4-> rd CQ Φ rd 4-1 ti CQ 0 4-1 φ 4-1 CJ ϋ Φ φ CJ CQ CQ Φ CQ 4-3 rd tn 4-1 4-1 £ ft Φ tn U tn < -H 4-1 d Q -H i tn υ -H
Φ d IS tn Φ -H rd -H CQ Ti CQ P ϋ P 0 Ti J rd O CQ Φ rH Ti CQ Λ. φ Ti 4J d Φ £ rrx & rd 4-1 rd CQ Ti XI X! Φ Ti ti d Ti ■H d 0 Φ -H d P £ 4-1 d Ti rH ti > 0 -H ft
∞ CQ Φ 3 ti -H rd rd X! H ft Ti d td Ti -H 0 rd φ -H Ti -H £ ϊ>i CQ rd rd d X! -H fd d Ti Φ rd φ 4-1 4-> tn CQ Φ td 0 Φ -H rd -H XI 4-1 -H tn rH ti fd
■H 5 d tn XI d CQ d rd £ 4-1 iH Ti XI 4-1 4-> 4-> rd φ rH ti Xl
Ti d 4J CQ 0 rd rd Φ 4-> Φ 0 φ Φ CQ -H d u ft d 4-1 ϋ . d Φ CQ 3 XI rd td xl 4J d 4-> 0 CQ φ £ tn XI -H > M . ι Ti . -H Φ Φ 0 P XI Φ tn X! rd ti J 4-1 -H
0 d -H ti CQ X Φ -H rd tn -U 4J -H -H rd ti ti -ri ti CJ 3 ti CQ d 4-> Ti ti d Φ ti &
CJ φ 4-1 -H P tn 3 d td tn rH & ti -H 0 -. X. Φ 0 4-1 Φ CQ -H d tn rd d rH 3 φ 3 rd 4-4 rd rd 4-1 -H -H 4-1 CJ rd
*. xi £ tn 0 xi CQ ti CQ tn Φ 4-> 4-1 rd o υ Φ 0 0 £
CQ φ -H 4-1 3 CQ 4-1 0 -H 4-> tn J 4-1 Φ d J 4-1 d rd rd 0 ti O 4-J 4-J Φ tn > rd d 4-> -H ti Ti rd 4-1 d d £ •H -H rd -H £ Φ 3 d ft Ti 4-1 rd d Φ Φ fd -H d 3 φ -H Φ rd -H ti fd 4-1 rd XI Φ -H ti -H Φ 0 d . CQ rd CQ rd TJ 0 3 4-1 4-1 0 -H d Ti 3 υ Ti 0 rH rd CQ CJ CQ rd 4-> d -H rH rd CQ d
O ti 4J φ Ti CQ υ 4-> td 0 φ d 4-1 0 d £ d Φ d Φ 4-1 CQ rd 4-1 Φ >. 0 O CQ
4-> ti CQ tn φ ti Φ Φ CQ rH 3 tn Ti 0 4J 4 -H Φ φ CQ rd CQ CQ φ Φ rH td 4-1 Ti rd -H 4-> rd P 51 d 4-1 -H XI CQ Φ ft d d ft CQ -H 4-1 Φ tn P 4-> -H ti tn ft CJ p o £ 4J Φ to CJ d rd rd 4-1 4-1 4-1 rd rd CQ d tn tn CQ 13 rd CQ ti -H rd ti -H ft xl J tn ft d d 0 -H ti U φ ti rH 0 ti Φ rd d -H Φ 4-1 £ 3 -H & 4-1 3 0 rH 4-1 £ 4-1 tn P~ d 0
-H fd 4-1 tn ti 0 Φ 4-1 XI 0 rd ti Ti ti Φ -H Ti Φ -H rd Ti 3 -H 4-1 rd -H 0 Φ d ti • -H J
Ti d rd rH Xi o 4-> 4-4 u Φ rd 0 ti £ TJ ti X! ti 0 Φ υ Ti J £ -H 4-1 CQ Ti CQ ti 0 Φ o 4-) O Φ XI 0 ti rd 0 4-> tn d CJ i TJ CQ 0 0 TJ CQ Ti ti 0
0 4J XI rH φ Φ CQ Ti CQ 4-1 ti CQ 4J Ό ra 0 4-J S CQ 0 4-> d. d 4-J £ CQ Φ d fi 0 0 ti ϋ 4-1 Φ XI d 4-1 CQ d d tn -H Φ Φ J 0 0 ti ti 0 Ti 0 0 -H > 0 -H £ CJ υ J Q X! rd 0 Φ td rd φ Φ XI £ 4-1 Q J 4J £ -H -H ft d d 4-J u -H Φ 4-1 Xl 0 ft 4-1 J -H φ tn rH d Φ XI Ti EH 0 -H Ti tf. rd 4-> 4-1 M td 0 φ 4J Xl 0 EH XI CQ CQ Φ £
4J d φ . ft φ ft 4-1 3 +J φ rH 0 CQ ti rd ti CQ ϋ 4-> rd Φ Φ £ rd -H d 4J d ti CQ CQ > ft XI Φ t -H rd Φ rd CQ P Φ ti CQ rd
H 4-1 rd U rH rd rd ti Ti Ti -H 0 4-> £ 4 4-1 0 > 4J Φ CQ Φ SH TJ Φ φ ti -H Φ o Φ rd rH Φ rd rH XI -H d d XI X. -H 0 Φ rd H Φ 0 P 4-> tn Φ XI 4-> d ti xi 0 l O ti 3 ft ■f— 1 υ ft CQ 4-1 rd fd 4-1 fd rH ϋ £ rH ft Ti 4-1 ft fd td d 4-1 CQ rd tn 4-> u ft 4 4J o O
system, which comprises an arrangement as described above . Such a system gives corresponding advantages .
According to a fifth aspect, the invention relates to a method for processing a first digital image from an optical system, wherein the focal plane of the first image has a focus deviation from an object in the first image. The method is characterised in that a second image which reproduces the object, and which has a focal plane located at a known distance from the focal plane of the first image, is used, that the sharpness of at least one of the images, for instance the first image, is modified by a degree so that the first and the second image are essentially equally sharp, that a blur-parameter is obtained based on this degree of modification and said known distance, that a set of at least one filter parameter is obtained based on the blur-parameter, and that the first image is filtered by means of a digital filter, which is depending on the filter parameters. This method implies that unfocused images may be used in subsequent analysis and thus that an image need not always be re- focused. According to sixth and seventh aspects the invention relates to a computer program, comprising instructions for performing this method, and a digital memory medium, comprising such a computer program, respectively. The invention will now be described in more detail with reference to the accompanying figures. Brief Description of the Figures
Fig. 1 is a schematic view of an optical system.
Fig. 2 shows a number of images of an object comprising non-dyed red blood cells, which have been reproduced by means of phase contrast microscopy.
Fig. 3 shows a number of images of an object comprising MGG-dyed red blood cells which have been reproduced by means of bright field microscopy.
Fig. 4 shows a system in which a method according to the present invention is applied.
Fig. 5a shows the result of an experiment based on the images in Fig. 2.
Fig. 5b shows the result of an experiment based on the images in Fig. 3.
Fig. 6 is a flow chart of a method according to the invention.
Figs 7a-7e illustrate alternative embodiments for the calculation of the correlations and of the parameter σ3 in the system in fig 4.
Fig. 8 shows the result of an experiment based on the images in Fig. 2 when using the alternative embodiment in fig 7e.
Fig. 9 is a flow chart of a method according to the invention for "electronically focusing" images.
Fig. 10 illustrates the general approach for obtaining a lookup-table for the method in fig 9. Description of Preferred Embodiments
Fig. 1 is a schematic view of an optical system. An objective 1 then captures an image of an object 6, which is located in an object plane 5, on a sensor image plane 2 belonging to a two-dimensional sensor. The system is for the sake of clarity shown with one lens only. In an actual microscope system several lenses are used. The optics, i.e. in this case the system of objective and sensor, has two shown associated focal planes. A first focal plane 3 is positioned at a distance (focus deviation) z_ above the object plane and is the plane in which the above-mentioned optics is focused for blue light. A second focal plane is positioned at a distance (focus deviation) z2 below the plane of the object and is the plane in which the optics is focused for green light. The first and the second focal plane are essentially parallel and located at the known distance z12 from each other. The optics can also be assumed to have a third separate focal plane for red light (not shown) .
The fact that the first and the second focal plane do not coincide is due to the focal length of the optics
-H 0 J Φ 1 CQ 1 ro 4-1 Ti £ rd 1 1
1 CQ Φ -H -H CQ Ti 4-J > -H d o ti 1 -H -. 1 1 d -H 1 TJ Φ
90 ft -H Xl d 4-> d d φ 0 -H £ o r 0 o -. Ti CQ -H φ XI rd 4-1 φ tn ti d ti
0 l 4-1 Φ o ϋ o rd . 4-1 -H 4-1 rH ro φ 3 rH 3 CQ Xl 4-> d Φ 4-1 d 0 0 ft o EH Q -H Φ Φ Ti CQ φ 4-> CQ 4-1 0 tn -. 0 rH 0 EH -H d Φ xi 4-1 CJ -H
Φ Xl 4-1 ti 4-> £ 1 d d Xl -H Φ Φ CJ CQ rd rH ϋ Φ Ti ft 4J = 3 d 4J -H 03 U 4-1 rd
XI • 4-1 d -H ti CJ d rd -H 4J CQ tn rH Φ 3 ■H ϋ rH P P 0 Ti -H rd d ω 4-1 d -H rd Ti 0 Φ . 0 Φ 0 rd Φ tn rd 4-1 φ 4-1 Φ o • rH & £ ti Φ 0
<J_ 0 £ ϋ TJ ϋ rH CQ X! d £ Ti 4-1 ft £ Φ P rd P CJ Ti -H d ft i • O £ 0 4-> ft 4 > 4->
4-> -H rd Φ Φ Φ o -H l rH £ Φ 4-1 φ o 4-1 φ o td ϋ 0 ti td £ d d ςj rd -P d - £ 2 Ti tn 4-> tn 4-J X! -H Xl
0 ti d ti d U a -n 0 ti u O CJ 4-1 O φ -H tn
0- Xl ϋ Φ d XI td CQ d «. 4-J 3 X! rH 4-1 φ CQ CQ •Φ 4-1 φ J £ d
4 Φ -H Φ H 0 rd -H ti -H CJ U -H CQ d rd Φ 0 X. XI 4-J 0 -H 4-1 ti 4-1 CQ Φ 4-1 -H ti 4-1 4-1 d 3 CQ Ti 0 -H ti d -H Xl 3 4-> tn 4-1 ti CQ Φ 0 d £ tn d Ti
Ti ti ϋ Φ • ti d xl 4-1 -H Φ rH 4-> 0 0 XI EH 0 rd d Ti -H -H CJ CQ Φ rH rH φ ti Φ d Φ ti
-H 0 Φ & £ Φ -H CJ ft ϋ ft X! -H d 4-> ti rd φ rH Ti a tn 0 Ti rd 4-> rd CQ O rd J d 0 φ ft φ rd ft 3 CQ 0 Xl 4-1 -H • 4-J Φ ti XI 3 0 rd Φ CJ -H 03 ti Φ CJ
CQ d X! 4-> rH 4-1 CJ £ Ti -H tn -H 0 d CQ 4-1 Φ -H 3 XI 03 ti ti ϋ ti 0 CQ 0 0 0 0 Φ -H CQ Xl 4-> -H 0 Ti 4-J > φ 4-1 -H 4-> φ Φ φ 03 rd ft rd
Φ 0 o 4-1 rH tn .. CJ ti 4-1 Xl Φ 0 CQ en P" d ti Φ 0 -H Xl -H P tn
X! rH d CQ 0 d CQ ft CJ 4 d ft ro rH Φ rd . CQ i>ι 4-1 4J CQ d rH CQ rd Φ d Φ Ti
0 d 0 ^ ϋ Φ 4J Φ Φ Φ 0 Ti Φ φ Ti 03 0 03 -H X) -H £ ft rd Xi 0 . J H -H Φ CQ CQ tn ϋ ti -r-i 0 0 4-1 SH in J -H CQ > tn I d d 4-J ft d • O 4-> Xl rd 4-1 XI 4-1 4-1 CQ rd Φ X! 4-1 £ d rd ro > φ rd ,. — . rd -H 0 0 d rd CQ Φ J Ti 4J
£ rH • Φ 4J 0 Φ £ -n d 0 4 Φ 4-1 Φ tn -P 3 rd Φ tn -H £ φ > CQ d 4-1 φ td £ rH £ CJ -H XI Φ d ti 4-1 CQ Xl fd ϋ -H 03 3 TJ CQ d 4-1 0 Xl P -H 0 rd 0 3 x- - d φ & 4-1 d 0 0 Φ Φ 0 d Φ d Φ tn CQ £ φ 3 Φ ϋ -H l 4-> • rH 4-1 ti
H H -H rH £ 0 x-i 0 ti 4-1 X! XI -H Φ 4-1 φ tn -H -H -H -r-i 4-1 Φ i . 4J -H 03 CQ -H d X! J CJ ε 4-1 rd
Ti XI 0 -H ft 0 d EH 4-1 Φ 4-H d td ti X. 0 XI rd 4-> 0 0 £ £ Φ -H φ d
• P 0 ϋ tn d 4J rd φ rd -H 0 £ CQ Φ 0 CD CJ ft X! ft Φ P~ Ti -r~ι 3 4 Φ 4-1
4-> 4J ti d d -H ϋ rH ti rH 4J Ti ft -H Φ < P~ ti 1 Ti 0 0 i S-J σ. rH d rQ CQ 3 P d -H ft -H -H td Φ rd φ 4-1 td Φ Φ £ xi rH Φ φ Ti φ rH tn 4-> rd o fd o rd - 0 φ tn CQ 4J ti d 0 xi ft ti XI Φ 0 tn 4-1 . XI XI rH ϋ Φ -H d CJ CQ Ti
Ti d rd CQ P ti tn j= 0 Xl CJ d Φ 4-1 g rd P CQ Xl Φ Φ 4-1 m d φ 03 0 CQ d 0 -H CJ φ 0 3 xl CJ d φ 4-1 d rH Ti 3 3= Ti 4-1 G ti d > 4-J Φ XI φ ti π Φ φ rH Ti XI 0 CJ u CQ d ti J CQ -H J ti Ti -H rd d 3 d d 0 Φ Φ xi φ 4-1 4-1 Φ -H ft Φ 4-1 4-1 0 -H 0 d ti 0 d CJ rd 0 =P 4-1 0 0 4-1 d CQ tn ti rd 4J Φ ti
Φ Φ ti d CQ 4-1 rd CQ Xl ti CQ rd 0 x-i 0 d CQ ti rd ft CJ 4J 4-1 0 φ -H tn £ ti ø ti
Ti 4-1 Φ Φ -H rd 0 d £ CJ d 4J PH 0 ft 3= d 4H o φ Φ 4 -H
CQ Φ -H o CQ ϋ CQ 0 & tn O 4-> ft Ti rd
Φ Ti d -U XI >-. φ CQ 1 ti -|—| d Ti 3 rd 4J ti CQ £ Φ J
Xl rH -H 0 rd 4 rH CQ £ CQ -. £ -H -H Φ xi rd φ CQ «s X! 0 d 0 £ φ CQ 4-1 3 0 ti
4-1 & CQ -H 4-1 -H rH d 0 CQ 4-1 T! £ d ti CQ ti Φ 0 rd d 0 -H Φ Φ CJ XI Φ rH CJ ti 4J tn £ d 4-1 -H £ Φ td xl φ rH 4J -H =t Φ ti tn tn CJ Xi S Φ 4-1 Φ Xl 4-1 ft CQ rH φ d d 0 0 d rH 3= Φ CQ tn rH CQ CQ φ Φ 0 Φ d CQ Φ Φ rd = 4J ti tn ti Φ -H rd 4-1 Φ
Φ ϋ u Φ -H £ rd φ rd 0 Xl in ti J SH d 4-1 rd 1 X! XI rH 4-> 0 d d rd CJ Φ 3
H d > ϋ Φ CQ CM £ u ti ft EH • tn rd -H CQ 4-1 ro CD EH Φ Φ ti rH -H -H Xl d ^ ti φ
Φ -H >, a rd rH rd -H 4J o Ti Φ CQ CD Φ ti X! 0 O TJ CQ fd Φ ft tn i> x-i -H 4H X! X! . Ti d 4-1 rd d 4-1 d ft -H . 2 > &. ϋ d d 4-J . ft d rd CQ rH -H CQ tn P 0 0 d Φ 4-1 rd d S ti TJ tn rd d Φ 0 3= Φ CQ tn O rd td
S rd rd 4-1 0 CQ P *. u 0 CJ Φ ft P xl φ 0 rd -H tn Xl ft -H υ CJ ft 0 Xl ϋ ti xl 3 d 4-1 CQ ϋ ti & u rH ti 0 0 4-> d d XI Xi 4 Fn d 0 d 3 φ 03 XI 4-1 Ti ϋ. CQ O ti tn CQ Φ 0 0 Φ XI Φ Φ J X! £ 0 CQ CQ d Xl u CQ rd =t φ Φ CQ 0 4-> rd d CQ P CQ T! ft 4-J d td CQ 4-1 CQ fd S P CQ ϋ CQ d 4 ti ti «. 4-1 ti
-H CJ Φ Φ d Ti td 4-1 0 rH & φ
3 Φ φ ti -H 0 0 CQ co tn ti Φ Φ d J o tn Φ
Φ -H CQ H CQ CQ 4-J rd 4-1 Φ xl -H ti CQ ^F 0 0 ti Xi φ Xl ti -H -H . O tn Φ d xl
X. 4-> -H ft 3 -H 0 £ 0 ti ft Ti J -H no ϋ ϋ rd 4-> 4-1 ft & Ό 4-> Ti o rd U rd rd ti £ EH o O
ΪX ^
blue will be discussed in detail; however the principle for red is the same.
The relationship between the images in connection with the object through which light is transmitted and in connection with the image sensor can be expressed as follows : b = b1 * h1(σ1(z1)) g = gj * h2(σ2(z2))
The sign "*" then designates a two-dimensional convolution. The functions hi and h2 relate to impulse responses which each have a wavelength parameter σi and σ, respectively, and which are each strongly dependent on a parameter Zi and __■_ , respectively, which designate the distance between the focal plane of the color in question and the obj ect , as shown in Fig. 1.
The green and blue images captured by the image sensor 106 and stored in the image memory 108 are sent to an estimating module to estimate the focus deviations __ and z2. It may be assumed that the distance between the green and the blue focal plane zi2, cf . Fig. 1, is known. The distance z12, which of course should be greater than zero, may be measured when manufacturing the system, but preferably it is measured in recurrent calibration procedures .
The blue image b, which is a matrix of pixel values, is connected to a first convolution module 116. The green image (which is also a matrix of pixel values) is connected to a second convolution module 120. The convolution modules are here in general means for modifying the sharpness of an image. In the convolution modules, the images are modified electronically. In a preferred embodiment, blur is added to the images. This is referred to below as the image being blurred. The degree of added blur is below referred to as the blur parameter, designated σ3.
The output signal from the first convolution module 116 can be called a blurred blue image and is designated £>* (G3) 1 wherein b * (σ5) = b * b(σ3)
The sign "*" then means a two-dimensional discrete convolution, and h is a Gaussian unit impulse response:
1 -(X +y2)/ ■ ∞ < X < ∞ h(x,y,σ) = ' 2σJ σ - 2π ■00 < y <oo
In the same manner, a blurred green image g* (σ3) is generated in the second estimating module 120, wherein
g*(σ3) = g * h(σ3)
The image can optionally be band-pass filtered before, after or integrated with the modification of the sharpness. This can be carried out to compensate for high frequency noise, low frequency light variations or color differences. Generally, band-pass filtration is used to emphasize components which contain sharpness information. Preferably, use is then made of a modified Gaussian filter in the sharpness modification.
The blurred blue image b* (σ3) and the original image g are inputted to a first correlation module 122 in which the pixelwise correlation between these two images is calculated. This correlation between two images a and J is generally expressed as follows :
wherein m and n express the size of the images in number of pixels. The average values of the different images
are designated a and b . An individual pixel in the images is denoted ij (row/column) , aij thus denotes the intensity of the pixel i,j in the image a. The correlation can assume values between 1 and -1. Negative correlation values, however, are not probable in this context. Pixel- wise correlation is used above, which is preferred, but other correlation calculations, such as between groups of pixels, are feasible. The first correlation module 122 generates the output parameter p (σ3) , which expresses the correlation between g and b* (σ3) .
In the same way, a second correlation module 124 generates an output parameter p~ (σ3) which expresses the correlation between b and g (σ ) .
The modification of the images and correlation be- tween the images need not necessarily be carried out for the entire images. The method can also be carried out for part of an image .
The system comprises a parameter calculator 126. This controls the blur parameter σ3 until a globally greatest value of p (σ3) and p~ (σ3) is obtained. By globally greatest value is meant the common maximum of p ((T3) and p~ (σ3) .
The value of σ3 which generates a maximum correlation value {σ3) is then used for the estimate of z_. and z2. As will be described later, it is also possible to use the determined value of σ3 to estimate σx and σ2, which may be used as parameters in a signal processing technique, which sharpens the respective images.
When zx and z2 are estimated, a number of assumptions are made. It is assumed that h and h2 are Gaussian and identical with the impulse responses that are used in the convolution modules 116, 120, except for their respective wavelength and focus deviation parameters. It is further assumed that the details in the object that appear with blue light can also be seen with green light. Under such conditions, the expressions for the green and the blue color component can be simplified as follows:
b = b *h(σ1(z1)) g =b.*h(σ2(z2)) Three cases are possible
a) If σ2(z2)>σ1(z1) , p(σ3)=l when:
gofe* = [^*A(σ2(^))].[feJ*A(σ(z/))*A(σ3 = [Gaussian h) ■
b) If σ1(z1)>σ2(z2) , in the similar manner p~(σ3)=l when :
c) If σ1(z1) =σ2 (z2) , in the similar manner p(σ3) = p~ (σ3) =1 when:
σι {zι) = <y 2 \z2 i-e- 'when σ5=0
For each of these cases, a system of equations is to be solved as regards zx and z2:
The parameter calculator 126 carries out numerical calculations corresponding to those shown above and can therefore, with the aid of σ_, σ
2, σ
3 and z
12 l provide estimates of Zi and z
2. These estimates can then be used by the optical system. In the shown example, the estimates are input data for a focus regulator 128 which regulates a focus mechanism 129 to the desired position.
The parameter calculator 126 as well as the convolution modules 116, 120 and the correlation modules 122, 124 can be accomplished as ASIC circuits (Application
Specific Integrated Circuit) or FPGA circuits (Field Programmable Gate Array) . Alternatively, the entire, or parts of, the calculation method included in the invention can be implemented in terms of software as a com- puter program. The computer program then comprises instructions which are intended to be carried out in a digital signal processor (DSP), PC processor or the like. The parameter calculator generally constitutes at least one means for identifying the σ3 which gives the greatest correlation and means for calculating estimates for the values of z2 and z2.
In simple terms, it can be said that the system uses the fact that the image whose focal plane is closest to the reproduced partial object will have the sharpest ap- pearance. How much the sharper image need be made more blurred (or the more blurred image be made sharper) by signal processing for the two images to have the same sharpness is a measure of how much closer the partial object is located in relation to the focal plane of the sharper image. If the first and the second image are equally sharp/unsharp, it may be assumed that the partial object is positioned midway between the focal planes of the two images. If the relative distance between the focal planes is known, the distance between each of these and the partial object can be estimated.
It is possible to use only one convolution module 116 and one correlation module 122. It may then be said
03 μ- CQ tr Ω μ- l—i. Hi d ti tf μ- ■t 03 rt 0 LΩ Ti rt tr <! Hi rt 03 μ- 3 μ- P μ- μ- 3 μ- Φ μ- 3 Φ Φ μ- 0 03 Φ Φ 3 μ- d μ- T ii tr ^ PJ 0 ii d P PJ P O P
CΩ PJ t Φ P) Ω Ω LΩ ϋ Φ ft øj rt ϋ <! rt Φ PJ Φ P Ω PJ 3 Hi rt Ω tt
CQ μ- d ti CQ 0 rt tr ft d LΩ tr μ- Φ μ- øJ ti rt rt d 03 φ 0 Φ ii 0J φ 03 rt Φ ii rt μ- μ- 03 Φ P Ω rt Φ μ- tf 03 rt ft ii t-1 Φ 0 μ- Φ ffi K ft μ- >• P Hi 3 Φ ft CQ 01 03 P Φ Hi H Φ 03 Ω •<! PJ P 03
0 PJ rt ft 0 Φ 03 03 0 PJ ft 03 μ- rt ϋ μ- rt O tr ft rt Φ 03 ØJ
Hi Hi ■ : 0 ■Z ft 01 rt ii CΩ • Φ Hi ϋ Φ P Φ ft Ω Φ Ω 0 03 μ- Φ ^ rt rt μ- ti μ- φ μ- P PJ φ P Hi PJ 03 03 03 ft ti μ- μ- J P ft μ- rt φ μ- Hi LΩ rt < ft tJ rt to 03 φ Φ ti d ■<; d tr Φ 03 03 03 3 P ti rt < ft 03 tr ϋ 03 μ- tf φ Ω tf d 0 ti PJ CQ 03 Hi Φ 03 rt μ- PJ Φ tr φ Φ Hi
Φ 0J rt H d PJ φ Φ Ω ti φ 03 Φ rt rt Hi rt øj ft N LΩ tr μ- Φ ti Si Ω ØJ
PJ rt C 03 » 3 - tr P ft 03 Φ μ- 3 μ- P Φ φ φ φ P 03 tr ti Ω
0 ti 0 ft Φ μ- Hi ft rt rt 3 Ω Φ P Ω <! . Hi Ω φ Φ φ t
Ti 01 μ- Ti rt P μ- Hi μ- Φ PJ μ- ft PJ μ- rt LΩ φ μ- 0 Ti 0 0 ti ø) 0 rt PJ ti P 0J tr 01 ii μ- Hi ti rt Ω tf tf Ω Φ tf PJ Hi ii ii P Ω 03 ti μ- ft Φ lΩ PJ ti Φ rt 03 t Hi P 03 tf 0 ti μ- Ω ^ P 0 O CSI rt 0 Ω rt PJ μ- Φ ■<.
Ω l_l. Ω Φ H 0J ti Φ rt 03 φ PJ Φ Φ Ω 0 tf rt ft tf μ- ft <! Φ ii ti ft
03 d 0 ti rt φ ft rt ii rt P Ti 0 Φ tr ti μ- o tf μ- PJ 03 Ω 3
03 ii Ω Φ μ- φ μ- 03 μ- ϋ ft Ω LΩ Φ
< 0 X Ti tr P Φ ft PJ 03 03 ti μ- ø)
0 rt ft 3 0 PJ 3 rt P 3 μ- tf 0 μ- Ω Φ φ P rt μ- Φ tJ ti
Hi 3 Φ Hi H μ- PJ 0 tt Φ ii φ Ω 0 d P P <! ft rt φ 3 ft ft 03 J PJ ti
Φ J PJ 0 0 φ rt Ω 0 03 03 LΩ μ- LΩ φ 03 Φ P 03 rt Φ rt P ω t Ω tf Φ μ- Ω Φ 03 ti 03 rt P μ- 03 μ- Φ rt PJ PJ μ- μ- tf ii tf rt Hi d 0J pi O ^ 3 rt μ- rt rt 03 φ μ- CQ ft P Hi P φ
Φ μ- ii Ω I-1 tr μ- μ- Ti Φ tr tr 0 3 d 01 P 3 d tr ft μ- CΩ μ- ii μ- 0 rf 03 d 0 ft rt ti i μ- Φ 0 ft TI PJ H μ- rt Ω 03
03 r Q ti ii Ti Φ d 3 ti μ- 03 O rt rt 03 μ- ft 0 rt rt μ- Ω P tf rt rt 0
< P rt cΩ ii ti Φ ti μ- 03 Hi <! 03 μ- Ω tr rt P μ- CQ
• Hi 0 μ- rt 0 Φ tr Φ ti tr 0 φ Φ tf ti rt μ1
03 0 Φ 01 P Φ P PJ ti μ- φ LΩ μ- ti Φ <! tf 00 rt => μ- H Ω P J Ω pi Φ P ft PJ μ- P Ω Φ rt Ω 3 03 μ- 0 i
Φ tJ 3 PJ Ct Φ rt μ- 0 Ct > ii Φ φ ii φ 03 μ- 01 Ω μ- Hi PJ ■-i PJ φ 3 μ- 03 rt
3 PJ ti μ- 03 μ- LΩ ii Φ Φ ft Φ 03 μ- P 03 Ω rt 0 0 ti PJ ■ ! PJ 03 tf d J LΩ CΩ 0 <i tf ft Hi ti LΩ ft < Φ 0 ti o P rt LΩ J rt rt
03 Φ Φ P ■t Φ rt Φ rt d rt ii s; PJ 0 φ φ 03 ^ φ 0) tf LΩ P 0 Φ d ii μ- tr
Hi μ- ft tr ti Φ μ- <! Hi ti ti 0 ft l—i Φ Φ 0 - 03 Ti 0 Φ
0 ti tr μ- rt ■ øJ φ ft μ- Φ ct PJ Φ rt μ- ii rt rt Φ P ti ti Φ φ 03 tf PJ P tr 3 P tr μ- Ti ft μ- 03 03 tf Ti 3 ■Z tr tf ft Φ 03
CΩ Hi tf o ^ ft Pi o Φ PJ H1 ii 0 Ω 0J φ l—i PJ μ- PJ Φ d 03 3 tf μ- P) 0 ft μ- d 03 Hi t ti LΩ Ω PJ 0 T P Ω 0 tr rt f rt rt t 0) t rt 03 0 pi
P ii ii Φ 03 rt PJ r Φ 0 0 tr ft 0 0 ti h-1 s; ti Φ tr μ- m ft ϋ
03 ft Φ 03 01 Φ φ PJ P d 03 μ- ti ii Φ Φ φ μ- PJ 3 Ω Ti rt 03 μ- Ti d 03 ii Ω 03 φ 0 Φ Ω μ- P 03 Φ Φ 03 μ- ti PJ PJ Ω ØJ P
PJ 01 ii 0 03 03 Φ rt rt Φ ti • μ- rt μ- Ω Φ ti 03 LΩ P tf ti Φ Φ
P PJ tJ φ 03 μ- O Ω ■Z Φ P tr P μ- ØJ ft rt CQ ■Z φ ~. 03
Ω 3 ft ft 03 p 0 tr $, H 03 Hi LΩ < φ μ- rt rt ft tr Φ P) PJ ØJ 03
Φ 0 μ- CΩ ft P μ- μ- P 0 d μ- μ- φ ti o μ- tf
• 03 φ μ- X 03 Ti tf d PJ tr 0 ft Ω tt P) ii Φ rt μ- 01 φ ti 3 Φ rt Ω μ- μ- 03 Hi Ti d Ω
P) ti O μ- μ- i -r ft 03 rt tf 3 ti ft ØJ 03 f— i Φ tf 03 P 0 μ- ti rt PJ rt 03 ti P Ti μ- μ- PJ Φ Φ Pi LΩ μ- rt φ 0 ti rt Ω h-1 0 P ii Φ Φ μ- 03 t 3 rt LΩ < PJ P H ti LΩ Φ P P Φ rt P 3 PJ φ tr X øJ
Φ PJ Ω rt d 0 PJ tf ii Φ H ft Φ φ • CΩ μ- μ- Φ Φ μ- tf
P 0 Ti ■ : Hi ft LΩ Φ Φ Φ Ω pi 03 3 LΩ PJ P ii P Ω ti 03 Φ ft P 0 Hi d Φ Φ μ- o Pi P Φ ØJ ti φ Φ 0 PJ 0 ft 03 Ω μ- Ω O ti 03 P P 01 ft PJ P CQ ti pi φ μ- tf φ Φ Φ
focusing. Alternatively, the images can be recorded before and after a displacement, known as regards amount and sign, of the object along the optical axis of the system. One more possibility is to use several sensors with separate optical distances to the reproduced object. Fig. 5a shows the result of an experiment based on the images in Fig. 2. For each pair of images, at a given distance between the object and the objective, a two-part correlation curve is given as a function of the blurring parameter σ3. Each correlation curve consists in its left and right part of p (for instance 123) , as a function of σ3 (i.e. different sharpness modifications in the first image) and p~, (for instance 125) , respectively, as a function of σ3 (i.e. different sharpness modifications of the second image) . The resulting five correlation curves have their maxima for five different values of σ3, which corresponds to the object being located in five different positions in relation of the objective. The curve 130 is associated with the pair of images 30, 35 (Fig. 2), the curve 131 with 31, 36 (Fig. 2) etc. None of the five maxima reaches the correlation 1 as in the above assumption. The reason is that when actual pairs of images are analyzed, it often happens that several of the conditions in the description above in connection with Fig. 4 are not satisfied.
First, the object is not always thin in relation to the focal depth of the objective. The resulting correlation curve will then be a combination of a number of correlation curves - one for each thin "layer" in the ob- ject. Then the position of the resulting correlation peak and, thus, corresponding estimates of the focus deviations, will be interfered with to a greater or smaller extent .
Second, both the object and the focal planes are seldom quite plane. Since the effects hardly cancel each other out, the result will then be that z
2 and z
2 (and
tf d Ti Ω tr Ω ^ rt rt 3 0 μ- rt T Φ P ti Ti ft pi rt P Hi rt rt Ti J l—l. κι ft
T ti Φ pi PJ tr tr 0 ii 03 tf PJ ii φ Φ O Φ tr Φ 0 > : μ- H- tf ii φ tr
0 TJ 0 <! P Φ Φ et 03 Φ ti P) P 03 ti ft φ Ω Ω 0 CΩ Φ 0 ft Ω d
0 φ ft H Φ μ- ft rt LQ ri¬ PJ 03 øJ *< 03 Φ d Ω P tr X Φ rt π 03 ft ii d 03 P TJ μ- o PJ d 03 μ- Φ rt μ- tr φ Φ 03 03 0 rt o μ- Hi μ- PJ
Ω ft 0 en PJ 3 π_ P ti φ I-1 Ω o ft μ- f ft 03 ii > ■ tr >τ| 3 0 <! IH P q
Ω 03 Φ Ω μ- μ- J μ- Φ μ- P <l Φ 0 M > ! ft PJ ft ti μ- 1—1. 0 P) Ω Φ tr
Φ μ- ft 0 03 h-> , — , ii LΩ LQ , — . rt ft PJ <. P φ s; Φ ti Φ φ rt rt φ d Ct d μ- "" ft 3 rt 0 * _ Φ Ω μ- 0 Φ PJ Ct M μ- LΩ tr < < Ω tr tf Ω ti Φ 03 μ- ti <! PJ
Φ tr T μ- ti μ- 0 03 Hi P ti tr d PJ Ω rt ii μ- μ- ^ μ- rt 0 ft ft H1 μ- 03 ft ii
03 ■<; ii ti CQ LΩ Hi LΠ . Hi rt tr Φ φ rt PJ 0 Φ rt J J - rt tr ^ ti »? μ- Ω Φ μ- tf tr Φ Φ . Φ PJ φ rt rt rt tr LΩ tr CΩ <<
0 3 PJ
Hi 3 03 rt ii μ- P ft d Φ μ- X 0 03 Ω Ω rt μ- 0 μ- ft Φ tf Φ Q 1 ØJ PJ o ti ti Φ Φ ω f tr — * 3 03 tr Φ ti rt rt d 0 Φ tr 0 0 tr tf μ- PJ ft ft rt 03 <
Φ pi ft
ØJ t I tf Φ 3 Hi LQ Φ tf tf 3 fi ti PJ ti Φ ft rt J rt d Φ φ φ
03 tr P 0 φ - LΩ μ- 0 Ω PJ P Φ ^ PJ Ti 0 03 ft 03 Φ tr < 03 Ti ti l-j rt
Ti Φ 03 rt d Φ LΩ $ TJ Φ Ω μ- rt h ft Φ PJ 0 l—l. 3 03 Φ Φ μ- 03 Φ d μ- tf
Φ ■Z tf ti φ 03 03 PJ ft rt P 3 μ- P J.. ft Hi d 0 0 Ω 03 μ- P Ti rt rt Φ
Ω 03 0 0 Φ rt rt tf tf 0 0 03 TJ ti CQ Hi ft ϋ PJ μ- PJ ft rt Hi tr rt rt Φ 0 μ- tr
Φ LQ Ω > ω rt
• 3 • ; øJ ti ti 0J Ω 0 rt Φ μ- 03 ti ti P φ 0 μ- μ- Φ PJ o . tr 0 tf 0 tJ Φ rt μ- Φ 3 rt TJ 03 PJ • ti Hi
<i ft tf 03 Ti ti Φ 0 J rt rt ft Φ rt rt tf rt d rt M ft T
Ti μ- rr
Φ φ i 03 φ ft H H Hi Φ rt μ- tf - rt rt d rt tr Φ LΩ μ- tr Φ 0J C
Φ PJ Φ rt tf ti 03 O Φ tr tf Hi ft tf Φ μ- 0 Ti Φ Ti 3 H- μ-
PJ LΩ P rf ft Ul Φ φ ti 03 rt 01
P rt PJ Φ 0 Φ μ- Φ 03 <! P rt ^ PJ ft 03 3
* LΩ rt 01 tJ tr 03 μ- 03 PJ Φ tr 3 tr P ϋ 03 03 3 ►<; φ μ- 03 ii μ- φ Φ ft t μ- . PJ 03 , . Ω d ■<. P Φ μ- 0 Φ TJ PJ φ 03 03 0 0 J rt rt Hi
Si øj 03 d 03 ft P rt PJ μ- rt μ- ti 03 rt ft Hi ti 3 tf • Hi ti tr rt Hi > tr μ- ii rt μ- μ- μ- 03 X tf P Φ 03 tf Φ φ 03 φ Φ ti Φ 3
Φ tf μ- rt Φ LΩ <i ri PJ 3 ω 0 ^ Ω φ μ- Ti C O 3 X ^i H PJ 03 — o tJ Φ φ = ft tf ti φ 0 PJ Ω ti 03 Φ 03 LΩ ii 3 ft Ω μ- tt ■Z Ω tr Ω Ti i-1 •<! μ- Φ Hi CQ PJ Ct ti 03 ti 0 TJ Φ CΩ tf PJ J Φ rt 0 <
PJ d ft J φ P ω μ> C ^ φ P tf Φ rt tr Φ ft rt rt M I-" • PJ ^ 03 μ- P pi
Ti > ft 0J - — ^ pi 03 ti 3 PJ ■Z ^ Φ d μ- 0 rt ft Φ Hi 0 03 ti p TJ 3 φ Ti o ti ft μ- μ- tr ti Ω 0 φ . Hi 0 P φ ^
0 Φ μ- ii 03 H Ti tr tr O P ti μ- P Φ Φ Φ P Ω μ- P 0 rt H 1 tJ ϋ Ω 03 PJ tf 0J rt μ- Φ Φ Hi LQ 03 ti X rt ft 03 0 03 Ct PJ φ ti tf 3 Hi 0
1 ti _\ 3 Φ ti tf 03 μ- 3 PJ φ Ω tf • 3 ii ti PJ Φ μ- 0 <i ft 03 0 — TJ Φ Φ Ti ti 03 rt 3 tf P 3 PJ Ti PJ φ Φ Φ φ rt ti 3 ti Φ
KJ μ- 03 Ω i PJ Φ pi tr μ- μ- 0 0 rt d ti rt H Φ 03 μ- Hi φ ft Ω Φ 0 rt Ω 03 ti *τ] 3 Φ Ω Ω rt d tf ft tr Ml P 03 ft o 3 CΩ PJ Ti rt PJ ft φ 0 tr ti d 03 μ- μ- Φ ti tf ti Φ μ- μ- μ- 03 0 μ- P PJ J-1 PJ φ ft
Ti μ- 0 ii rt ii 0 3 LΩ ft 0 01 rt P P 03 J 3 ft ti ft 3 tr
03 0 Φ •
^ Ω Hi Φ tf < Ω φ μ- CQ μ- Hi CQ LQ Hi rt T PJ *< φ CΩ rt μ- Φ
PJ Hi tf PJ Φ μ- P X Hi Ω 03 Hi Hi ti tr LΩ 0 Φ 0 rt ϋ ft Ti Ω
3 ϋ 01 rt pi rt .>• rt Hi 0 Φ ti Φ μ- ϋ 03 φ PJ μ- φ Φ μ- PJ ti μ-
Ts ft <1 Ω Φ rt μ> rt — Φ φ Ti Ω Ω 0 φ μ- d <l Hi 03 03 TJ P φ rt 03 ii O 3 tf μ- PJ ft μ- rt Φ> Φ tf . P ti μ- PJ rt 3 P P φ φ μ- 0 μ- Ti P øJ rt 03 PJ
Φ Φ N ti 0 tf H-1 ft PJ rt φ P d φ 03 P ti tf 0 ii Ω μ- O Ω LΩ
• tr P Φ 03 ti CQ 03 ft μ- Ω rt 03 Hi 0 0 PJ H P PJ 0 φ
0 r tf -> 3 ■Z φ tr rt • φ rt 0 tr μj Ω rf TJ φ X ti P 03 P Ti •
Hi φ rt Φ 0 Ω 0 μ- μ- ft * ft rt 03 3 φ rt 0 Pi PJ rt μ- ti ft ^ ft Φ ft tf 0 d tr rt rt Ω ι-3 0 TJ P P ti tr 3 φ 0 ti Φ ti ft ti 1—1. tr tr 0 rt 0 t tr 0J 0 Ω μ- 03 Ω rt μ- Φ PJ Ω tr Hi 01 0
Φ Φ <1 φ ti tf μ- ^ PJ < 1 0 03 μ- Φ Hi rt 1 T tr 03 ft r Φ Ω Φ r 03 1 ti 1 "* O Φ d 1 1 0
03 rt 1 Hi 1 Φ
ω to t μ>
(Jl o l o LΠ o CJl
03 3 $ rt ft rt Hi Ω rt 03 rt rt d μ- rt O $, μ- rt 03 Hi tf 03 Hi _ 3 rt ft rt _ Hi Ω tf μ- o μ- O μ- μ- 0 PJ ti tf tf Hi 03 P μ- Hi μ- 03 $. μ- PJ PJ tf o Φ μ- Φ PJ Hi ti ft ft (-■ Hi 0 ti J PJ Φ J φ O rt 0 rt 03 o Ω PJ J P Ti P PJ PJ o 0
Φ μ- tr Hi ti 3, -- P Hi ti ft V ti ft tr φ μ- φ ;» d ^ 03 Ω φ Ω *< Ω 03 0 ti Hi φ φ 03 T Hi 03 μ- tr μ- 03 O rt ft P 03 φ C rt ti Φ Φ rt Ω ft
Pi μ- 03 Hj μ- Hi t3 Hi Hi LΩ rt Φ P 03 PJ P Hi ti μ- ft 03 H ti μ- 0 tf Ω rt Ω Φ ti PJ μ- 0 Φ Φ O 1-3 03 0 Φ < Ω 0 0 μ- 3 03 Φ < μ- ti = < TJ Ω
I-1 PJ μ- PJ P rt P i 03 XI Hi tf rt rt P Φ Ω Hi ti P φ = 03 Φ P Ω φ ^ Φ
■<: rt ti ft Φ LΩ 3 03 d 3 Φ PJ tf tr ft Hi O PJ LΩ PJ PJ 3 μ- ti ti 0 PJ Φ φ Φ ti Φ 0 φ μ- 03 Hi PJ PJ •A 03 μ- tf ft ti tr μ-
X. 0 μ- 3 03 Hi ft ft ti ft μ- pi ft tr μ- d P 01 μ- 0 03 Φ tJ øJ 03 d P φ 0 μ- μ- r Φ Ω P PJ J Ω μ- 3 μ- 0 <! LΩ Hi rt 03 Hi P rt •<! Hi ft tr μ- rt ft ft <l tt P μ- CΩ ■ ! tf Ω Pi 3 Φ tf P d Pi φ Φ Φ Hi tf 03 Φ φ 0 μ-
Ω 0J 0 μ- φ tf 0 3 Hi ^ O 03 rt ii PJ PJ ^ 0 LΩ rt Hi ii ft φ Z Φ rt X < 03 rV P" rt 0 Hi 3 ■t PJ Φ Ti 3 > Φ ti LΩ 03 μ- ω 3 Hi H tr ti φ rt Φ φ ft PJ d μ- Pi P LΩ Φ 3 μ- 03 Hj μ- Φ d 03 φ rt o PJ μ- Φ 0 Φ μ- Φ 3 tf PJ ti ti rt Ω ti Φ PJ Φ ti rt ti Φ 03 ti d <! 0 • P ti ti ti Ω Hi Φ 0J Φ
Ω PJ ft ι-3 3 03 PJ P PJ CΩ Φ PJ ft μ- Hi Φ to Ω PJ Φ Ω tf 0 01 Φ Ti
3 0 ^ Hi rt tf PJ • P φ ti 3 rt Hi Hi rt Φ < Φ ii Ω ti Hj
ØJ ii o μ- Ct Φ P ft 03 CΩ μ- O Hi LΩ μ- -- tr 1= Hi tr PJ Φ Ω Φ Hi O ti Hi 03 ii 0 tr ti H3 Hj tr <1 d 0 Ω Φ 3 3 Φ φ μ- Hi 0 P) 0 ft Φ rt ft
P Φ Φ P PJ φ tr Ω PJ 0 Φ J Φ rt ti Hi μ- LΩ Φ rt μ- <! * tf Hi Ti tf d
Φ Φ Φ 03 03 Ω Hi Φ O Hi Hi Φ 03 . PJ Φ μ- T ■Z PJ PJ Ct tf P) Φ Φ Φ ft Ω Hj Φ Ω
Hi PJ P PJ Ct Hj ft P φ rt PJ P P <! Hi tr 03 rt tr t Hi Hi μ- Φ 0 Φ rt Ω J rt d d rt Hi φ PJ ft O P LΩ rt φ Φ Φ d μ- Φ Φ Ω LΩ P ft < ft μ- μ- tr P μ- PJ 03 Hi Φ ti PJ Φ 03 03 P Hi < P) Φ rt μ- Φ CQ d 01
P 0 tr ft 3 J-J μ- PJ μ-1 ft P 0 rt μ- Hi Φ φ φ Hi Ω • tf 03 P 03 Ω ti tr
P Φ T φ P P PJ ≤ μ- ft P tr P O pi P Ω φ tf Φ Φ rt Φ μ- rt PJ Ω rt LΩ 03 rt tf 03 Φ rt μ- Hi rt PJ " ...
* Hi 03 H μ- Hi 0 PJ ft 01 to tr Ω X! μ- 0 Ω ϋ Hi μ- μ- Ω tr PJ Φ • Ω I-1 μ- 0 d 0 D 03 P PJ P rt 3 H
Φ PJ d Hi Hi 0 PJ pi O 0 Ω Hi Ω ii Φ 0 Φ μ- Ω Ω rt ^ rt rt rt ft μ- φ
P μ- Hi P ti P ti P t φ d ^ o Φ • P Hi 3 d d rt tf 03 03 Φ Φ tf
03 z 0 Pi
Hi Ω 0 φ 03 3 rt Φ o 03 Φ ft <i 03 • Φ d rt ti ft Φ 3 tr ti P
Hi tr rf Hi H1 d Hi ^ PJ 3 Φ d < rt tf PJ Φ PJ ft ii Ω Φ Φ μ- μ- 03 03 φ Φ φ J 3 0 >τ- μ- ti 0 μ- Hi 0 μ- φ O μ- ti rt tf 3 H tf 3 03 £ μ- Ω Ω
X. Hi μ- ft μ- Hi H 03 Φ ft >τ- 3 μ- I-1 P rt Hi P rt μ- φ φ P 03 03 rt tf Hi tf 0 0 d Ω 3 μ- P 3 μ- O PJ φ d CΩ ■t μ- P ϋ J 0 03 μ- μ- < 0 Hi Hi
Φ PJ 03 PJ 0 CΩ , — s Ω Ω Hi d LΩ Hi rt φ Ct PJ 0 CΩ φ 03 rt ■<! ■t P Ω φ 03 3 ii μ- CΩ ti • μ- ^ PJ PJ μ- ii Φ μ- ft φ tr ft P Hi d tf rt 03 tr LΩ tf P Ω PJ rt Ti
Ω Hi ti Φ 03 PJ Hi Ω μ- 03 rt O μ- P Φ <! tt 0 Hi Φ tf rt μ- • rt 0 μ- tf tf
^ μ- Ω CQ Ω H 03 Ω Hi PJ φ ti P 03 Pi tf ti μ- PJ Φ Ω J μ- Ti P Φ PJ
Φ Φ PJ Hi X. rt μ- rt Hi tr PJ rt rt rt P 0J Φ φ ti 03 rt 3 tr H3 ti 0 Φ 03
Ti ft d H-1 Φ μ- ti 3 PJ tr ■ rt LQ Φ 03 tr Φ ti *< 0 Φ
I-1 03 ft Ω μ- >TJ PJ ft 0 rt PJ 03 0 ti φ 0 øJ 03 tf ti ti pi •^ μ- 0 tr
PJ O tf tf d tf rt O ft p ti p Hi ft Ω LΩ PJ Φ φ Ti μ- ti 03 03 tr μ- PJ l—l. Ω
P J μ- 0 φ d φ O PJ ft O d φ Hi Φ 3 03 03 Hi φ rt Φ 0 rt Ti φ 0 φ rt ti 03 0J s; Hi ft d o P ti o 0J Ti rt d μ- 03 μ- tf μ- rt ≤ Ti Ω P
. Ti rt Φ Ω μ- rt Hi 03 CΩ 3 Φ Ω Ω ■<: 03 P P Φ Hi 03 tr 0 ØJ Φ ft ft μ- ti 3 μ- <i PJ Φ ti Hi 03 PJ PJ Φ μ- Φ Hi ft Ω 0 Ω 0 Hi PJ ii iH ti Φ Φ 0 Φ Hi d Hi rt 0 PJ Ω Hi ti 0 μ- Hi 0 rt Ω PJ Ω ft Φ Hi μ- PJ tf 03 rt ti i Ω 3 0 tf Hi Hi J 03 Ω 03 Ω s; Ω μ- Ti Hi ^ d 0 μ- P 03 d J 03 tr 03 d μ] φ ti Φ 3 φ P tr d Ti Φ μ- d P μ- Hi 0 03 ft Hi 03 3 μ- rt
03 0 Hi ti o J-1 rt rt 03 φ 3 Φ μ- Hi 1 μ- P ti
Ω ft PJ 3 Pi PJ μ- rt rt rt tf $ PJ PJ 0 μ- tr PJ PJ Ω 03 φ X Φ 3
0 Hi PJ 1 ti 1 tf O tr Φ P 1 ti t Ti LQ rt 1 Ω φ rt 1 μ- ti Φ ti m φ Φ φ tf 0 Φ ft ft tf 1
1 > 1 P 03 Φ 1 03 Φ
the FFT algorithm is convenient to use if many values of σ are to be tested. he sharpness modifi ns proceed as fol¬
reen and blue image quare and have a ixels, which can
instance 256*256 s is a matrix of
for satisfactory ntinuation in an im mirrored in two di
ovided. For instanc
Modification of the sharpness in, for instance, the blue image can be calculated as BTk (u, v) =B (u, v) -Tk (u, v) where Tk(u,v) is the Fourier transform of the kth Gaussian filter. Instead of making a convolution which is demanding in terms of calculation, a multiplication is thus carried out instead.
The correlation between the sharpness-modified blue image and the green image can be calculated as:
Correspondingly, the correlation between a sharp- ness-modified green image and a blue image can be calculated as follows:
The result of these calculations will be approximately the same as in the above calculations in the convolution modules. The value of the parameter k which re- suits in a maximum correlation corresponds to the σ3 which would have given maximum correlation and is used to calculate the desired focus deviation.
For images containing only, or practically only, blood cells there is a possibility of making the above- mentioned Fourier transform more quickly. The reason for this is that the blood cells in an image look like small circles and there are no, or practically no, elongate objects in a specific direction in the image. Owing to this, it is possible to make an assumption that the Fou- rier transform of the image is rotationally symmetric about the zero point (for instance 33(0,0)). Therefore only one-dimensional Fourier transforms need be calcu-
lated, such as B(u,0) and G(u,0) . The above double sums will then instead be single sums, which simplifies the calculation. An even greater advantage of this method is that no two-dimensional, large intermediate results need be stored during the calculation, which significantly simplifies the hardware that need be used. This enables the use of a relatively slow and inexpensive DSP and therefore is a preferred embodiment .
Moreover it is not absolutely necessary to use all pixels in a row in the calculations. For certain types of images, down-sampling can be made, i.e. merely every nth pixel along a row is used in the calculations. This may give reliable results although the calculations can be made more quickly. Fig. 6 is a flow chart of a method according to the invention. In a first step, a first set of secondary images are generated based on a first image.
In a second step, a second set of a secondary images are generated based on a second image . In a third step, correlations between on the one hand the first image and, on the other hand, at least a subset of the second set of secondary images are calculated.
In a fourth step, correlations between on the one hand the second image and, on the other hand, at least a subset of the first set of secondary images are calculated.
In a fifth step, it is identified which degree of modification of the first or the second image results in the greatest correlation value that appeared in the third and fourth steps .
In a sixth step, an estimate is made of the distance or focus deviation between the focal plane of the first image and the reproduced object, in which estimate the identified degree and modification is input data.
The relative order of several of the above steps may be altered. The entire first set of secondary images need
not be created simultaneously. It is preferred to generate secondary images continually and at the same time determine correlations for created secondary images. The parameter calculator shown in Fig. 4 then controls the degree of sharpness modification until a relevant correlation maximum has been found. The set of secondary images then need not be made larger.
The above-described methods involve a two-dimensional image plane, a two-dimensional Fourier-plane and a one-dimensional Fourier-approximation, respectively. Further embodiments will now be described wherein more approximate, but less calculation-intensive, methods for determining σ3 are used. Starting out from the embodiment described in connection with fig 4, the convolution mod- ule 116 and the correlation module 122 in this figure, which modules blur the image b and correlate it with the image g, are depicted in fig 7a, performing the same functions and being represented with the reference numerals 164 and 168, respectively. As in fig 4 the convolu- tion module 164 performs a two-dimensional convolution. In order to distinguish this two-dimensional convolution from one-dimensional convolutions below, the convolution module 164 is denoted to perform the convolution *hij (σ3) . Similarly, the correlation module 168 performs a two- dimensional correlation as in fig 4. The signals 160, 162 and 166 correspond to the above-described signals 117, 119 and 118, respectively. The blur-parameter 172 corresponds to the above-described blur-parameter 127. The system in fig 7a hence corresponds entirely to features in fig 4.
In fig 7b, however, a one-dimensional correlation module 182 is introduced. The correlation module 168 is then replaced by sum-units 174 and 176 and a one-dimensional correlation module 182. The sum-units 174, 176 calculate the column-sums 178, 180, i.e. the sums of the pixel-intensities in each column, in each of the images 166 and 162, respectively. The result of the correlation
4-1 rd . 4-> 1 Φ Ti ti rd 1 ti Φ xi rd φ CQ CQ ti
-H Xi -H d d 03 Φ rd Xl 4-J CJ ti XI ti rd rH rd CQ
90 4-> Ti . H φ £ xi rH 4-1 O ti rd -H .5 rd P d Φ ro CQ 1 rd o P 4-> rH Φ 4-1 1 -. φ O φ rH CQ vH Ti SO Φ 1 & ti ι φ 3 Xl
CM 03 -H O x-i P CQ rH CJ Xl ti d Φ ti 4-1 ti Xl ε P -H Φ co XI ti 3 0 4 Ti 1 P 4J o rH φ £ P" Ti Ti 1 3 -H P tjl φ O 4-> Φ d ft ϋ 0 ϋ XI CQ 4-1 rH Φ -H J -H X rH o Ti 4-> tn 4-1 ti 0 d 0 & Ti -H £ rd 4 -H ft rd CQ rH 4-> 4-> U £ 03 Φ Φ 0 Ti ω rH Φ -H 03 td ti 3 ti 0 rH -H CQ £ 4-> rd 0 td -H -H CQ fd -H d ti X! CJ d b ft 4-> Φ 4-1 03 O ft P 4-1 Xl ti CQ Ti Ti -H Φ Φ ti 03 ϋ 4-1 d ft Φ £ Ti rd rd Φ Φ rd
H * 3 rd ti Φ X! rH ϋ ft d - XI tn ft -H O d Φ rH -H d 4J rH XI 4-1
C U -H rH Φ d CJ CQ rH 0 CQ rd CQ O φ 03 rd rd ft CQ Ti P d Φ 03 O d rH O α. Φ Xl -H CJ CQ rH J - O rH -H <= ft Φ >ι £ d rd 03 03 Φ ε Ti 0 d 03 -H -H
4-4 in ti is P Φ -H 03 ti rH 4-J φ H -H O ti Φ £ i CQ O -H 0 P CQ rd ti
0 φ ti 03 CQ Xl & φ rd ft -H 4J Ti Φ 4-> -H φ 0 rH 0 CQ -H ε 4-1 rd d d ε o
> 0 φ rd CJ XI ti ft £ rd Φ Xl Xl Φ 03 xl CO P 0 tn Φ 0 CQ -H φ φ CJ CQ Φ 03 4J -U rd Xl Xl ti 4-> tn £ ti 4-1 4-> 03 Φ < F ti rH £ £ -H rd < 4-1 4->
03 is rd Ti XI fd ε d Xl 4-1 4-> 0 -H O Φ td Ti . Xl SO O 0 4-1 φ 4-1 i rd -H
0 0 Φ U Φ P 03 0 rH ϋ -H ti rH 03 £ o rH Φ 00 4-1 rH -H t> Ti rd £ d
Xl Xl X! 4-1 4-1 φ 03 td CJ rd rd - — « 4-> Φ CQ -H 4-1 P" Φ VD 4-> d l td 1 rH Φ
4-1 ε P
Φ rd O M 1 ti O XI rd > Φ TJ J ti H tn Φ P 0 4-1 xl O ti rH 4-1 ti
CQ 0 i rH d & tn 4 O ti Ti Φ Φ > 1 rd rH ti rH rH υ £ CJ X! -H 03 £
0 4 4-1 Φ x-i O d rd -H ft Ti rd X! 0 O r rd CM Φ
4-1 d O £ . 4-J rH -H d
3 ti rH ti 0 Xl CQ ft Q. Φ ti 0 i rH Ti rH 4-J ε CJ 00 rH Ti Ti i> Φ Φ td CQ P φ 03
P d 0 t d td CJ tn Xl rH Φ 4-1 tn rH P Ti 0 d Xl 03 Xl Φ J CQ xi ti rH 0 4-> 0 -H φ CQ φ 4J 3 φ rH ti -H ti Ti rd ε 0 4-> ft 4-1 xi 0 £ 4-J Φ rd 0 -H J ti td CQ ti 3 CQ CQ Ti Ti 03 -H Φ 4-1 0 Φ 0 CJ Φ 4-1 Ti ft Xl
VD ""I CJ 4-> Ti φ 0 -H -H Φ 0 Φ S >, Xl 4-J rH £ d 4J 4-> CQ φ 03 Φ 4
CM "g td Φ φ Xl M rH -H Ti Xi Jl SH 4-1 03 rd 4-1 ti P X! o rH rd CQ td 4-1 ϋ CQ ti
Φ £ ti ti CJ CJ rH • 4-1 1 EH ti ft 0 rd Xl ε -H Ti Ti tn -H rd Xi 0 P ti Φ Φ 0
-H Xl ti rd td rd Φ Φ ti rd Φ rd J U XI d 0 ti Ti 4-1 d 4-> 4-1 tn TJ 0 Xi Xl 4J
CQ 4-1 0 & O Xl "S 0 3 d . rH Φ rH rd ti ti Xl fd ε Φ P 0 d d ti Φ -H 4J &
4-J £ ti CJ -H ti 0 d φ Φ o 0 P ϋ ε Ti ω 4-J ε rH -H Φ Φ 0 0 ti 4-1 CQ d 0 sχ> ft CQ 4-1 O rH 0 > SH ti -H 4-1 rd φ d d ti 0 CQ N ti rH -H CJ £ - TJ φ 0 -H CJ H ft CQ rd rd 4-1 Φ 4-> rH φ rd ft 4-> CQ O Ti 0 0 CQ > ti tr CQ CQ P 0 £ ti
-H rd -H -H d XI d rH Φ rH ti ft rd -H ti ft d d Φ CQ Φ 03 -H Φ Ti ti P 0
4-1 03 Φ Ti -. CQ ti -H 4-1 Φ rd Xl fd ε Ti ft φ 4-> 03 0 0 £ td 03 rd i> -H Φ 4-1 CQ ft ti ti tn Φ CM rH Φ ε rd -H X! 4-1 Φ Φ £ ft xi td Φ o u -H Xi XI -H rH ti CQ
Φ 0 rd ϋ V£> rd tn P > 4-1 rH ϋ O Xl ε rH P 4-1 rd 4-1 rH ti Ti & P CQ Ti & co Φ Φ ft £ P H ti rd CQ d Φ -H rH ti EH 0 rd 03 Xl Φ ti ti φ 1 £ 03 ti
0 4-> Ti O ε Xl rH ti ε 1 3 fd > 4-1 tn rd CQ d 1 tn φ 4-1 ti O Φ Xl φ Φ 0 td -H CJ rH X. ti ti td φ 03 -H -H ti O CJ Φ 4-1 Xl O ti -H Xl rd ti ϋ 4-> d 0 -H P" P O ft 3 φ SH Φ 03 ε ti rH P" Φ 4 l d -H ε £ 4-> Xl 0 Φ o O £ 4-> xl Φ 03 rH 0 CJ
3 xi tJ) ti Φ P 4-1 4-1 03 Xl J H CQ P 4-> ϋ Φ ϋ 4-1 4-1 P CJ 03 • fd Ti
03 " 4-1 tx td Φ Xl rH -H Φ 4-1 Φ fd d rH 4J ε Xl 0 .. rH P ti & d ^ rd 03 rH £ £ 4 0 Φ d 03 M 4 O • φ O rd 0 CQ Φ 4-1 xi Φ ti d 0 CQ φ 0 tn rd d xi 4-1 4-1 -H -H ϋ Φ tn -H ti 4-1 fd SH rH ε CJ Xl ti d Xl t l 4-1 φ -H Φ Xl rH -H 0
Φ 0 ti Ti Φ ti -H 0 0 O ti ft Φ -H 4J 4-1 rd EH d CQ -H rd Ti d • i φ 4-1 CQ d <: P ft > Ti φ Φ td -H 4-1 ti iH Ti 0 CQ α. 4J Φ 03 CQ -H
^F Xl rd rH t ti XI td 4-1 co EH φ CJ td Φ Φ CQ Φ CJ rd Φ 1 Xl 03 tn £ . xl rd O Φ CJ Φ d P" Φ ϋ
H N -H d ti Xl rd CQ d rH ti 4J ϋ rH φ 4-> φ ti Ti 4J ti Pi ft 3 CQ 0 4-1 Ti Xi Ti Φ
• -H 4-1 0 O J rH -H rH Φ rd rd ■H d ϋ -H XI Φ 0 H Φ d ti rH d -H Φ EH Φ ti
- — - CQ -H -H rd rd rd > 3 rd Φ 0 φ ti tn t CJ CQ -H 03 -H 0 fd 0 4J 03 XI 03 -H d CQ CQ φ CQ ti 4-1 ti Φ -H CQ d 03 CJ φ d P d 4-J 4-1 d ft P Φ -H CQ Ti tn Φ tn d -H CQ -H tn d Φ <: 4J CQ 0 Φ d ti rd tn Ti 0 CJ . O O ti 0 CQ rH M ti Φ
-H Xl -H Φ Xl rd Xl -H 0 > 0 03 Φ -H O xi -H φ l -H φ -H P r
•5
Φ -H Φ 0 rd CJ ti -H
O. 4-J 4 CQ ε EH J 4-> CQ J 0 X! Φ rH CQ ti 4J 03 4-1 U 4-J ti 4-> Ti H 4-1 x-i ft CQ ti > ε CQ ft o
1
1 1 Ti 1 d rd 0 d
0 £ £ o υ £ u
P d o Φ CQ 0 Φ
Xl -H xl
4-J φ 4-1 4-1
H 03 P U 0 φ rH α. 4-1 Xl 0 φ
4J > u
03 ti rd
Ti 4-1 0 rH ti 0 CJ ft
0 ft ti φ 3:
03 φ xl φ
Φ TS 4-1 d ti ti ti 0 Ti CQ
0 d 4-1 J Φ • rd -H
Xl 4->
,-- 4-1 rH d
C- ti ti Γ H
CM 0 03 03 H
-H d Φ •
4-> -H 4-1 CQ ϋ tn -H Φ
Φ d φ d J ti rd Xl P rd
-H xl 4J 1 rH
Ti u £ ft
1 4 P
-r-i CJ CQ Ti
— o Φ φ
4-1 φ tn
CQ x-i 4-1 xl d
£ td 4-1 td
0 Φ xl
S-J x-i 4-1 Ti u
P 0 -----
4-1 TJ d Φ
0 0 tn >
£ CQ -H rd d Φ 4-1 Xl
0 d O
-H 0 T! ti o
4J -H H σ. fd 4-1 CQ
£ P d
£ rH 0 φ
P 0 -H rH
summations need not be done again when the blur-parameter is changed.
The one-dimensional approach of figure 7e, implemented together with its mirrored units as mentioned above, thus results in a computationally inexpensive embodiment of the invention. When that embodiment is applied to the image pairs of figure 2, it results in the correlation curves shown in figure 8. Those correlation curves are the one-dimensional approach versions of the corresponding curves in figure 5a. The correlation curves 210, 211 ... 215 in figure 8 are to be compared, in the mentioned order, with the corresponding curves 130, 131 ... 135 in figure 5a. Such a comparison shows that the one- dimensional approach gives results that are fairly con- sistent with those from the computationally much more expensive two-dimensional approach.
As described above the globally greatest value of p(σ3) and p~(σ3), which may also be denoted the global maximum, and the corresponding σ3 can be used to deter- mine the focus deviations z_ and z2 in order to achieve optimal mechanical focusing. The value of σ3 corresponding to this global maximum may however also be used in a method which will now be described and which may be called "electronic focusing" . In this method the sharp- ness of the pair of images above, i.e. the blue image and the green image, is enhanced by means of digital signal processing. There are at least two substantial advantages with such a method. Firstly, a pair of images which are not perfectly focused may still be useful in a subsequent image processing or analysis. Then, valuable time may be saved, since the optical system need not halt its scan to refocus the image area in question. Secondly, the pair of images may be enhanced until it is comparable with a pair of images acquired with a much more expensive optical system, which is substantially free from longitudinal chromatic aberrations.
The electronic focusing method uses the σ3, or k in the Fourier approach, corresponding to the globally greatest correlation as input to a model, which may be embodied as a function or a table. In order to provide the information on which of the images that was modified, the σ3 may be given a sign, too. The model is based on properties of the optical system and generates two sets of filter parameters, one for each image in the pair of images. By using such filter parameters to "tune" a digi- tal sharpening filter, as will be described below, the images are "moved" towards their respective focus plane. The table or function depends on the distance z12 and the depth of field for each color component, i.e. how σi and σ2 depend on z_ and z2, respectively. By performing this operation a pair of images, acquired at non-optimal focus by means of an optical system which involves certain longitudinal chromatic aberrations, may be improved so that it corresponds to a pair of images acquired by means of an optical system that is free from such aberrations and at optimal focus. Of course, noise is introduced when images are sharpened. The usefulness of the method is therefore limited by the size of the focus displacement and the magnitude of the chromatic aberrations. Let the actual blurring of one of the images due to the displacement of the focal plane be denoted σ. Then it is known that the captured image is related to the optimally focused image according to:
/ cap = 1 opt * G σ
where Icap denotes the captured image, Iopt the optimally focused image, * convolution and
G = ■ (i2 + j2)/2σ2
-=-e σ 2πσ2
where i,j denotes a pixel position.
In the Fourier-domain this convolution may be written as a multiplication:
FI (u,v) = FI ,v)< FGσ{u,v) cap ' opX '
wherein FIcap etc denotes Fourier transforms and the dot denotes ordinary multiplication. The fourier transform of Gσ can be written as
FG - e- ( 2 + v2)σ2 /2 where u and v denote the variables which in the Fourier domain correspond to i and j .
There are at least three different alternatives to approximately recover Iopt from Icap- The basic idea consists in multiplying the Fourier transform of Icap with the l/FGσ and then use the inverse Fourier transform to get I0pt- However, in most cases it is faster to take the inverse transform of l/FGσ, which is then used to filter leap with. The main problem is that when noise is present in the image it gets amplified when l/FGσ is large, i.e. when FGσ is close to zero, i.e. for high frequencies.
A first possibility to remedy this is to use the so called Wiener filter, which is obtained by interchanging 1/ FGσ with
FG
FH = ■ σ
W FG σ2 + K
where is a constant that is dependent on the noise level. In practice this constant has to be determined experimentally. Observe that when FGσ is large FHW is close to l/FGσ and when FGσ is small FHW is bounded. In fact,
it may be shown that when K is equal to the Fourier transform of the noise, the Wiener filter is optimal in the sense of maximizing the signal to noise ratio. Again the Wiener filter FHW is transformed to the signal domain and used as a convolution filter.
A second possibility is to truncate the Fourier transform of FGσ before inverting it. This can be done in several ways, e.g. by replacing FGσ by an increasing function for higher frequencies. Again the Wiener filter FHW is transformed to the signal domain and used as a convolution filter.
A third possibility is to use a sharpening filter presented in WO 01/04683 to filter the image. The circular symmetric function of this filter is defined as:
The cut frequency ω0, as well as the parameters γ and ωi, which are needed to define the sharpening filter above the cut frequency, should be selected experimentally. These three parameters will depend on the signal to noise ratio in the captured images, which in turn will depend on the noise level, the frequency spectrum of the typical objects, and on the focus deviation to be compensated. Therefore these parameters may differ from one focus deviation to another. By putting
lω0 2 = σ2 l2
the sharpening filter will, up to the cut frequency, fully compensate for the blur.
In practice, the above functions may be implemented as a lookup-table, wherein a σ3 that implies a globally greatest correlation p (σ3) (p~(σ3)) is used to obtain suitable and different sets of parameters for filtering
not only the blue image, but also the red and green image. The design of such a table will be discussed below. Figure 9 illustrates an image processing method 220 as described, that performs "electronic focusing" . The first five steps 221- 225 of this method correspond entirely to the first five steps 151- 155 in figure 6. However in a sixth step 226 in this method the σ3 that implied the greatest correlation is fed to a lookup-table whereby a set of filter parameters corresponding to σ3 is obtained. The image is then filtered 227 with a filter using these parameters in order to enhance the image. These steps may in an arrangement as described in connection with figure 4 be implemented by feeding σ3 from the parameter calculator 126 to the image processing means 110. The lookup-table may be incorporated in the image processing means 110 which also performs the filtering of the respective images.
Figure 10 illustrates how a lookup table generally could be designed. Of course, the actual parameters must be determined experimentally for each individual type of optical system. The figure illustrates, schematically, the blur-levels for blue and green images when the imaged object is placed on different distances from the image sensor along the optical axis. A similar v-shaped curve (not shown) may be drawn for the red image. A dashed line illustrates the difference between the green and blue blur-levels. In general, the blue and green images will be optimally focused (minimally blurred) in one point, D and B respectively, along the optical axis. For each σ3, or k in the Fourier case, within the working area, corresponding to z12, it may therefore be determined how much each of the images have been blurred by their respective focus deviations. In the depicted example for σ3=-bκ these magnitudes may be calculated as σb=bc-bD for the blue im- age and σg=bA-bB for the green image. As described above these calculated quantities may be used in order to obtain suitable filter parameters for filtering the respec-
M t μ1
<-π o CJI o (Jl rt rt rt tf rt rt Hi Hi μ- ft tr μ- tf μ- rt tr 03 03 3 rt rt
PJ μ- øJ J tf tr μ- O 0 i φ 3 Φ ti Φ φ ^ Ω Φ øj μ- μ- Ω ti 03 Φ φ ii Ω Ω <i ti J rt 03 0 P μ- <1
P J Ω μ- 03 01 J rt μ- Hi CΩ ■ PJ Φ ti rt Ti rt ti Φ
Φ 03 Hi 03 rt rt tr øj 1 φ Φ ti 03 03 Φ φ 03 φ
TJ . 0 φ Φ PJ rt Hi Φ H Ω Φ 3 Hi ft μ- J 03 0 Ω Ω μ- TS ft rt μ- J ^ ti 0 P 0 ft 0 Pi tr 3 ti ^ ] Hi ti 0 3 0 Ω tr Ti Ti tf Hi ti Φ Hi J
PJ 03 tr 03 P PJ 0J J pi P ft μ- ØJ rt 03 Φ μ- ØJ ft 0 lΩ
3 rt Φ ft ft CΩ P rt 0 Ω P μ- ti 03 P 03 rt μ- Hi Φ
Φ Φ tf ft Φ φ 03 tr Hi tr Ω 3 . tf Ω ti 03 rt 3 Hi μ- Φ μ- PJ Φ μ-1 0 PJ 3 0 tr Φ 0J < rt •
Φ 0 03 <1 3 μ- 0 Ω ti $, i tf PJ rt φ P Φ tf
Hi Ω μ- Pi 03 Hi ΪT o ■-i tr Φ l—i. h tf φ 0J ti Φ O
03 tr ti ft P) CΩ P P Hi μ- Ti φ 03 ^ Φ ti Ti tf rt Hi
Φ 03 φ ct Φ 3 rt 0 ft Φ Ω Hi Ω >< Hi Ti Φ μ- Hi
Hi ti CQ μ- 0 tr => 03 " o ft 03 rt ft Φ 0 Φ Ω
0 φ ft Hi 0 PJ ft Φ ti μ- ft rt tf 0 Φ P 3 P ft 0
Hi ØJ μ- φ ti ii μ- 3 rt PJ ti 0) Φ Φ Ti 03 ft 0 ti
03 03 φ Φ Hi Hi ft PJ tf Ti Ω P 3 rt Ω Φ ft μ- μ- Hi
Hi rt 0 μ- μ- μ- lΩ Φ Ti Φ ft TJ μ- ti ft μ- 03 3 03 μ- rt 01 0 ti Φ φ ii 03 φ Hi 03 Hi ϋ Ω μ- Hi ØJ Φ tf P Hi 03 ft 03 rt μ- 0 01 0 Φ PJ tf Ω μ- P CΩ rt Φ Ω tf 03 ft pi μ- 3 X rt ti 03 Φ Φ 0 Φ
Φ Φ 3 j φ tf P 03 ØJ μ- tf Hi Φ ft P) ft rt J ti tf 0 ti ti ^ μ- Ω CΩ 3 φ O Φ P 03 μ- Hi μ- 3 ft ii ft 3 Φ ti Φ PJ Ω 03 rt ■<: ØJ 3 μ- Hj ii 03
P ti ØJ μ- μ- p) P) 03 . rt 0 01 rt 03 tr 03 ti Φ 0 μ- iQ Hi > Hi Hi PJ CQ φ Φ tr μ- μ- ft 0 • 03 3 3 °x μ- Pi ft Φ lΩ ft IH l_J. 3 ti Φ <! <1 rt μ. ) rt Hi tr Ω Ω φ ti tf i φ T PJ < 3 φ td PJ Hi rt tf 01 Φ PJ rt "<! CQ Φ Φ Ω rt φ 03 <! Hi μ- tf 01
Φ Ω rt O Hi rt J £, ft rt 0J μ- P φ μ- Ω Φ ti ft ti μ- ti φ φ tf rt tr 3 Φ P P rt 03 rt P 0 rt μ- O 03 0 XI φ PJ Φ μ- Φ Hi 0 Φ CΩ μ- ti tf ti Φ rt Ti
3 Hi Φ P μ- ti rt Hi Ω rt μ- ti 0 Ω Φ rt 03 ft pi Pi J ft 03 PJ 03 tr tr ti tr rt ti tf tf tf ii
CQ 3 PJ I-1 0 rt rt 0 Φ Hi Φ tf μ- 0 ■Z tf PJ
Φ ØJ rt ti Φ tf tr tr ft 03 0 φ Hi 0J P ti 0J ^ Φ 3
> 0 ft 03 • ! rt Φ PJ ØJ Hi 0 Φ 03 <1 CΩ ^ • Φ
Φ rt tr p 03 μ- tf ti Hi Φ tf 03 rt rt tf ti rt μ- 03 ØJ 03 03 0 Φ CΩ 0 J Ω P tf Φ
Φ φ Φ tr 3 tf rt tr N ØJ s; 03 μ- Ω rt PJ rt P) $, Φ ii
Ω Hi φ PJ ) PJ Φ Ω ft P ti Φ 3 μ- μ- rt ti O rt ti rt ti Hi HI tf rt μ- CΩ 03 03 φ < 3 Ct ø) c. ii 03 Ω r Φ TJ tf TJ O 0 ØJ tf 3 Hi φ μ- tr tr
0 Φ ti P ft -" φ P Ω ϋ μ- ØJ rt ft rt PJ Ω μ- o tJ ft 03 0 φ PJ ØJ 03 rt 0 Φ O 03 3 Hi P < 3 μ- $ 0 P) Hi 03 Hi Ω μ- Φ 0 Φ PJ
Ω rt rt P P ti μ- 03 Hi rt H ti PJ μ- PJ 0 rt 03 t
PJ 0 tr ft Hi 0 Ti Φ 0 CΩ PJ Hi tr Ω tr Φ
Φ ft rt 03 o 3 \-> ii Ω Hi rt 3 0 0 Φ 3 tr
0 μ- tr rt ft Hi PJ μ- ti 0J μ- μ- Φ Φ ft Ti &* Φ
^ tr 0 03 Φ tr rt ti N 03 Hi O rt < Φ 0
1 Ti 1 PJ 01 rt tf φ Φ 03 P tf Φ 3 ft 0
1 rt P tf Φ ft rt 0 P ØJ μ- tr ft Φ ft ►<; 1 1