[go: up one dir, main page]

SE519942C2 - Focus deviation estimation method in optical system, involves modifying sharpness of image by processing predetermined degree so that two images are equally sharpened - Google Patents

Focus deviation estimation method in optical system, involves modifying sharpness of image by processing predetermined degree so that two images are equally sharpened

Info

Publication number
SE519942C2
SE519942C2 SE0004046A SE0004046A SE519942C2 SE 519942 C2 SE519942 C2 SE 519942C2 SE 0004046 A SE0004046 A SE 0004046A SE 0004046 A SE0004046 A SE 0004046A SE 519942 C2 SE519942 C2 SE 519942C2
Authority
SE
Sweden
Prior art keywords
image
sharpness
images
focus
modification
Prior art date
Application number
SE0004046A
Other languages
Swedish (sv)
Other versions
SE0004046L (en
SE0004046D0 (en
Inventor
Anders Rosenqvist
Martin Almers
Anders Heyden
Original Assignee
Cellavision Ab
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Cellavision Ab filed Critical Cellavision Ab
Priority to SE0004046A priority Critical patent/SE519942C2/en
Publication of SE0004046D0 publication Critical patent/SE0004046D0/en
Priority to AU2002212914A priority patent/AU2002212914A1/en
Priority to PCT/SE2001/002418 priority patent/WO2002039059A1/en
Publication of SE0004046L publication Critical patent/SE0004046L/en
Publication of SE519942C2 publication Critical patent/SE519942C2/en

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C3/00Measuring distances in line of sight; Optical rangefinders
    • G01C3/32Measuring distances in line of sight; Optical rangefinders by focusing the object, e.g. on a ground glass screen
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C3/00Measuring distances in line of sight; Optical rangefinders
    • G01C3/10Measuring distances in line of sight; Optical rangefinders using a parallactic triangle with variable angles and a base of fixed length in the observation station, e.g. in the instrument
    • G01C3/14Measuring distances in line of sight; Optical rangefinders using a parallactic triangle with variable angles and a base of fixed length in the observation station, e.g. in the instrument with binocular observation at a single point, e.g. stereoscopic type
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C3/00Measuring distances in line of sight; Optical rangefinders
    • G01C3/10Measuring distances in line of sight; Optical rangefinders using a parallactic triangle with variable angles and a base of fixed length in the observation station, e.g. in the instrument
    • G01C3/18Measuring distances in line of sight; Optical rangefinders using a parallactic triangle with variable angles and a base of fixed length in the observation station, e.g. in the instrument with one observation point at each end of the base

Landscapes

  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Microscoopes, Condenser (AREA)
  • Automatic Focus Adjustment (AREA)
  • Image Processing (AREA)

Abstract

An image reproducing an object, has a focal plane located at a known distance (Z12) from the focal plane of previous image whose sharpness is modified by signal processing at a predetermined degree so that two images are equally sharpened. The focus deviation between object and the focal plane of previous image is estimated based on the modification degree and the distance. Independent claims are included for the following: (1) Optical system arrangement; (2) Digital memory medium storing focus deviation estimation program; (3) Microscope system; (4) Digital image processing method.

Description

lO 15 20 25 30 35 2 Vid en sådan avsökning krävs ständiga omfokuserin- gar, eftersom provglaset sällan är plant och eftersom den mekanism som förskjuter objektet transversellt inte kan antas vara perfekt i den betydelsen att ingen förflyttning längs den optiska axeln sker. Om systemet skall kunna leverera nya, välfokuserade bilder exempelvis med frekvensen 5OHz måste då fokusering ske både snabbt och tillförlitligt. 10 15 20 25 30 35 2 Such a scan requires constant refocusing, since the test tube is seldom flat and because the mechanism that displaces the object transversely cannot be assumed to be perfect in the sense that no movement along the optical axis takes place. If the system is to be able to deliver new, well-focused images, for example with the frequency 5OHz, then focusing must take place both quickly and reliably.

Fokuseringen kan sägas ha två ingående steg. I ett första steg uppskattas fokusavvikelsen, dvs avståndet mellan det optiska systemets fokusplan, och objektet. andra steg kan det optiska systemet justeras, eller kan det avbildade objektet förflyttas så att det hamnar De små förflytt- vilket systemet avbildar föremål med optimal skärpa, I ett närmare det optiska systemets fokusplan. ningar som krävs för genomförande av det andra steget kan åstadkommas relativt tillförlitligt med hjälp av växlade stegmotorer eller med piezoelektriska kristaller. Ett jämförelsevis svårare problem är då att i det första steget snabbt, enkelt och billigt åstadkomma en till- förlitlig skattning av fokusavvikelsen.The focus can be said to have two basic steps. In a first step, the focus deviation, ie the distance between the focus plane of the optical system, and the object is estimated. second step, the optical system can be adjusted, or the imaged object can be moved so that it ends up The small move- which the system images objects with optimal sharpness, In a closer focus plane of the optical system. The steps required to perform the second step can be achieved relatively reliably by means of shifted stepper motors or with piezoelectric crystals. A comparatively more difficult problem is then in the first step to quickly, easily and cheaply achieve a reliable estimate of the focus deviation.

Skattningen av fokusavvikelsen baseras på en fokus- mätprincip, mått, dvs ett förfarande, som genererar ett fokus- dvs ett mått på hur välfokuserat systemet är.The estimation of the focus deviation is based on a focus-measurement principle, measure, ie a procedure, which generates a focus- ie a measure of how well-focused the system is.

Fokusmätprincipen kan vara aktiv eller passiv, såsom kommer att förklaras nedan. Fokusmåttet kan vara rela- tivt, exempelvis stickprovsvariansen av bildens ingående pixelintensiteter, eller absolut, dvs ett direkt mått på fokusavvikelsen.The focus measurement principle can be active or passive, as will be explained below. The focus measure can be relative, for example the sample variance of the image's included pixel intensities, or absolute, ie a direct measure of the focus deviation.

Ett exempel på en aktiv fokusmätprincip är att ut- nyttja infrarött ljus som utsänds av det optiska systemet och som reflekteras av det objekt som skall avbildas.An example of an active focus measurement principle is to use infrared light emitted by the optical system and which is reflected by the object to be imaged.

Sådana fokusmätprinciper används i många stillbilds- kameror med autofokusering. Nackdelen med en sådan princip är, förutom att den kräver en extra ljuskälla, extra optik, extra sensorer och särskild kalibrering, att den endast fungerar tillfredsställande om det är det lO l5 20 25 30 35 519 942 3 intressanta objektet eller delobjektet i exempelvis ett prov som reflekterar det infraröda ljuset och inte till exempel ett täckglas applicerat på provet.Such focus measurement principles are used in many autofocus still cameras. The disadvantage of such a principle is, in addition to requiring an extra light source, extra optics, extra sensors and special calibration, that it only works satisfactorily if it is the object or sub-object of interest in, for example, a sample. which reflects the infrared light and not, for example, a coverslip applied to the sample.

Hädanefter behandlas endast passiva fokusmätprin- ciper. Då passiva fokusmätprinciper används utnyttjas informationen från en eller flera mottagande bildsensorer för att erhålla ett fokusmått. Ett bra relativt fokusmått skall då ha sitt maximum eller minimum vid optimalt fokus. Ett exempel på fokusmått vid passiva mätningar är den pixelvisa stickprovsvariansen i en bild. En illa fokuserad och därmed mera suddig bild ger då lägre stickprovsvarians än en bättre fokuserad och därmed mera kontrastrik bild.From now on, only passive focus measurement principles will be treated. When passive focus measurement principles are used, the information from one or more receiving image sensors is used to obtain a focus measurement. A good relative focus measure should then have its maximum or minimum at optimal focus. An example of a focus measure for passive measurements is the pixel-wise sample variance in an image. A poorly focused and thus more blurred image then gives lower sample variance than a better focused and thus more contrast-rich image.

Det är dock inte säkert att det endast med utgångs- punkt från en sådan bild går att uppskatta fokusavvikel- sen. Det kan ju vara så, att det avbildade objektet per se är tämligen kontrastfattigt och därmed ger en låg stickprovsvarians, vilket tyder på en stor fokusavvik- else, trots att bilden är jämförelsevis väl fokuserad.However, it is not certain that it is only possible to estimate the focus deviation on the basis of such an image. It may be the case that the imaged object per se is rather poor in contrast and thus gives a low sample variance, which indicates a large focus deviation, despite the fact that the image is comparatively well focused.

Och även om så inte är fallet vet man inte från ett enda värde på stickprovsvariansen åt vilket håll det avbildade objektet skall förflyttas för att erhålla optimalt fokus.And even if this is not the case, it is not known from a single value of the sample variance in which direction the imaged object is to be moved in order to obtain optimal focus.

Ett system baserat på en sådan fokusmätprincip kommer därför att justeras åt fel håll vid första försöket i 50% av fallen och blir därför långsamt. En avsökande mikro- skopering stannar dessutom upp.A system based on such a focus measurement principle will therefore be adjusted in the wrong direction at the first attempt in 50% of cases and will therefore be slow. A scanning microscopy also stops.

En möjlig metod att göra en sådan fokusmätprincip snabbare är att tillföra systemet extra optik som möjlig- gör beräkning av fokusmått i flera bildplan samtidigt.A possible method of making such a focus measurement principle faster is to add extra optics to the system that enables the calculation of focus dimensions in several image planes simultaneously.

Ett exempel på ett sådant system visas i US-A-5 912 699.An example of such a system is shown in US-A-5,912,699.

Där används tre bildsensorer, med tre åtskilda fokusplan.It uses three image sensors, with three separate focus planes.

Nackdelarna med sådana system är framför allt högre pris och ökad komplexitet. Sådana system kan heller inte göra tillräckligt korrekta mätningar på preparat som innehål- ler flera skikt, eftersom dessa skikt stör varandra då fokusmått baserade på varians beräknas. 10 15 20 25 30 35 519 9152 4 Sammanfattning av uppfinningen Ett ändamål med föreliggande uppfinning är att helt eller delvis avhjälpa ovannämnda problem.The disadvantages of such systems are above all higher price and increased complexity. Such systems can also not make sufficiently accurate measurements on preparations that contain several layers, since these layers interfere with each other when focus measurements based on variance are calculated. Summary of the Invention An object of the present invention is to completely or partially remedy the above-mentioned problems.

Detta ändamål uppnås med ett förfarande för upp- skattning av avståndet mellan en del av ett objekt och ett fokusplan tillhörande en första bild som avbildar ob- jektet enligt krav 1, ett optiskt system enligt krav 12, ett minnesmedium innehållande ett datorprogram enligt krav 15 och ett mikroskopsystem enligt krav 17.This object is achieved with a method for estimating the distance between a part of an object and a focus plane belonging to a first image depicting the object according to claim 1, an optical system according to claim 12, a memory medium containing a computer program according to claim 15 and a microscope system according to claim 17.

Närmare bestämt avser uppfinningen enligt en första aspekt ett förfarande, i ett optiskt system, för upp- skattning av avståndet mellan ett objekt och ett fokus- plan tillhörande en första bild som avbildar objektet.More particularly, according to a first aspect, the invention relates to a method, in an optical system, for estimating the distance between an object and a focus plane belonging to a first image which depicts the object.

Förfarandet kännetecknas av att en andra bild utnyttjas, som har ett fokusplan beläget på ett känt avstånd från den första bildens fokusplan, av att den första bildens skärpa modifieras genom signalbehandling med en grad så att den första och den andra bilden är väsentligen lika skarpa, och att avståndet mellan objektet och den första bildens fokusplan uppskattas på basis av denna grad av modifiering och nämnda kända avstånd.The method is characterized in that a second image is used, which has a focus plane located at a known distance from the focus plane of the first image, in that the sharpness of the first image is modified by signal processing by a degree so that the first and the second image are substantially equally sharp, and that the distance between the object and the focus plane of the first image is estimated on the basis of this degree of modification and said known distance.

Enkelt uttryckt utnyttjar systemet det faktum att den av de första och andra bilderna vars fokusplan ligger närmast det avbildade delobjektet kommer att se skarpast ut. Hur mycket den skarpare bilden behöver göras suddi- gare (eller den suddigare bilden göras skarpare) för att de två bilderna skall ha lika stor skärpa är ett mått på hur mycket närmare delobjektet den skarpare bildens fo- kusplan ligger. Om den första och den andra bilden är lika skarpa/oskarpa kan det antas att delobjektet ligger mitt emellan de båda bildernas fokusplan. Om det inbördes avståndet mellan fokusplanen är känt kan avståndet mellan vart och ett av dessa och delobjektet uppskattas.Simply put, the system takes advantage of the fact that the one of the first and second images whose focus plane is closest to the depicted sub-object will look sharpest. How much the sharper image needs to be blurred (or the blurred image sharpened) for the two images to have equal sharpness is a measure of how much closer the sub-object of the sharper image's focus plane is. If the first and second images are equally sharp / blurry, it can be assumed that the sub-object is located between the focus plane of the two images. If the mutual distance between the focus plan is known, the distance between each of these and the sub-object can be estimated.

Ett sådant förfarande har visat sig prestera till- förlitliga skattningar mycket snabbt. Skattningarna ger inte bara om hur stor en fokusavvikelse är, utan dvs åt vilket håll syste- uppgift, även om vilket tecken den har, lO l5 20 25 30 35 519 Qfizfíiiiiiïf, i i 5 mets optik eller objektet skall justeras. Det krävs nor- malt ingen extra optik för att realisera systemet, vilket ger ett billigt mätförfarande.Such a procedure has been shown to perform reliable estimates very quickly. The estimates do not only indicate how large a focus deviation is, but also in which direction the system task, even if it has a sign, i 10 l 25 20 25 30 35 519 Qfizfíiiiiiïf, i i 5 mets optics or the object should be adjusted. No extra optics are normally required to realize the system, which provides a cheap measurement procedure.

Företrädesvis ingår vidare i förfarandet stegen: att generera en första uppsättning sekundära bilder utifrån den första bilden, genom olika grader av modifiering av skärpan i den första bilden; att uppskatta en första upp- sättning korrelationer mellan överlappande delar av å ena sidan åtminstone en delmängd av den första uppsättningen sekundära bilder och å andra sidan den andra bilden; att identifiera den grad av modifiering av skärpan som resul- terar i den största bland korrelationerna, varefter den identifierade graden utnyttjas vid skattningen av av- ståndet mellan objektet och den första bildens fokusplan.Preferably, the process further includes the steps of: generating a first set of secondary images from the first image, by varying degrees of modification of the sharpness of the first image; estimating a first set of correlations between overlapping portions of on the one hand at least a subset of the first set of secondary images and on the other hand the second image; to identify the degree of modification of the sharpness that results in the largest of the correlations, after which the identified degree is used in estimating the distance between the object and the focus plane of the first image.

Korrelation mellan överlappande delar av två bilder ger ett mycket bra mått på hur lika skärpan i bilderna är.Correlation between overlapping parts of two images gives a very good measure of how equal the sharpness of the images is.

Enligt en föredragen utföringsform innefattar för- farandet vidare de ytterligare stegen: att generera en andra uppsättning sekundära bilder utifrån den andra bil- den, genom olika grader av modifiering av skärpan i den andra bilden; och att uppskatta en andra uppsättning kor- relationer mellan överlappande delar av å ena sidan åt- minstone en delmängd av den andra uppsättningen sekundära bilder och å andra sidan den första bilden. Då sker nämnda identifiering även med utgångspunkt från nämnda andra uppsättning korrelationer; och hänsyn tas, vid upp- skattningen, även till vilken av nämnda första och andra uppsättningar korrelationer som inbegriper det största värdet.According to a preferred embodiment, the method further comprises the further steps of: generating a second set of secondary images from the second image, by varying degrees of modification of the sharpness of the second image; and estimating a second set of correlations between overlapping portions of on the one hand at least a subset of the second set of secondary images and on the other hand the first image. Then said identification also takes place on the basis of said second set of correlations; and consideration is also given, in the estimation, to which of the said first and second sets of correlations includes the greatest value.

Detta medger en jämförelsevis exakt mätning av av- ståndet mellan objektet och den första bildens fokusplan och modifieringen av skärpan behöver endast göras genom minskning av skärpenivån, vilket benämns blurrning.This allows a comparatively accurate measurement of the distance between the object and the focus plane of the first image, and the modification of the sharpness only needs to be done by reducing the sharpness level, which is called blurring.

Företrädesvis innebär modifieringen av skärpan åt- minstone minskning av skärpan, företrädesvis medelst ett gaussiskt, eller approximativt gaussiskt filter. l0 l5 20 25 30 35 519 942 6 Detta är en jämförelsevis snabb och enkel metod, som inte tillför brus till bilden.Preferably, the modification of the sharpness means at least a reduction of the sharpness, preferably by means of a Gaussian, or approximately Gaussian filter. l0 l5 20 25 30 35 519 942 6 This is a comparatively fast and simple method, which does not add noise to the image.

Enligt en utföringsform innebär modifieringen av skärpan åtminstone ökning av skärpan, medelst ett approximativt inverst gaussiskt filter.According to one embodiment, the modification of the sharpness means at least an increase of the sharpness, by means of an approximately inverse Gaussian filter.

En sådan utföringsform medger exakt mätning av ovan- nämnda avstånd, så länge delobjektet ligger mellan den första och den andra bildens respektive fokusplan, även om endast den första bildens skärpa modifieras.Such an embodiment allows accurate measurement of the above-mentioned distance, as long as the sub-object lies between the respective focus plane of the first and the second image, even if only the sharpness of the first image is modified.

Företrädesvis utförs modifieringen av skärpan med- elst en faltning, vilket är ett relativt snabbt för- farande.Preferably, the modification of the sharpness is carried out by means of a folding, which is a relatively fast procedure.

Enligt en utföringsform av föreliggande uppfinning fouriertransformeras den första och den andra bilden, varefter nämnda modifiering av skärpan och nämnda upp- skattning av korrelationer utförs i frekvensdomänen. Om fouriertransformeringen kan ske snabbt medger detta enk- lare modifiering av skärpan och uppskattning av korrela- tioner. Det blir framför allt ett snabbare förfarande om många skärpemodifieringar och många korrelations- skattningar skall göras.According to an embodiment of the present invention, the first and the second image are Fourier transformed, after which said modification of the sharpness and said estimation of correlations are performed in the frequency domain. If the Fourier transform can take place quickly, this allows for easier modification of the sharpness and estimation of correlations. Above all, it will be a faster procedure if many sharp modifications and many correlation estimates are to be made.

Företrädesvis genereras den första bilden medelst ljus inom ett första våglängdsområde och den andra bilden genereras medelst ljus inom ett från det första våg- längdsområdet åtminstone delvis skilt andra våglängds- område.Preferably, the first image is generated by light within a first wavelength range and the second image is generated by light within a second wavelength range at least partially separate from the first wavelength range.

Enligt ett sådant förfarande utnyttjas att optiken har en bristande longitudinell färgkorrektion. Ingen ex- tra sensor behöver då användas, men den första och den andra bilden kan ändå registreras utan omjustering av op- tiken.According to such a method, it is utilized that the optics have a lack of longitudinal color correction. No additional sensor needs to be used, but the first and second images can still be registered without readjustment of the optics.

Enligt en alternativ utföringsform genereras den första bilden före en till belopp och tecken känd juster- ing av systemets optik och den andra bilden genereras ef- ter nämnda justering.According to an alternative embodiment, the first image is generated before an adjustment of the system optics known in terms of amount and character, and the second image is generated after said adjustment.

Detta ger en enkel och tillförlitlig mätmetod i sy- stem där sådan justering sker av annan anledning. 10 15 20 25 30 35 519 94") 7 Enligt en andra alternativ utföringsform genereras den första bilden före en till belopp och tecken känd förflyttning av objektet i förhållande till ett fokusplan hos det optiska systemet och den andra bilden genereras efter nämnda förflyttning.This provides a simple and reliable measurement method in systems where such adjustment takes place for another reason. 10 15 20 25 30 35 519 94 ") 7 According to a second alternative embodiment, the first image is generated before a movement of the object known in terms of amount and character in relation to a focus plane of the optical system and the second image is generated after said movement.

Detta ger en enkel och tillförlitlig mätmetod i sy- stem där sådan förflyttning sker av annan anledning.This provides a simple and reliable measurement method in systems where such movement takes place for another reason.

Enligt en tredje alternativ utföringsform registre- ras den första bilden medelst en första bildsensor och den andra bilden registreras medelst en andra bildsensor.According to a third alternative embodiment, the first image is registered by means of a first image sensor and the second image is registered by means of a second image sensor.

Detta ger snabb och precis uppskattning av ovan- nämnda avstånd i system där ingen eller endast liten bristande färgkorrigering finns.This provides a quick and accurate estimate of the above-mentioned distances in systems where there is no or only a small lack of color correction.

Enligt en andra aspekt av uppfinningen avser denna ett arrangemang i ett optiskt system för uppskattning av avståndet mellan ett objekt och ett fokusplan tillhörande en första bild som avbildar objektet. Arrangemanget ut- nyttjar en andra bild, som har ett fokusplan beläget på ett känt avstånd från den första bildens fokusplan och har medel för att modifiera den första bildens skärpa med en grad så att den första och den andra bilden är väsent- ligen lika skarpa, och medel för att uppskatta avståndet mellan objektet och den första bildens fokusplan på basis av denna grad av modifiering och nämnda kända avstånd.According to a second aspect of the invention, this relates to an arrangement in an optical system for estimating the distance between an object and a focus plane belonging to a first image depicting the object. The arrangement utilizes a second image, which has a focus plane located at a known distance from the focus plane of the first image and has means for modifying the sharpness of the first image by a degree so that the first and second images are substantially equally sharp. and means for estimating the distance between the object and the focus plane of the first image on the basis of this degree of modification and said known distance.

Detta arrangemang innebär motsvarande fördelar som ovan visade förfarande och kan i likhet med detta modi- fieras på ett flertal motsvarande sätt. Allmänt innefat- tar arrangemanget då medel för utförande av de i för- farandena visade stegen.This arrangement entails corresponding advantages as the method shown above and can similarly be modified in a number of corresponding ways. In general, the arrangement then comprises means for carrying out the steps shown in the procedures.

Enligt en tredje aspekt av uppfinningen avser denna ett digitalt minnesmedium innefattande ett datorprogram för uppskattning i ett optiskt system av avståndet mellan ett objekt och ett fokusplan tillhörande en första bild som avbildar objektet. bild, från den första bildens fokusplan, Datorprogrammet utnyttjar en andra som har ett fokusplan beläget på ett känt avstånd och innefattar in- struktioner för att modifiera den första bildens skärpa 10 15 20 25 30 35 519 QD $> FJ 8 med en grad så att den första och den andra bilden är vä- sentligen lika skarpa och instruktioner för att uppskatta avståndet mellan objektet och den första bildens fokus- plan på basis nämnda grad av modifiering och nämnda kända avstånd.According to a third aspect of the invention, it relates to a digital memory medium comprising a computer program for estimating in an optical system the distance between an object and a focus plane belonging to a first image which images the object. image, from the focus plane of the first image, The computer program utilizes a second having a focus plane located at a known distance and includes instructions for modifying the sharpness of the first image 10 15 20 25 30 35 519 QD $> FJ 8 by a degree such that the first and second images are substantially equally sharp and instructions for estimating the distance between the object and the focus plane of the first image on the basis of said degree of modification and said known distances.

Detta datorprogram innebär motsvarande fördelar som ovan visade förfarande och kan modifieras på ett flertal motsvarande sätt i likhet med detta. Allmänt innefattar datorprogrammet då instruktioner för utförande av de i förfarandena visade stegen.This computer program has similar advantages as the method shown above and can be modified in a number of corresponding ways similarly. In general, the computer program then includes instructions for performing the steps shown in the procedures.

Enligt en fjärde aspekt avser uppfinningen ett mikroskopsystem med ett mikroskop och ett datorsystem, vilket innefattar ett arrangemang enligt ovan. Ett sådant system innebär motsvarande fördelar.According to a fourth aspect, the invention relates to a microscope system with a microscope and a computer system, which comprises an arrangement as above. Such a system entails corresponding advantages.

Uppfinningen kommer nu att beskrivas mer i detalj med hänvisning till de bifogade figurerna.The invention will now be described in more detail with reference to the accompanying figures.

Kort figurbeskrivning Fig l visar schematiskt ett optiskt system.Brief description of the figures Fig. 1 schematically shows an optical system.

Fig 2 visar ett antal bilder av ett objekt innefat- tande icke-infargade röda blodkroppar, vilka avbildats med faskontrastmikroskopi.Fig. 2 shows a number of images of an object comprising non-stained red blood cells, which are imaged by phase contrast microscopy.

Fig 3 visar ett antal bilder av ett objekt innefat- tande MGG-infärgade röda blodkroppar, vilka avbildats med ljusfältsmikroskopi.Fig. 3 shows a number of images of an object comprising MGG-stained red blood cells, which are imaged by light field microscopy.

Fig 4 visar ett system, i vilket ett förfarande enligt föreliggande uppfinning tillämpas.Fig. 4 shows a system in which a method according to the present invention is applied.

Fig 5a visar resultatet av ett experiment baserat på bilderna i fig 2.Fig. 5a shows the result of an experiment based on the images in Fig. 2.

Fig 5b visar resultatet av ett experiment baserat pà bilderna i fig 3.Fig. 5b shows the result of an experiment based on the images in Fig. 3.

Fig 6 visar ett flödesschema för ett förfarande en- ligt uppfinningen.Fig. 6 shows a flow chart for a method according to the invention.

Beskrivning av föredragna utföringsformer Fig 1 visar schematiskt ett optiskt system. Ett ob- jektiv l avbildar då en bild av ett objekt 6, som är lO 15 20 25 30 35 519 942 9 beläget i ett objektplan 5, på ett sensorbildplan 2, tillhörande en tvådimensionell sensor. Systemet är för åskådlighets skull visad med endast en lins. I ett verk- ligt mikroskopsystem förekommer åtskilliga linser. Op- tiken, dvs i detta fall systemet av objektiv och sensor har två visade associerade fokusplan. Ett första fokusplan 3 är beläget på avståndet (fokusavvikelsen) 21 ovanför objektplanet och är det plan i vilket ovannämnda optik är fokuserad för blått ljus. Ett andra fokusplan är beläget på avståndet (fokusavvikelsen) z2 nedanför ob- jektets plan och är det plan i vilket optiken är foku- serad för grönt ljus. De första och andra fokusplanen är väsentligen parallella och belägna på det kända avståndet zu från varandra. Optiken kan även antas ha ett tredje åtskilt fokusplan för rött ljus (icke visat).Description of Preferred Embodiments Fig. 1 schematically shows an optical system. A lens 1 then images 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 shown for the sake of clarity with only one lens. In a real microscope system, there are several lenses. The optics, ie in this case the system of lens and sensor have two shown associated focus planes. A first focus plane 3 is located at the distance (focus deviation) 21 above the object plane and is the plane in which the above-mentioned optics is focused for blue light. A second focus plane is located at the distance (focus deviation) z2 below the plane of the object and is the plane in which the optics are focused for green light. The first and second focus planes are substantially parallel and located at the known distance zu from each other. The optics can also be assumed to have a third separate focus plane for red light (not shown).

Att det första och det andra fokusplanet inte sam- manfaller beror av det faktum att optikens brännvidd är våglängdsberoende. Man säger då att optiken har ofull- ständig longitudinell färgkorrektion. Detta betraktas vanligen som ett problem. I samband med föreliggande upp- finning kan emellertid denna ofullständighet utnyttjas för att underlätta fokusering av systemet.The fact that the first and second focus planes do not coincide is due to the fact that the focal length of the optics is wavelength dependent. It is then said that the optics have incomplete longitudinal color correction. This is usually considered a problem. In connection with the present invention, however, this incompleteness can be used to facilitate focusing of the system.

Fig 2 visar ett antal bilder, tagna med en CCD- bildsensor, av ett objekt innefattande icke-infärgade röda blodkroppar, vilka avbildats med faskontrastmikro- skopi. Objektet befinner sig vid fem olika lägen i för- hållande till mikroskopets optik. Avståndet mellan två näraliggande lägen är ca 0,5 um. För de olika lägena visas bilder 30- 34 med grön färgkomponent i vänstra kolumnen och motsvarande bilder 35- 39 med blå färg- komponent i högra kolumnen. Bilderna 30- 39 är återgivna i gråskala. Såsom framgår av bilden uppstår de skarpaste gröna och blå bilderna vid inbördes olika avstånd från objektivet.Fig. 2 shows a number of images, taken with a CCD image sensor, of an object comprising non-stained red blood cells, which are imaged with phase contrast microscopy. The object is in five different positions in relation to the microscope's optics. The distance between two adjacent positions is about 0.5 μm. For the different modes, pictures 30- 34 with a green color component are shown in the left column and the corresponding pictures 35-39 with a blue color component in the right column. Images 30- 39 are shown in grayscale. As can be seen from the image, the sharpest green and blue images appear at different distances from the lens.

Fig 3 visar ett antal bilder av ett objekt inne- fattande MGG-(May-Grünwald-Giemsa)-infärgade röda blodkroppar, vilka avbildats med ljusfältsmikroskopi. 10 15 20 25 30 35 519 942 10 Objektet befinner sig vid fem olika lägen i förhållande till mikroskopets optik. Avståndet mellan två näralig- gande lägen är ca 0,8 um. bilder 40- och motsvarande bilder 45- 49 med blå färgkomponent i För de olika lägena visas 44 med grön färgkomponent i vänstra kolumnen högra kolumnen. Såsom framgår av bilden uppstår de skarpaste gröna och blå bilderna vid olika avstånd från objektivet.Fig. 3 shows a number of images of an object comprising MGG- (May-Grünwald-Giemsa) -coloured red blood cells, which were imaged by light field microscopy. 10 15 20 25 30 35 519 942 10 The object is in five different positions in relation to the optics of the microscope. The distance between two adjacent positions is about 0.8 μm. pictures 40- and corresponding pictures 45- 49 with blue color component in For the different modes, 44 with green color component are shown in the left column and the right column. As can be seen from the image, the sharpest green and blue images appear at different distances from the lens.

Fig 4 visar ett mikroskopsystem innefattande ett mikroskop, ett datorsystem och ett arrangemang enligt en föredragen form av föreliggande uppfinning. Arrangemanget utför ett förfarande enligt en föredragen utföringsform av föreliggande uppfinning. En ljuskälla 100 belyser då ett prov 102, utgöras av ett medicinskt prov i form av ett infärgat som skall avbildas. Provet kan exempelvis blodutstryk på ett provglas. Ett intressant objekt kan då utgöras av en vit blodkropp i detta prov. En del av det ljus som transmitteras genom provet 102 fångas upp av ett objektiv, som avbildar det på en bildsensor 106.Fig. 4 shows a microscope system comprising a microscope, a computer system and an arrangement according to a preferred form of the present invention. The arrangement performs a method according to a preferred embodiment of the present invention. A light source 100 then illuminates a sample 102, consisting of a medical sample in the form of a stain to be imaged. The sample can, for example, smear blood on a test tube. An interesting object can then consist of a white blood cell in this sample. A portion of the light transmitted through the sample 102 is captured by a lens, which images it on an image sensor 106.

Bildsensorn 106 kan vara en enchips- eller en trechips färgsensor, men innefattar normalt en matris med små ljuskänsliga element, vilka var och en genererar en pixel i en registrerad bild. Sensorn kan även innefatta pixel- element försedda med filter så att de registrerar ljus med viss färg. Bildsensorn 106 är ansluten till ett bild- minne 108, som kan lagra av bildsensorn 106 mottagna bilder.The image sensor 106 may be a single-chip or a three-chip color sensor, but normally includes a matrix of small photosensitive elements, each of which generates a pixel in a recorded image. The sensor may also include pixel elements provided with filters so that they detect light of a certain color. The image sensor 106 is connected to an image memory 108, which can store images received by the image sensor 106.

Ljuskällan 100 kan sägas avge en röd, en grön och en blå färgkomponent (dvs ljus med olika våglängder), betecknade ro, go och bo. Dessa kan avges samtidigt som vitt ljus, men det är även möjligt att anordna en eller flera ljuskällor som avger ljus med två eller tre av de grönt och blått, sig i en viss sekvens. Detta kan möjliggöra utnyttjandet primära färgerna rött, var och en för av en enklare bildsensor.The light source 100 can be said to emit a red, a green and a blue color component (ie light with different wavelengths), denoted ro, go and bo. These can be emitted at the same time as white light, but it is also possible to arrange one or more light sources which emit light with two or three of the green and blue ones in a certain sequence. This can enable the use of the primary colors red, each of which is powered by a simpler image sensor.

Det ljus som transmitteras genom objektet kan på samma sätt sägas utgöras av tre grundbilder, en röd, en 10 15 20 25 30 519 942 11 grön och en blå. Objektivet 104 projicerar dessa bilder på bildsensorn 106, vilket Dessa betecknas rl, gl och bl. resulterar i tre registrerade bilder betecknade r, g och b. Dessa bilder kan även utnyttjas i enheter för bildbehandling 110 och bildanalys 112. Bilderna r, g och b kommer att vara transformationer av rl, gl och bl, eftersom objektivet inte är idealt. Eftersom objektivet inte heller kan antas behandla inkommande ljus helt oberoende av våglängd, kommer dessa transformationer dessutom att skilja sig åt för de olika färgerna.The light transmitted through the object can similarly be said to consist of three basic images, a red, a green and a blue. The lens 104 projects these images onto the image sensor 106, which These are denoted rl, gl and bl. results in three registered images denoted r, g and b. These images can also be used in image processing units 110 and image analysis 112. The images r, g and b will be transformations of rl, gl and bl, since the lens is not ideal. In addition, since the lens cannot be assumed to process incoming light completely independent of wavelength, these transformations will differ for the different colors.

Hädanefter behandlas endast funktionaliteten för färgerna grönt och blått i detalj, principen för rött är emeller- tid densamma.From now on, only the functionality of the colors green and blue will be treated in detail, but the principle of red is the same.

Förhållandet mellan bilderna vid det genomlysta ob- jektet och vid bildsensorn kan uttryckas: b=@*m@flÅ» g:g| *hÅÛ-z 22)) Tecknet “*” betecknar då en tvådimensionell faltning.The relationship between the images at the illuminated object and at the image sensor can be expressed: b = @ * m @ fl Å »g: g | * hÅÛ-z 22)) The sign “*” then denotes a two-dimensional fold.

Funktionerna hl och hg betecknar impulssvar, vilka har varsin våglängdsparameter ol resp og, samt vilka är starkt beroende av varsin parameter zl resp 22, vilka betecknar avståndet mellan aktuell färgs fokusplan och objektet, såsom är visat i fig 1.The functions h1 and hg denote impulse responses, which each have wavelength parameters ol and og, respectively, and which are strongly dependent on respective parameters z1 and 22, respectively, which denote the distance between the focus plane of the current color and the object, as shown in Fig. 1.

De gröna och blå bilder som upptas av bildsensorn 106 och lagras i bildminnet 108 skickas till en skatt- ningsmodul, för att uppskatta avstånden zl och 22. Det kan antas att avståndet mellan det gröna och det blå fokus- planet zu, jfr fig 1, är känt. Avståndet zu kan vara uppmätt vid tillverkning av systemet, men företrädesvis uppmäts det vid återkommande kalibreringsförfaranden.The green and blue images captured by the image sensor 106 and stored in the image memory 108 are sent to an estimation module, to estimate the distances z1 and 22. It can be assumed that the distance between the green and the blue focus plane zu, cf. Fig. 1, is known. The distance zu may be measured in the manufacture of the system, but preferably it is measured in recurring calibration procedures.

Den blå bilden b, kopplas till en första faltningsmodul 116. Den gröna bilden en andra faltningsmodul 120. som är en matris med pixelvärden, (även den en matris med pixelvärden) kopplas till Faltningsmodulerna är här 10 15 20 25 30 519 94-2 12 allmänt medel för modifiering av en bilds skärpa. I faltningsmodulerna modifieras bilderna på elektronisk väg. I en föredragen utföringsform tillförs oskärpa till bilderna. Detta kallas nedan att bilden blurras (eng. blur= göra suddig). Graden av tillförd oskärpa benämns nedan blurr-parametern, betecknad oy Utsignalen från den första faltningsmodulen 116 kan kallas en blurrad blå bild och betecknas b*(o¿), där: b*(Û'3)=b*h(Û-3) Beteckningen “*” innebär då en tvådimensionell dis- kret faltning, och h är ett gaussiskt impulssvar: -w 1 -e h(x,y,0) = 2 O' _0O På samma sätt genereras en blurrad grön bild g*«n) i den andra skattningsmodulen 120, varvid: g*(0;)=g*h(03) Bilden kan eventuellt bandpassfiltreras före, efter eller integrerat med modifieringen av skärpan. Detta kan göras för att kompensera för högfrekvent brus , lågfrek~ venta ljusvariationer eller färgskillnader. Allmänt används bandpassfiltreringen för att framhäva komponenter som innehåller skärpeinformation. Företrädesvis används då ett modifierat gaussiskt filter vid skärpemodi- fieringen.The blue image b, is connected to a first convolution module 116. The green image is a second convolution module 120. which is a matrix with pixel values, (also a matrix with pixel values) is connected to The convolution modules are here 10 15 20 25 30 519 94-2 12 general means for modifying the sharpness of an image. In the folding modules, the images are modified electronically. In a preferred embodiment, blur is added to the images. This is called below that the image is blurred (blur). The degree of added blur is hereinafter referred to as the blur parameter, denoted oy The output signal from the first convolution module 116 may be called a blurred blue image and denoted b * (o¿), where: b * (Û'3) = b * h (Û-3 ) The designation “*” then means a two-dimensional discrete convolution, and h is a Gaussian impulse response: -w 1 -eh (x, y, 0) = 2 O '_0O In the same way a blurred green image is generated g * «n ) in the second estimation module 120, whereby: g * (0;) = g * h (03) The image can optionally be bandpass filtered before, after or integrated with the modification of the sharpness. This can be done to compensate for high frequency noise, low frequency light variations or color differences. Generally, bandpass filtering is used to highlight components that contain sharpness information. Preferably, a modified Gaussian filter is then used in the sharpening modification.

Den blurrade blå bilden b*(o3) och den ursprungliga gröna bilden g inmatas till en första korrelationsmodul 122, två bilder beräknas. Allmänt uttrycks denna korrelation i vilken den pixelvisa korrelationen mellan dessa mellan två bilder a och b: 10 15 20 25 30 519 9~1l2 varvid m och n uttrycker bildernas storlek i antal pix- lar. De olika bildernas stickprovsmedelvärden betecknas ä och b_.The blurred blue image b * (o3) and the original green image g are input to a first correlation module 122, two images are calculated. In general, this correlation is expressed in which the pixel-wise correlation between these between two images a and b: 10 15 20 25 30 519 9 ~ 122 where m and n express the size of the images in number of pixels. The sample values of the different images are denoted ä and b_.

Negativa korrelationsvärden är emellertid inte troliga i Korrelationen kan anta värden mellan 1 och -1. detta sammanhang. Ovan används pixelvis korrelation, vilket är att föredra, andra korrelationsberäkningar, såsom exempelvis mellan grupper av pixlar är emellertid tänkbara. Den första korrelationsmodulen 122 genererar utparametern p(o3), vilken uttrycker korrelationen mellan g och b*(0fi.However, negative correlation values are not likely in The correlation can assume values between 1 and -1. this context. Above, pixel-based correlation is used, which is preferred, however, other correlation calculations, such as for example between groups of pixels, are conceivable. The first correlation module 122 generates the output parameter p (o3), which expresses the correlation between g and b * (0 fi.

På samma sätt genererar en andra korrelationsmodul 124 en utparameter p"(o3), vilken uttrycker korrelationen mellan b och g*kn).Similarly, a second correlation module 124 generates an output parameter p "(o3), which expresses the correlation between b and g * kn).

Modifieringen av bilderna och korrelation mellan bilderna behöver inte nödvändigtvis utföras på hela bilderna. Förfarandet kan även utföras på del av bild.The modification of the images and correlation between the images do not necessarily have to be performed on the entire images. The procedure can also be performed on part of the image.

I systemet finns en parameterberäknare 126. Denna styr blurrparametern 03 tills ett globalt största värde för p(o3) och p~(o3) erhålles. Med globalt största värde menas det gemensamma maximat för p(o3) och p"(ofi.In the system there is a parameter calculator 126. This controls the blur parameter 03 until a globally largest value for p (o3) and p ~ (o3) is obtained. By globally largest value is meant the common maximum for p (o3) and p "(o fi.

Det värde på o3som genererar ett maximalt korrela- tionsvärde används därefter för uppskattningen av z1 och z2. Vid denna uppskattning görs ett antal antaganden. Det antas att hl och hgär gaussiska och identiska med de 120, undantag för sina respektive våglängds- och fokus- impulssvar som används i faltningsmodulerna 116, med avvikelseparametrar. Vidare antas att de detaljer i objektet som framträder med blått ljus även syns med grönt ljus. Under sådana förutsättningar kan uttrycken för grön, respektive blå färgkomponent förenklas till: b I bl *h(Û_1(Z1 g I bl *h(o'z(zz)) 519 942 14 Tre fall är möjliga: a) Om ö2(z2)>ö1(z1) ges p(03)=l då: g o b* = [a * hbxzz ))]° [b. * h( = [b] *h<«fz>1o[f».*h( Uazaflf: )]:1 »fw då Ü22(Z2)=Û12(Z1)+Û'32 5 b) Om o¿(z1)>o¿(z2) ges på liknande sätt p~(o3)=l då: Û12(Z1):Ü22(Zz)+Ü32 10 c) Om o¿(z1)=o¿(z2) ges på liknande sätt fi>(03)=D~(03)=1 då! o',2(z])=0š(z2), dvs då a3=0 15 För vart och ett av dessa fall skall ett ekvations- system lösas med avseende på 21 och 2; a) {Û'fi(Z2):Ü12(Z1)+Ü32 q+z2=42 20 b) Z1+Zz :212 c) { z1+z2 = 212 10 15 20 25 30 35 519 942 15 Parameterberäknaren 126 utför numeriska beräkningar motsvarande de ovan visade och kan därför med ledning av ol, og, 03 och 212 åstadkomma skattningar av 21 och 22.The value of o3 that generates a maximum correlation value is then used for the estimation of z1 and z2. In making this estimate, a number of assumptions are made. It is assumed that hl and hg are Gaussian and identical to the 120, except for their respective wavelength and focus impulse responses used in the convolution modules 116, with deviation parameters. Furthermore, it is assumed that the details in the object that appear with blue light are also visible with green light. Under such conditions, the expressions for green and blue color component can be simplified to: b I bl * h (Û_1 (Z1 g I bl * h (o'z (zz)) 519 942 14 Three cases are possible: a) If ö2 (z2 )> ö1 (z1) is given p (03) = l then: gob * = [a * hbxzz))] ° [b. * h (= [b] * h <«fz> 1o [f». * h (Uaza fl f:)]: 1 »fw then Ü22 (Z2) = Û12 (Z1) + Û'32 5 b) Om o¿ ( z1)> o¿ (z2) is given in a similar way p ~ (o3) = l then: Û12 (Z1): Ü22 (Zz) + Ü32 10 c) If o¿ (z1) = o¿ (z2) is given in a similar way set fi> (03) = D ~ (03) = 1 then! o ', 2 (z]) = 0š (z2), ie when a3 = 0 15 For each of these cases a system of equations must be solved with respect to 21 and 2; a) {Û 'fi (Z2): Ü12 (Z1) + Ü32 q + z2 = 42 20 b) Z1 + Zz: 212 c) {z1 + z2 = 212 10 15 20 25 30 35 519 942 15 The parameter calculator 126 performs numeric calculations corresponding to those shown above and can therefore, on the basis of ol, og, 03 and 212, make estimates of 21 and 22.

Dessa skattningar kan sedan utnyttjas av det optiska sys- temet. I det visade exemplet är skattningarna indata till en fokusregulator 128, som reglerar en fokusmekanism 129 till önskat läge.These estimates can then be used by the optical system. In the example shown, the estimates are input to a focus controller 128, which controls a focus mechanism 129 to the desired position.

Parameterberäknaren 126 liksom faltnings- 116, 120 och korrelationsmodulerna 122, 124 kan utföras som ASIC- kretsar (Application Specific Integrated Circuit) eller FGPA-kretsar (Field Programmable Gate Array). Alternativt kan hela eller delar av beräkningsförfarandet som ingår i uppfinningen implementeras mjukvarumässigt som ett dator- program. Datorprogrammet innefattar då instruktioner vilka är ämnade att utföras i en digital signalprocessor (DSP), meterberäknaren åtminstone ett medel för att identifiera PC-processor eller liknande. Allmänt utgör para- det 63 som ger störst korrelation och medel för att beräkna skattningar för värdena på 21 och z2.The parameter calculator 126 as well as the convolution 116, 120 and correlation modules 122, 124 can be implemented as ASIC (Application Specific Integrated Circuit) or FGPA (Field Programmable Gate Array) circuits. Alternatively, all or part of the calculation method included in the invention may be implemented in terms of software as a computer program. The computer program then comprises instructions which are intended to be executed in a digital signal processor (DSP), the meter calculator at least one means for identifying a PC processor or the like. In general, the parade is 63, which provides the greatest correlation and means for calculating estimates for the values of 21 and z2.

Enkelt uttryckt kan det sägas att systemet utnyttjar att den bild vars fokusplan ligger närmast det avbildade delobjektet kommer att se skarpast ut. Hur mycket den skarpare bilden genom signalbehandling behöver göras suddigare (eller den suddigare bilden göras skarpare) för att de två bilderna skall ha lika stor skärpa är ett mått på hur mycket närmare delobjektet ligger i förhållande till den skarpare bildens fokusplan. Om den första och den andra bilden är lika skarpa/oskarpa kan det antas att delobjektet ligger mitt emellan de båda bildernas fokus- plan. Om det inbördes avståndet mellan fokusplanen är känt kan avståndet mellan vart och ett av dessa och del- objektet uppskattas.Simply put, it can be said that the system uses that the image whose focus plane is closest to the depicted sub-object will look sharpest. How much the sharper image needs to be blurred by signal processing (or the blurred image sharpened) for the two images to have equal sharpness is a measure of how much closer the sub-object is in relation to the sharper image's focus plane. If the first and second images are equally sharp / blurry, it can be assumed that the sub-object lies in the middle of the focus plane of the two images. If the mutual distance between the focus plan is known, the distance between each of these and the sub-object can be estimated.

Det är möjligt att använda endast en faltningsmodul 116 och en korrelationsmodul 122. Man kan då tala om ett asymmetriskt system, eftersom skärpan modifieras i endast en av bilderna i motsats till i det i fig 4 visade sys- temet. En förutsättning för att detta skall fungera till- 10 15 20 25 30 35 16 fredsställande är att skärpan inte bara kan minskas i faltningsmodulen, utan även ökas. Vid ökning av skärpan utnyttjas ett approximativt inverst gaussiskt filter. Ett sådant filter förstärker kontrasterna i figuren, men kan även antas förstärka och tillföra brus till bilden, ef- tersom kontraster som kanske inte alls existerar i en fo- kuserad bild kan åstadkommas.It is possible to use only a folding module 116 and a correlation module 122. One can then speak of an asymmetric system, since the sharpness is modified in only one of the images in contrast to the system shown in Fig. 4. A prerequisite for this to work satisfactorily is that the sharpness can not only be reduced in the folding module, but also increased. When increasing the sharpness, an approximately inverse Gaussian filter is used. Such a filter enhances the contrasts in the figure, but can also be assumed to amplify and add noise to the image, since contrasts that may not exist at all in a focused image can be achieved.

Storleken på det mätområde inom vilket en relevant fokusavvikelseskattning kan göras bestäms av avståndet zu mellan fokusplanen. Så länge det intressanta objektet be- finner sig mellan dessa plan ger förfarandet en direkt användbar uppskattning. En stor bristande longitudinell färgkorrektion i ett optiskt system, vilket i de flesta fall anses negativt, resulterar enligt uppfinningen i ett stort mätområde, vilket får anses positivt. Åtminstone tre möjligheter finns för att åstadkomma bilder med olika färginnehåll. Antingen kan en bildsensor med färgfilterförsedda pixelelement användas. En sådan en blå och en röd bild. Alternativt används olika bildsensorer för de olika färgerna. Ett yt- sensor avger en grön, terligare alternativ är att exempelvis först belysa ob- jektet med grönt ljus varvid en första bild registreras, varefter objektet belyses med blått ljus och en andra bild registreras.The size of the measurement area within which a relevant focus deviation estimate can be made is determined by the distance zu between the focus plan. As long as the object of interest is between these planes, the procedure provides a directly useful estimate. A large lack of longitudinal color correction in an optical system, which in most cases is considered negative, results according to the invention in a large measuring range, which may be considered positive. There are at least three possibilities for creating images with different color content. Either an image sensor with color-filtered pixel elements can be used. Such a blue and a red image. Alternatively, different image sensors are used for the different colors. A surface sensor emits a green, a further alternative is to, for example, first illuminate the object with a green light, whereby a first image is registered, after which the object is illuminated with a blue light and a second image is registered.

Alternativa sätt finns emellertid även för att åstadkomma bilder med skilda fokusplan utan att utnyttja bristande longitudinell färgkorrektion. Denna möjlighet kan utnyttjas om man vill ha ett större mätområde. En möjlighet är då att registrera en första bild före och en andra bild efter en till belopp och tecken känd justering av systemets optik, exempelvis en omfokusering. Alter- nativt kan bilderna registreras före och efter en till belopp och tecken känd förflyttning av objektet längs sy- stemets optiska axel. En ytterligare möjlighet är att ut- nyttja flera sensorer med skilda optiska avstånd till det avbildade objektet. 10 15 20 25 30 35 519 94-2 17 Fig 5a visar resultatet av ett experiment baserat på bilderna i fig 2. För varje par av bilder, vid ett givet avstånd mellan objektet och objektivet, ges en tvådelad korrelationskurva, som en funktion av blurrningspara- metern 03. Varje korrelationskurva består till sin vänstra och högra del av p, (exempelvis 123), som funk- tion av o3(dvs olika skärpemodifieringar i den första bilden), o3(dvs olika skärpemodifieringar av den andra bilden). De respektive p~, (exempelvis 125), som funktion av resulterande fem korrelationskurvorna har sina maxima för fem olika värden på o3, vilket motsvarar att objektet be- funnit sig på fem olika lägen i förhållande till objek- tivet. Kurvan 130 hänger ihop med bildparet 30, 35 2), kurvan 131 med 31,36 (fig 2) maxima når upp till korrelationen 1 såsom i antagandet (fig osv. Inget av de fem ovan. Anledningen är att då verkliga bildpar analyseras är det ofta flera av förutsättningarna i beskrivningen ovan i samband med fig 4 som ej är uppfyllda.However, alternative methods also exist for producing images with different focus planes without utilizing lack of longitudinal color correction. This possibility can be used if you want a larger measuring range. One possibility is then to register a first image before and a second image after an adjustment of the system optics known in terms of amount and character, for example a refocusing. Alternatively, the images can be registered before and after a movement of the object known along the optical axis of the system known in terms of amount and character. An additional possibility is to use several sensors with different optical distances to the imaged 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 lens, a two-part correlation curve is given, as a function of blur pair. - meter 03. Each correlation curve consists in its left and right part of p, (for example 123), as a function of o3 (ie different sharp modifications in the first image), o3 (ie different sharp modifications of the second image). The respective p ~, (for example 125), as a function of the resulting five correlation curves have their maxima for five different values of o3, which corresponds to the object being in five different positions in relation to the objective. The curve 130 is related to the image pair 30, 35 2), the curve 131 with 31,36 (fig. 2) maxima reaches the correlation 1 as in the assumption (fig. Etc. None of the five above. The reason is that when real image pairs are analyzed it is often several of the conditions in the description above in connection with Fig. 4 which are not fulfilled.

För det första är objektet ej alltid tunt i för- hållande till objektivets skärpedjup. Den resulterande korrelationskurvan blir då en sammanvägning av ett antal korrelationskurvor - en för varje tunt ”lager” i objek- tet. toppen, Då kan läget för den resulterande korrelations- och därmed motsvarande skattningar av fokus- avvikelserna, komma att störas mer eller mindre.First, the object is not always thin in relation to the depth of field of the lens. The resulting correlation curve then becomes a weighting of a number of correlation curves - one for each thin “layer” in the object. the top, Then the position of the resulting correlation and thus corresponding estimates of the focus deviations may be disturbed more or less.

För det andra är det sällan så att både objektet och fokusplanen är helt plana. Resultatet blir då, eftersom (och varierar över bilden. effekterna knappast tar ut varandra, att zl och 22 därmed GL G2 och det optimala og Även zu kan variera över bilden.Secondly, it is seldom the case that both the object and the focus plane are completely flat. The result is then, because (and varies across the image. The effects hardly cancel each other out, that zl and 22 thus GL G2 and the optimal og Even zu can vary across the image.

För det tredje är ett impulssvar för ett mikroskop- objektiv sammansatt av en diffraktionsbegränsad del och en defokuseringsberoende del. Den förstnämnda delen är endast approximativt gaussisk.Third, an impulse response for a microscope objective is composed of a diffraction-limited part and a defocus-dependent part. The former is only approximately Gaussian.

För det fjärde beter sig sällan objektets samtliga detaljer lika för exempelvis grönt och blått ljus. 10 15 20 25 30 35 519 942 18 Trots att de antaganden som gjordes i samband med beskrivningen av fig 4 endast är approximativt korrekta ger modellen mycket bra skattningar av systemets fokus- avvikelser. Det går även att om nödvändigt justera meto- den för att kompensera för en del av dessa avvikelser från antagandena. Om exempelvis en infärgad vit blodcell avbildas ger denna betydligt större amplituder i grönt än i blått. Det är möjligt att kompensera för detta genom att vid korrelationsberäkningen utesluta de pixlar där den gröna komponenten avviker med mer än ett visst belopp från sitt medelvärde.Fourth, all the details of the object seldom behave the same for, for example, green and blue light. 10 15 20 25 30 35 519 942 18 Although the assumptions made in connection with the description of Fig. 4 are only approximately correct, the model gives very good estimates of the system's focus deviations. It is also possible, if necessary, to adjust the method to compensate for some of these deviations from the assumptions. If, for example, a colored white blood cell is imaged, this gives significantly larger amplitudes in green than in blue. It is possible to compensate for this by excluding in the correlation calculation the pixels where the green component deviates by more than a certain amount from its mean value.

Systemet påverkas däremot inte i någon större ut- sträckning av den rörelseoskärpa som kommer av att prov- glaset befinner sig i rörelse vid avsökande mikroskope- ring. Detta beror av att de olika färgernas bilder på- verkas väsentligen lika av rörelsen (jämför strålgången r, g, b i fig 4).On the other hand, the system is not affected to any great extent by the motion blur that results from the test tube being in motion during scanning microscopy. This is because the images of the different colors are affected substantially equally by the movement (compare the beam path r, g, b in Fig. 4).

Fig 5b visar resultatet av ett experiment baserat på bilderna i fig 3. Kurvan 140 hänger ihop med bildparet 40,45 (fig 3), kurvan 141 med 41,46 (fig 3), det tydligt att objektet inte längre går att betrakta som osv. Här är tunt. Körrelationskurvorna uppvisar tydliga dubbla top- par. Ett infärgat prov av röda blodceller innehåller två huvudsakliga ”lager”, som är möjliga att avbilda med ljusfältsmikroskopi, nämligen objektglasets ovansida re- spektive de röda blodcellernas ovansida. Då ett icke in- färgat prov av röda blodceller avbildas med faskontrast- mikroskopi återges framförallt objektets variationer i brytningsindex, vilka främst uppträder i det ”lager” där de röda cellerna varvas med mikroskopolja.Fig. 5b shows the result of an experiment based on the images in Fig. 3. Curve 140 is related to the image pair 40,45 (Fig. 3), curve 141 by 41.46 (Fig. 3), it is clear that the object can no longer be considered as etc. . Here is thin. The driving relationship curves show clear double top pairs. A stained sample of red blood cells contains two main “layers” that can be imaged by light field microscopy, namely the top of the slide and the top of the red blood cells, respectively. When a non-stained sample of red blood cells is imaged with phase contrast microscopy, the object's variations in refractive index are mainly reproduced, which mainly occur in the “layer” where the red cells are alternated with microscope oil.

I ett system enligt uppfinningen kan därför två av- stånd genereras som båda är korrekta. Detta är en av- görande skillnad i förhållande till de system som utnytt- jar fokusmàtt baserade på varians. I sådana system stör de två ”lagren” varandra så att ett felaktigt fokusmått blir resultatet. I den i fig 3 visade bildserien ger en 10 l5 20 25 30 35 519 942 19 relativ fokusmätprincip baserad på ett variansmått därför ett fel på cirka 0,2 pm vid beräkning av bästa fokusläge.In a system according to the invention, therefore, two distances can be generated which are both correct. This is a crucial difference in relation to the systems that use focus measures based on variance. In such systems, the two "layers" interfere with each other so that an incorrect focus measure results. In the image series shown in Fig. 3, a relative focus measurement principle based on a variance measure therefore gives an error of approximately 0.2 μm when calculating the best focus position.

Enligt föreliggande uppfinning ger ett prov med två skikt däremot en viss fördel, eftersom det väsentligen räcker att ett av de två skikten ligger inom mätområdet, dvs mellan de två bildernas fokusplan, för att en in- tressant avståndsberäkning skall kunna utföras.According to the present invention, on the other hand, a sample with two layers gives a certain advantage, since it is essentially sufficient that one of the two layers lies within the measuring range, ie between the focus plane of the two images, in order to be able to perform an interesting distance calculation.

Som ett alternativ till de i fig 4 visade faltnings- modulerna kan ett system baserat på en fouriertransform utnyttjas. De inkommande gröna och blå bilderna b och g transformeras då med hjälp av en diskret fouriertransform till frekvensplanet, varefter modifiering av skärpegrad och korrelation utförs med de transformerade bilderna.As an alternative to the folding modules shown in Fig. 4, a system based on a Fourier transform can be used. The incoming green and blue images b and g are then transformed by means of a discrete Fourier transform to the frequency plane, after which modification of sharpness and correlation is performed with the transformed images.

Transformen beräknas numeriskt på känt sätt med en FFT- (Fast Fourier Transform)-algoritm. Själva transformen är relativt beräkningskrävande och därmed tidskrävande. Om emellertid många olika modifieringar och korrelations- beräkningar skall utföras för varje par av bilder blir denna metod ändå totalt sett snabbare, eftersom skärpe- modifiering och korrelation går betydligt snabbare att utföra i frekvensplanet. Således är FFT-algoritmen lämp- lig att utnyttja om många värden på og skall prövas.The transform is calculated numerically in a known manner using a FFT (Fast Fourier Transform) algorithm. The transform itself is relatively computationally demanding and thus time-consuming. However, if many different modifications and correlation calculations are to be performed for each pair of images, this method will still be faster overall, since sharp modification and correlation can be performed much faster in the frequency plane. Thus, the FFT algorithm is suitable to use if many values of og are to be tested.

Allmänt går transformeringen, skärpemodifieringen och korrelationsberäkningarna till såsom följer då FFT- algoritmen utnyttjas.In general, the transformation, sharpening modification and correlation calculations proceed as follows when the FFT algorithm is used.

De i de gröna och blå bilderna överlappande områden som transformeras bör vara kvadratiska med en sida, som har en storlek i antal pixlar, vilken kan uttryckas i en 2-potens, exempelvis 256*256 pixlar. Det som skall trans- formeras är alltså en matris med pixelintensitetsvärden.The areas in the green and blue images that are transformed should be square with a page, which has a size in number of pixels, which can be expressed in a 2-power, for example 256 * 256 pixels. What is to be transformed is thus a matrix with pixel intensity values.

Fouriertransformen kräver för att fungera tillfreds- ställande att en periodisk fortsättning finns i en bild.In order to function satisfactorily, the Fourier transform requires that a periodic continuation be present in an image.

Av denna anledning speglas bilderna i två dimensioner, så att större bilder åstadkommes. Exempelvis speglas en matris: 10 15 20 25 519 942 20 till en större matris: 1 2 2 1 3 4 4 3 3 4 4 3 1 2 2 1 Detta medför att den efterföljande FFT-algoritmen ger mer användbara resultat. Resultatet av den diskreta fourier- transformen blir för den blå bilden det tvådimensionella frekvensspektrat B(u,v) och för den gröna bilden det motsvarande spektrat G(u,v).For this reason, the images are mirrored in two dimensions, so that larger images are created. For example, a matrix: 10 15 20 25 519 942 20 is mirrored to a larger matrix: 1 2 2 1 3 4 4 3 3 4 4 3 1 2 2 1 This means that the subsequent FFT algorithm gives more useful results. The result of the discrete Fourier transform is for the blue image the two-dimensional frequency spectrum B (u, v) and for the green image the corresponding spectrum G (u, v).

Spektrat för den blå och den gröna bilden normeras därefter så att B(0,0)=G(0,0)=0. Detta motsvarar att medelvärdet av pixelintensiteten i respektive bild sätts till noll då korrelationen utförs.The spectra of the blue and green images are then normalized so that B (0,0) = G (0,0) = 0. This corresponds to the average value of the pixel intensity in each image being set to zero when the correlation is performed.

Modifiering av skärpan i exempelvis den blå bilden kan därefter beräknas som BTk(u,v)=B(u,v)*Tk(u,v), där Tk(u,v) är fouriertransformen av det kzte gaussiska filtret. Istället för att göra en beräkningsmässigt krävande faltning görs således istället en multi- plikation.Modification of the sharpness in, for example, the blue image can then be calculated as BTk (u, v) = B (u, v) * Tk (u, v), where Tk (u, v) is the Fourier transform of the kzte Gaussian filter. Instead of making a computationally demanding fold, a multiplication is thus made instead.

Korrelationen mellan den skärpemodifierade blå bilden och den gröna bilden kan beräknas som : 2 flßçu, mk (m) - GW, n] Jzzlßnlnqïknhnf -Zzkïnrnjz På motsvarande sätt beräknas korrelationen mellan en PUf) = skärpemodifierad grön bild och en blå bild: 2 Z|G(u,v)Tk(u,v) - B(u,v)1 JZZ|G(u,v)Tk(u,v)|2 -22|B(u,v)|2 fiflf) = lO 15 20 25 30 35 519 9fè2 21 Resultatet av dessa beräkningar blir approximativt detsamma som vid de ovan visade beräkningarna i falt- ningsmodulerna. Det värde på parametern k som resulterar i maximal korrelation utnyttjas då för beräkning av det sökta avståndet.The correlation between the sharp-modified blue image and the green image can be calculated as: 2 fl ßçu, mk (m) - GW, n] Jzzlßnlnqïknhnf -Zzkïnrnjz Similarly, the correlation between a PUf) = sharp-modified green image and a blue image is calculated: 2 Z | G (u, v) Tk (u, v) - B (u, v) 1 JZZ | G (u, v) Tk (u, v) | 2 -22 | B (u, v) | 2 fifl f) = 10 15 20 25 30 35 519 9fè2 21 The result of these calculations will be approximately the same as in the calculations shown above in the convolution modules. The value of the parameter k that results in maximum correlation is then used to calculate the distance sought.

För bilder med enbart eller nästan enbart blodceller i finns en möjlighet att göra den ovan nämnda fourier- Skälet till detta är att blod- cellerna i en bild ser ut som små cirklar, det finns inga transformen snabbare. eller nästan inga långsträckta föremål i någon speciell riktning i bilden. Tack vare detta kan man göra ett anta- gande att fouriertransformen av bilden är rotations- symmetrisk runt nollpunkten (exempelvis B(0,0)). Därför behöver endast endimensionella fouriertransformer beräk- och G(u,O). morna blir då istället enkelsummor, vilket förenklar be- nas, såsom B(u,O) De ovan visade dubbelsum- räkningen. En ännu större vinst med detta förfarande är att inga tvådimensionella, stora mellanresultat behöver mellanlagras under beräkningen, vilket väsentligen för- enklar den hårdvara som behöver användas. Detta möjliggör användandet av en relativt långsam och billig DSP, och är därför en föredragen utföringsform.For images with only or almost only blood cells in, there is an opportunity to make the above-mentioned Fourier- The reason for this is that the blood cells in an image look like small circles, there is no transformer faster. or almost no elongated objects in any particular direction in the image. Thanks to this, one can make an assumption that the Fourier transform of the image is rotationally symmetrical around the zero point (eg B (0,0)). Therefore, only one-dimensional Fourier transforms need calculation and G (u, O). morna then instead become single sums, which simplifies bones, such as B (u, O) The double sum calculation shown above. An even greater benefit of this procedure is that no two-dimensional, large intermediate results need to be stored during the calculation, which significantly simplifies the hardware that needs to be used. This enables the use of a relatively slow and inexpensive DSP, and is therefore a preferred embodiment.

Det är inte heller säkert nödvändigt att utnyttja alla pixlar i en rad vid beräkningarna. För vissa typer av bilder kan nedsampling göras, dvs enbart var nzte pixel längs en rad utnyttjas vid beräkningarna. Detta kan ge tillförlitliga resultat trots att beräkningarna kan göras snabbare.It is also certainly not necessary to use all the pixels in a row in the calculations. For certain types of images, downsampling can be done, ie only every nth pixel along a row is used in the calculations. This can give reliable results even though the calculations can be done faster.

Fig 6 visar ett flödesschema för ett förfarande enligt uppfinningen. I ett första steg genereras då en första uppsättning sekundära bilder utifrån en första bild.Fig. 6 shows a flow chart for a method according to the invention. In a first step, a first set of secondary images is then generated from a first image.

I ett andra steg genereras en andra uppsättning sekundära bilder utifrån en andra bild.In a second step, a second set of secondary images is generated from a second image.

I ett tredje steg beräknas korrelationer mellan å ena sidan den första bilden och å andra sidan åtminstone en delmängd av den andra uppsättningen sekundära bilder. 10 15 20 519 942 22 I ett fjärde steg beräknas korrelationer mellan à ena sidan den andra bilden och å andra sidan åtminstone en delmängd av den första uppsättningen sekundära bilder.In a third step, correlations are calculated between, on the one hand, the first image and, on the other hand, at least a subset of the second set of secondary images. In a fourth step, correlations are calculated between, on the one hand, the second image and, on the other hand, at least a subset of the first set of secondary images.

I ett femte steg identifieras vilken grad av modi- fiering av den första eller den andra bilden som resul- terar i det största korrelationsvärde som framkommit vid de tredje och fjärde stegen.In a fifth step, the degree of modification of the first or the second image that results in the largest correlation value that has emerged at the third and fourth steps is identified.

I ett sjätte steg görs en uppskattning av avståndet mellan den första bilden fokusplan och det avbildade objektet, vid vilken uppskattning den identifierade graden av modifiering är indata.In a sixth step, an estimate is made of the distance between the first image focus plane and the imaged object, at which estimate the identified degree of modification is input.

Den inbördes ordningen mellan flera av de ovan- stående stegen kan omkastas. Hela den första uppsätt- ningen sekundära bilder behöver inte skapas samtidigt.The mutual order between several of the above steps can be reversed. The entire first set of secondary images does not need to be created simultaneously.

Det är att föredra att generera sekundära bilder konti- nuerligt och samtidigt avgöra korrelationer för skapade sekundära bilder. Den i fig 4 visade parameterberäknaren styr då graden av skärpemodifiering tills ett relevant korrelationsmaximum hittats. Uppsättningen sekundära bilder behöver då inte göras större.It is preferable to generate secondary images continuously 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 is found. The set of secondary images then does not need to be made larger.

Uppfinningen begränsas ej av de ovan visade ut- föringsformerna, utan kan modifieras på ett flertal sätt inom ramen för de bifogade patentkraven.The invention is not limited by the embodiments shown above, but can be modified in a number of ways within the scope of the appended claims.

Claims (17)

10 15 20 25 30 35 4.1; n 519 9 Ja. BJ 23 PATENTKRAV10 15 20 25 30 35 4.1; n 519 9 Yes. BJ 23 PATENT CLAIMS 1. l. Förfarande i ett optiskt system för uppskattning (zl) mellan ett objekt (6) och ett tillhörande en första bild som avbildar av fokusavvikelsen fokusplan (3) objektet, k ä n n e t e c k n a t av att en andra bild, vilken bild har ett som avbildar objektet, utnyttjas, fokusplan (4) fràn den (212) första bildens fokusplan, av att den första bildens beläget pà ett känt avstånd skärpa genom signalbehandling modifieras med en grad så att den första och den andra bilden är väsentligen lika skarpa, och att fokusavvikelsen mellan objektet (6) och den första bildens fokusplan uppskattas pä basis av denna grad av modifiering och nämnda kända avstånd (zu).1. 1. A method in an optical system for estimating (zl) between an object (6) and an associated a first image which depicts the focus deviation focus plane (3) of the object, characterized in that a second image, which image has a image, the focus plane (4) is imaged from the (212) first image focus plane, in that the sharpness of the first image located at a known distance is modified by signal processing by a degree so that the first and second images are substantially equally sharp, and that the focus deviation between the object (6) and the focus plane of the first image is estimated on the basis of this degree of modification and said known distance (zu). 2. Förfarande enligt krav l, (151) innefattande stegen: - att generera en första uppsättning sekundära bilder utifrân den första bilden, genom olika grader av modifiering av skärpan i den första bilden; (154) tioner mellan överlappande delar av ä ena sidan àtmin- - att beräkna en första uppsättning korrela- stone en delmängd av nämnda första uppsättning sekundära bilder och à andra sidan den andra bilden; (155) skärpan som resulterar i den största bland nämnda korre- - att identifiera den grad av modifiering av lationer; varefter den identifierade graden utnyttjas vid uppskattningen av fokusavvikelsen mellan objektet och den första bildens fokusplan.A method according to claim 1, (151) comprising the steps of: - generating a first set of secondary images from the first image, by varying degrees of modification of the sharpness of the first image; (154) relations between overlapping parts of one side at least - to calculate a first set of correlations a subset of said first set of secondary images and on the other hand the second image; (155) the sharpness resulting in the largest of said corrections - to identify the degree of modification of lations; after which the identified degree is used in estimating the focus deviation between the object and the focus plane of the first image. 3. Förfarande enligt krav 2, varvid förfarandet vi- dare innefattar stegen: (152) bilder utifràn den andra bilden, genom olika grader av - att generera en andra uppsättning sekundära modifiering av skärpan i den andra bilden; och (153) tioner mellan överlappande delar av à ena sidan ätmin- - att beräkna en andra uppsättning korrela- stone en delmängd av nämnda andra uppsättning sekundära bilder och à andra sidan den första bilden; 10 15 20 25 30 35 519 942 24 - varvid nämnda identifiering (155) sker även med utgångspunkt från nämnda andra uppsättning korrelationer; och (156), även till vilken av nämnda första och andra uppsättningar - varvid, vid nämnda uppskattning hänsyn tas korrelationer som inbegriper det största värdet.The method of claim 2, wherein the method further comprises the steps of: (152) images from the second image, by varying degrees of - generating a second set of secondary modifications to the sharpness of the second image; and (153) interactions between overlapping portions of, on the one hand, the mean - calculating a second set correlating a subset of said second set of secondary images and, on the other hand, the first image; 10 15 20 25 30 35 519 942 24 - wherein said identification (155) also takes place on the basis of said second set of correlations; and (156), also to which of said first and second sets - wherein, in said estimation, correlations involving the largest value are taken into account. 4. Förfarande enligt något av föregående krav, var- vid nämnda modifiering av skärpan innebär åtminstone minskning av skärpan, medelst ett gaussiskt filter.A method according to any one of the preceding claims, wherein said modification of the sharpness means at least reduction of the sharpness, by means of a Gaussian filter. 5. Förfarande enligt något av föregående krav, vid vilket nämnda modifiering av skärpan innebär åtminstone ökning av skärpan, medelst ett approximativt inverst gaussiskt filter.A method according to any one of the preceding claims, in which said modification of the sharpness means at least increasing the sharpness, by means of an approximately inverse Gaussian filter. 6. Förfarande enligt något av föregående krav, vid vilket nämnda modifiering av skärpan utförs medelst en faltning.A method according to any one of the preceding claims, wherein said modification of the sharpness is performed by means of a folding. 7. Förfarande enligt något av krav 2-5, vid vilket nämnda första och andra bild fouriertransformeras, var- efter nämnda modifiering av skärpan och nämnda uppskatt- ning av korrelationer utförs i frekvensdomänen.A method according to any one of claims 2-5, wherein said first and second images are Fourier transformed, after which said modification of the sharpness and said estimation of correlations is performed in the frequency domain. 8. Förfarande enligt något av föregående krav, vid vilket den första bilden genereras medelst ljus inom ett första våglängdsområde och den andra bilden genereras me- delst ljus inom ett från det första våglängdsområdet åt- minstone delvis skilt andra våglängdsområde.A method according to any one of the preceding claims, wherein 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 at least partially separate from the first wavelength range. 9. Förfarande enligt något av krav l-7, vid vilket den första bilden genereras före en till belopp och tec- ken känd justering av systemets optik och den andra bil- den genereras efter nämnda justering.A method according to any one of claims 1-7, wherein the first image is generated before an adjustment of the system optics known to the amount and the techniques and the second image is generated after said adjustment. 10. Förfarande enligt något av krav 1-7, vid vilket den första bilden genereras före en till belopp och tec- ken känd förflyttning av objektet i förhållande till ett fokusplan hos det optiska systemet och den andra bilden genereras efter nämnda förflyttning.A method according to any one of claims 1-7, wherein the first image is generated before a movement of the object known in terms of amount and character in relation to a focus plane of the optical system and the second image is generated after said movement. 11. ll. Förfarande enligt något av krav 1-7, vid vilket den första bilden registreras medelst en första bildsen- 10 15 20 25 30 35 1 . . ~ n , . - . « i .2- ..- 25 sor och den andra bilden registreras medelst en andra bildsensor.11. ll. Method according to one of Claims 1 to 7, in which the first image is registered by means of a first image sensor. . ~ n,. -. In the .2- ..- 25 sensor and the second image is recorded by means of a second image sensor. 12. Arrangemang i ett optiskt system för uppskatt- ning av fokusavvikelsen mellan ett objekt och ett fokus- plan tillhörande en första bild som avbildar objektet, k ä n n e t e c k n a t av att arrangemanget utnyttjar en andra bild, som ätminstone delvis överlappar den första bilden, och som har ett fokusplan beläget pà ett känt avstànd frän den första bildens fokusplan, av medel (116) för att genom signalbehandling modifiera den första bildens skärpa med en grad sä att den första och den andra bilden är väsentligen lika skarpa, och av medel (126) för att uppskatta fokusavvikelsen mellan objektet och den första bildens fokusplan pä basis av denna grad av modifiering och nämnda kända avstånd.Arrangement in an optical system for estimating the focus deviation between an object and a focus plane belonging to a first image depicting the object, characterized in that the arrangement uses a second image, which at least partially overlaps the first image, and which has a focus plane located at a known distance from the focus plane of the first image, by means (116) for modifying the sharpness of the first image by signal processing so that the first and second images are substantially equally sharp, and by means (126) to estimate the focus deviation between the object and the focus plane of the first image on the basis of this degree of modification and said known distances. 13. Arrangemang enligt krav 12, vidare innefattande medel (116) för att generera en första uppsättning sekun- dära bilder utifrån den första bilden, genom olika grader av modifiering av skärpan i den första bilden; medel (122) för att beräkna en första uppsättning korrelationer mellan överlappande delar av ä ena sidan ätminstone en delmängd av nämnda första uppsättning sekundära bilder (126) för att identifiera den grad av modifiering av skärpan som resul- och à andra sidan den andra bilden; medel terar i den största bland nämnda korrelationer, vilken identifierade grad utnyttjas av nämnda medel för att upp- skatta fokusavvikelsen mellan objektet och den första bildens fokusplan.The arrangement of claim 12, further comprising means (116) for generating a first set of secondary images from the first image, by varying degrees of modification of the sharpness of the first image; means (122) for calculating a first set of correlations between overlapping portions of one side at least a subset of said first set of secondary images (126) for identifying the degree of sharpness modification as a result and on the other hand the second image; means in the largest of said correlations, which identified degree is used by said means to estimate the focus deviation between the object and the focus plane of the first image. 14. Arrangemang enligt krav 13, vilket vidare inne- fattar: medel (120) för att generera en andra uppsättning sekundära bilder utifrän den andra bilden, genom olika grader av modifiering av skärpan i den andra bilden; me- del (124) för att beräkna en andra uppsättning korrela- tioner mellan överlappande delar av à ena sidan ätmin- stone en delmängd av nämnda andra uppsättning sekundära bilder och à andra sidan den första bilden; varvid nämnda (126) medel för att identifiera är anordnat att verka med 10 15 20 25 30 35 519 942 . . . . i. . | - « n 26 utgångspunkt även från nämnda andra uppsättning korrela- (126) skattning av fokusavvikelsen är anordnat att ta hänsyn tioner; och varvid vid nämnda medel för upp- även till vilken av nämnda första och andra uppsättningar korrelationer som inbegriper det största värdet.The arrangement of claim 13, further comprising: means (120) for generating a second set of secondary images from the second image, by varying degrees of modification of the sharpness of the second image; means (124) for calculating a second set of correlations between overlapping portions of on the one hand at least a subset of said second set of secondary images and on the other hand the first image; wherein said (126) means for identifying is arranged to operate with 519 942. . . . i. | - «n 26 starting point also from said second set of correlation- (126) estimation of the focus deviation is arranged to take into account; and wherein at said means for up to which of said first and second sets of correlations includes the largest value. 15. Digitalt minnesmedium innefattande ett dator- program för uppskattning i ett optiskt system av fokusavvikelsen mellan ett objekt och ett fokusplan tillhörande en första bild som avbildar objektet, k ä n ' n e t e c k n a t av att datorprogrammet utnyttjar en andra bild, som åtminstone delvis överlappar den första bilden, och som har ett fokusplan beläget på ett känt avstånd från den första bildens fokusplan, av att datorprogrammet innefattar instruktioner för att genom signalbehandling modifiera den första bildens skärpa med en grad så att den första och den andra bilden är väsentligen lika skarpa och instruktioner för att upp- skatta fokusavvikelsen mellan objektet och den första bildens fokusplan på basis nämnda grad av modifiering och nämnda kända avstånd.15. A digital memory medium comprising a computer program for estimating in an optical system the focus deviation between an object and a focus plane belonging to a first image depicting the object, characterized in that the computer program utilizes a second image which at least partially overlaps the first image, and having a focus plane located at a known distance from the focus plane of the first image, in that the computer program includes instructions for modifying the sharpness of the first image by a signal processing so that the first and second images are substantially as sharp and instructions for to estimate the focus deviation between the object and the focus plane of the first image on the basis of said degree of modification and said known distances. 16. Digitalt minnesmedium enligt krav 15 varvid da- torprogrammet vidare innefattar instruktioner för stegen: - att generera en första uppsättning sekundära bilder utifrån den första bilden, genom olika grader av modifiering av skärpan i den första bilden; - att beräkna en första uppsättning korrelationer mellan överlappande delar av à ena sidan åtminstone en delmängd av nämnda första uppsättning sekundära bilder och ä andra sidan den andra bilden; - att identifiera den grad av modifiering av skärpan som resulterar i den största bland nämnda korrelation, varefter denna grad utnyttjas vid uppskattningen av fokusavvikelsen mellan objektet och den första bildens fokusplan.The digital memory medium according to claim 15, wherein the computer program further comprises instructions for the steps: - generating a first set of secondary images from the first image, by varying degrees of modification of the sharpness of the first image; - calculating 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; - to identify the degree of modification of the sharpness which results in the largest among said correlation, after which this degree is used in the estimation of the focus deviation between the object and the focus plane of the first image. 17. Mikroskopsystem med ett mikroskop och ett dator- system, vilket innefattar ett arrangemang enligt något av kraven 12-14.A microscope system with a microscope and a computer system, which comprises an arrangement according to any one of claims 12-14.
SE0004046A 2000-11-07 2000-11-07 Focus deviation estimation method in optical system, involves modifying sharpness of image by processing predetermined degree so that two images are equally sharpened SE519942C2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
SE0004046A SE519942C2 (en) 2000-11-07 2000-11-07 Focus deviation estimation method in optical system, involves modifying sharpness of image by processing predetermined degree so that two images are equally sharpened
AU2002212914A AU2002212914A1 (en) 2000-11-07 2001-11-05 Autofocusing
PCT/SE2001/002418 WO2002039059A1 (en) 2000-11-07 2001-11-05 Autofocusing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
SE0004046A SE519942C2 (en) 2000-11-07 2000-11-07 Focus deviation estimation method in optical system, involves modifying sharpness of image by processing predetermined degree so that two images are equally sharpened

Publications (3)

Publication Number Publication Date
SE0004046D0 SE0004046D0 (en) 2000-11-07
SE0004046L SE0004046L (en) 2002-05-08
SE519942C2 true SE519942C2 (en) 2003-04-29

Family

ID=20281706

Family Applications (1)

Application Number Title Priority Date Filing Date
SE0004046A SE519942C2 (en) 2000-11-07 2000-11-07 Focus deviation estimation method in optical system, involves modifying sharpness of image by processing predetermined degree so that two images are equally sharpened

Country Status (1)

Country Link
SE (1) SE519942C2 (en)

Also Published As

Publication number Publication date
SE0004046L (en) 2002-05-08
SE0004046D0 (en) 2000-11-07

Similar Documents

Publication Publication Date Title
US10944896B2 (en) Single-frame autofocusing using multi-LED illumination
JP7589236B2 (en) Image processing apparatus and method for use in an autofocus system - Patents.com
CN1768346B (en) Systems and methods for minimizing optical path difference effects in imaging systems
US7283253B2 (en) Multi-axis integration system and method
Aguet et al. Model-based 2.5-D deconvolution for extended depth of field in brightfield microscopy
CN107850754A (en) The image-forming assembly focused on automatically with quick sample
US20170031151A1 (en) Scanning Imaging For Encoded PSF Identification and Light Field Imaging
EP3625602A1 (en) Real-time autofocus focusing algorithm
US20230206416A1 (en) Computer-implemented method for quality control of a digital image of a sample
EP3716200B1 (en) Image processing apparatus and method for use in an autofocus system
US20120050517A1 (en) Imaging systems and associated methods thereof
SE519942C2 (en) Focus deviation estimation method in optical system, involves modifying sharpness of image by processing predetermined degree so that two images are equally sharpened
Li et al. Rapid whole slide imaging via learning-based two-shot virtual autofocusing
TW201935074A (en) Method and apparatus for extending depth of field during fluorescence microscopy imaging
EP3563188B1 (en) System and method for measuring the focus state of an optical instrument
US9532032B2 (en) Astigmatic depth from defocus imaging using intermediate images and a merit function map
EP4198892A1 (en) Method for determining boundaries of a z-stack of images of an object, corresponding optical instrument and computer program therefore
Fan et al. Surface profiling measurement using varifocal lens based on focus stacking
Ikoma Computational Fluorescence Microscopy for Three Dimensional Reconstruction
WO2003079664A2 (en) Multi-axis integration system and method
Khan 3-D Shape Recovery from Image Focus Using Rank Transform
SE515676C2 (en) Microscope for biological specimen study, has calculator with two dimensional filter function, which has operating values at zero spatial frequency and at frequency more than maximum spatial frequency of image