METHODS AND DEVICES IN AN OPTICAL SYSTEM

Abstract: In a method in an optical system, a structure having a periphery is reproduced by means of an objective and an electronic representation of the structure is produced. Moreover is it analysed how the intensity in the electronic representation varies at the periphery of the structure. This intensity variation is then used to determine an application focus value which indicates how the current focus position of the objective is related to an optimal focus position for the application at issue. The method can be used, for example, for automatic focusing or for optical checking of objects.

Description: METHODS AND DEVICES IN AN OPTICAL SYSTEM Field of the Invention The present invention relates to a method in an optical system, comprising the steps of reproducing a structure having a periphery by means of an objective and producing an electronic representation of the structure reproduced by the objective. The invention also relates to devices for use in an optical system and a storage media, on which a computer program for use in an optical system is stored. Background Art Microscopes and other optical systems need be focused on the object or the structure which the system reproduces. For a system which scans an object, continuous refocusing operations are necessary since the object is seldom planar. For instance, a height variation by some tenths of a micrometer of the object is sufficient for the object to get into the outer edge of the depth of focus of a high-resolution light-optical microscope objective if no refocusing takes place. A microscope slide has greater height variations than that and, besides, the preparation has variations in respect of thickness as well as position in the vertical direction, and the object holding mechanism does not allow movements of the object which are perfectly perpendicular to the optical axis of the system. Therefore automatic scanning microscopes must be equipped with an automatic focusing system. The purpose of an automatic focusing system can be said to reside in the steps of somehow measuring the current focus, deciding on a focus correction in respect of sign as well as amount, and carrying out the correction which, for example, results in a raising or lowering of the objective relative to the object. A focusing system must satisfy many requirements. The system can be assessed, among other things, according to how good a focus it achieves, how robust it is relative to different kinds of objects, how rapidly it achieves focus, how cost effective it is to manufacture and maintain and what demands it places on the surroundings in the form of, for instance, space and power requirements . The measurement of focus can be carried out actively or passively. An example of active measurement is utilisation of infrared light reflected by the object, like in some automatically focusing still cameras. An example of passive measurement is utilisation of the contents of the images from an image sensor. The image sensor can be the image sensor existing in a microscope or an image sensor which is used only to measure focus. The drawbacks of adding optics and one or more sensors in a parallel measuring system are first an increasing system complexity, expenses and space requirements, second several non-ideal components in the optical beam path, and third the need for calibrating the position of the measuring system for optimal focus relative to the same of the useful, existing sensor. Only passive focus systems will be discussed in the following. On the basis of images from one or more image sensors, the focus system should thus set a focus which in some sense is optimal. Normally, an optimal focus is defined as the focus which is experienced by a specific individual to be optimal for the application at issue. To be able to decide which is the optimal focus, the focus system uses a so-called focus measure. The focus measure is a function used to calculate a series of scalar focus values for different focus positions. It is applied to an entire image or a partial image from a sensor to obtain a focus value for each image/partial image. If the focus measure functions well, it has a maximum (or minimum) at the desired best focus. An exam- pie of a traditional focus measure is the sample variance (below referred to as variance only) of the intensity values in an image. For the traditional focus measures, the peak value depends on the detailed contents of the image and is therefore not known in advance. It is thus not possible to decide on the basis of a single such focus value how great a physical focus correction is required to reach the position for the best focus. Since each value, except the peak value, can arise on both sides of the peak, it is also not possible to decide on the basis of a single such focus value on which side of the peak the image is taken. To maximise the value of a traditional focus measure, some kind of search is therefore necessary. When images from one sensor only are used, the search will take long since the focus measure must be evaluated for a number of different physical positions of the objective. The traditional focus measures do not provide directional information, which further causes the first search step to be a step in the wrong direction in 50% of the cases . A system having a plurality of sensors which are arranged in several image planes can more rapidly find its way with the useful sensor to the maximum of the focus measure. One reason for the time saving is that for each physical position of the objective, images corresponding to a plurality of focus positions will be obtained - one for each image plane. The search can therefore be effected with fewer physical positions of the objective. An example of such a focus system with a plurality of sensors is disclosed in US 5,912,699. In this system, the sign of the focus correction is determined by means of a standardised difference of the focus measures from two additional image sensors which have image planes above and below the useful image sensor. The standardised difference serves as a qualitative measure indicating whether it is necessary to focus further and, if so, in which direction. Summing up, there are at least two problems caused by the prior art technique of automatic focusing, viz. on the one hand the fact that a focus measure does not always yield a peak for optimal focus and, on the other hand, the fact that a plurality of images from different focus positions of the objective are necessary to find the optimal focus. Summary of the Invention One object of the present invention is to eliminate or at least alleviate the above-mentioned problems. This object is achieved wholly or partially by a method according to claim 1, a device according to claim 23, and a storage medium according to claim 35. More specifically, the invention relates according to a first aspect to a method in an optical system, comprising the steps of reproducing a structure having a periphery by means of an objective, producing an elec- tronic representation of the structure reproduced by the objective, analysing how an intensity in the electronic representation varies at the periphery of the structure, and determining, by means of said intensity variation, an application focus value which indicates how the current focus position of the objective is related to an optimal focus position. It has surprisingly been found that in the reproduction of certain structures, intensity variations arise at the periphery of the structure, which contain directly usable information about how the current focus position is placed in relation to the optimal one. These intensity variations constitute the base of a new focus measure, which allows that from, for instance, a single image of a structure, it is possible to determine a focus correction to achieve the optimal focus. This new focus measure is in the following referred to as a predictive focus measure since it provides the possibility of predicting from a single focus value a suitable focus correction. It has also been found that the predictive focus measure functions better than traditional focus measures for certain structures . The predictive focus measure also functions on part of an image, which in turn implies that it is possible to determine a plurality of focus values for one image. This is advantageous since it will then be possible to rapid- ly obtain a value at the beginning of the read out of an image from an image sensor and, thus, to have time to correct an error position, if any, before the next image is exposed. Moreover, it is possible to find out how the focus varies with the position in the image. With tradi- tional focus measures, this cannot be done since it is not possible to compare its focus value for one partial image with its focus value for another partial image. Structure should in this context be interpreted in a very wide sense. It can be a separate, three-dimensional object or part of an object. The structure is characterised in the electronic representation by being a coherent area which at its periphery has an intensity which differs from the one in the area around the structure. The actual structure differs from its surroundings by having a different extent parallel with the longitudinal axis of the objective compared with the surroundings. The periphery of the structure thus indicates a height difference from the surroundings. Alternatively, the structure can have a different refractive index or other optical pro- perties which result in the optical path through the structure parallel with the longitudinal axis of the objective differing from that of the surroundings. In other words, the optimal focus position for the structure differs from that of its surroundings. It should also be mentioned that the electronic representation can be one-dimensional or two-dimensional, and that the analysis of the intensity variation can be carried out in one or more positions along the periphery of the structure. The entire periphery can, but thus need not, be used. However, the analysis need only be carried out at the periphery of the structure, not on other parts of the structure and not on the entire electronic representation. Moreover, objective should be considered to include all optical reproducing systems which can reproduce an object on a sensor with a depth of focus and resolution which are sufficient for the application at issue. The application focus value, which thus is a focus value indicating how the current focus position of the objective is related to an optimal focus position of the application at issue, can, of course, be used to provide a desired refocusing. However, it can also be used to perform other controls. In a scanning microscope, one may want to avoid too frequent refocusing operations. It is then possible to use the application focus value to decide if one is within or outside a predetermined focusing range. In an advantageous embodiment of the method, an application focus value is determined, which indicates whether the current focus position of the objective is above or below the optimal focus position, i.e. whether the focus plane of the objective and the structure are to be closer to or further away from each other in order to obtain the optimal focus. In this case, the focus value thus yields the direction of the focus correction, and therefore, when making a search, there is no risk of going in the wrong direction. Further the application focus value can advantageously be determined in such manner that it indicates how far away the current focus position of the objective is from the optimal focus position. Thus, the focus value gives m this case the magnitude of the focus correction, so that only one correction need be carried out to obtain the optimal focus value. The application focus value is suitably used to provide a control signal for changing the mutual positioning of the objective and the structure with a view to achieving a desired focusing. The desired focusing need not always occur to the optimal focus position or even towards increased depth of focus, but it can also consist of a defocusing of a predetermined magnitude. In an advantageous embodiment, the control signal is generated on the basis of said application focus value only. However, it is possible that, in some applications, one may want to generate the control signal on the basis of a combination of a plurality of focus values calculated by means of the predictive focus measure only, or by means of the predictive focus measure and traditional focus measures. One may also want to switch between different focus measures when calculating the control signal. One focus measure can be used, for instance, for coarse focusing and another for fine focusing. In an advantageous embodiment, the electronic repre- sentation is produced by means of a single light-sensitive sensor and a single exposure. In this case, thus no mutual displacement of the objective and the structure is required for determining a focus correction, and no additional components are necessary either. The light-sensitive sensor can be a black-and-white sensor or a one-chip colour sensor. The light-sensitive sensor may also consist of a plurality of partial sensors which record light from one and the same image plane. The step of analysing how the intensity varies at the periphery of the structure may comprise using predetermined information about the appearance of the intensity variation in different focus positions of the objective in relation to the optimal focus position. As will be evident from the following description, the intensity variation has a characteristic appearance, on the basis of which it is possible to assess how the current focus position is related to the optimal one. This property of the intensity variation makes it possible to use a neural network for determining the focus value. The analysis of how the intensity varies at the periphery of the structure advantageously comprises meas- uring at least one of the following parameters for the intensity variation: the inclination, the height of an overshoot, the width of an overshoot, the width of an undershoot, the presence of a terrace, and the width of a terrace . The intensity variation is advantageously analysed essentially perpendicular to the periphery of the structure. In this manner, it is possible to sum up information from different parts of the periphery. When the structure has a curved periphery, the analysis can advan- tageously comprise the step of forming radial mean values of the intensity. The method according to the invention is advantageously used for structures in which the variance of the intensity in the electronic representation of the struc- ture is asymmetric for different focus positions around the focus position which yields optimal focusing of the objective on the structure. For such structures, the predictive focus measure has in fact been found to function better than the traditional variance measure. As is evident from above, a neural network which has been trained with the aid of known intensity variations for known application focus values can be used to determine a current application focus value for the application. In another embodiment, the application focus value can be determined by determining a first focus value which indicates how the current focus position of the objective is related to the optimal focus position of the structure and a second focus value which indicates how the current focus position of the objective is related to the optimal focus position of the surroundings of the structure. In this case, use is thus made of the fact that in an image there is focus information from the structure and its surroundings which are located at different heights along the optical axis. The optimal focus position of the application at issue may coincide with the structure or the surroundings or be at any other height m relation to these. When the first and the second focus value are known it is easy to determine the application focus value for the application at issue. The first and the second focus value can be determined by simulating the intensity variation at the peπ- phery of the structure for simulated, varying first and second focus values and then choosing the first and the second focus value which correspond to the simulated intensity variation which best conforms with the intensity variation m the electronic representation. One thus starts from a model of how a structure is reproduced at its periphery, i.e. in the transition to the surroundings, and then simulates different distances between on the one hand the structure and the focus plane of the objective and, on the other hand, the surround- mgs and the focus plane of the objective to control which combination of distances, i.e. which first and second focus values give an intensity variation which best resembles the actual one. A model which has been found to function well is a model where the periphery of the structure is modelled as two superimposed, co- localised, complementary steps m emitted intensity. When the first and the second focus value have been determined, they can be used to estimate the height dif- ference between the structure and the surroundings of the structure. This can be of interest m connection with blood analysis m which m this way it is possible to estimate the thickness of a blood smear. It has also been found that there are applications m which it is possible to utilise the focus information m the image m a manner similar to that described above, but m which it is not necessary to determine an appli- cation focus value. According to a second aspect of the invention, it therefore relates to a method according to claim 17, which more specifically comprises the steps of reproducing a structure having a periphery and surround- mgs, by means of an objective, producing an electronic representation of the structure reproduced by the objective, analysing how an intensity in the electronic representation varies at the periphery of the structure, and determining, by means of this intensity variation, a first focus value which indicates how the current focus position of the objective is related to an optimal focus position with respect to the structure, and a second focus value which indicates how the current focus position of the objective is related to an optimal focus position with respect to the surroundings. This method can be used, for example, to control the structure on the basis of the first and the second focus value . In this case, one does thus not determine an appli- cation focus value for the application, but a first and a second focus value for the structure and the surroundings of the structure. The control can, for example, concern a control that the height difference between the structure and the sur- roundmgs is the expected or comprise an estimate of the height difference. That stated above regarding the first method also relates m applicable parts to this second method. The application focus value described above can be determined and used m different devices. According to a third aspect of the invention, it therefore relates to a device having a first focus analyser, which is adapted to receive an electronic representation of a structure produced through an objective, to analyse how an intensity m the electronic representation varies at the periphery of the structure, and to determine, by means of this intensity variation, an application focus value which indicates how the current focus position of an objective is related to an optimal focus position. The focus analyser can be implemented, for example, m software, m hardware, as a field programmable gate array (FPGA) or an application specific integrated circuit (ASIC) or by some other arrangement which can carry out the above-described function. The focus analyser can, for example, be included as a part m a device for automatic focusing or for optical control. This device can m turn constitute a larger or smaller part of an optical system, such as a scanning microscope for classifying white blood corpuscles or for inspection of semiconductor circuits. The advantages of the device are evident from the discussion above. The objective which is used for reproducing the structure and a light-sensitive sensor for producing the electronic representation of the structure can be included m the actual device. The sensor can be an analog or digital sensor of some kind which can produce a one-dimensional or two- dimensional electronic representation of the image of the structure that the objective produces m an image plane where the sensor is arranged. However, the sensor is advantageously a digital area sensor, and the electronic representation then is a digital image. The sensor can be an additional sensor which is used merely for the automatic focusing, but it is advantageously a sensor which is used for producing images that are useful for the application at issue, for example the images that are used to classify white blood corpuscles m the above-mentioned scanning microscope. In an advantageous embodiment, the device comprises a microscope, said objective constituting the objective of the microscope. It is thus the same objective that is used to produce microscope images and to produce images for the automatic focusing. As will be described below, the invention is particularly suitable for a scanning microscope for automatic analysis of blood cells, in particular when red blood cells are present in the preparation. It can also advantageously be used for control of structures, in particular of their extent in the direction of the optical axis . According to a fourth aspect of the invention, as defined in claim 34, it relates to a device which can be used to carry out the method according to claim 17. More specifically the device comprises a first focus analyser, which is adapted to receive an electronic representation of a structure that has been reproduced through an objective, to analyse how an intensity in the electronic representation varies at the periphery of the structure, and to determine, by means of this intensity variation, a first focus value which indicates how the current focus position of the objective is related to an optimal focus position as regards the structure and a second focus value which indicates how the current focus position of the objective is related to an optimal focus position as regards the surroundings of the structure. The advantages of the device are evident from the discussion above. According to a fifth aspect of the invention, it relates to a storage medium, which can be read by a computer and on which a computer program is stored, which is intended to be used in an optical system. The computer program comprises instructions for making said computer analyse, in an electronic representation of a structure having a periphery, how the intensity varies at the periphery of the structure, and, by means of this intensity variation, determine an application focus value which indicates how the current focus position of an objective is related to an optimal focus position for the application at issue. According to a sixth aspect of the invention, it relates to a computer-readable storage medium, on which a computer program is stored, which is intended to be used in an optical system and which comprises instructions for making the computer analyse, in an electronic representation of a structure, which has a periphery and which has been reproduced through an objective, how the intensity varies at the periphery of the structure and, by means of this intensity variation, determine a first focus value which indicates how the current focus position of the objective is related to an optimal focus position with regard to the structure and a second focus value which indicates how the current focus position of the objective is related to an optimal focus position with regard to the surroundings. The above-mentioned computer programs can advantageously be installed later in a computer in an existing optical system, so that this can use the predictive focus measure for automatic focusing of an objective on a structure or for controlling the structure. The computer programs can of course also comprise instructions for implementing further steps of the above-discussed methods . It should be emphasised that what has been said above regarding the inventive methods relates in applicable parts also to the devices and to the storage media with the computer programs . The predictive focus measure is expected to function for a large number of different structures, and the invention is therefore expected to be applicable in many types of optical systems. As examples, mention can be made of medical microscopy, such as classification of red and white blood cells, and inspection of semiconductor circuits in connection with manufacture. Brief Description of the Drawings The present invention will now be described in more detail by way of embodiments which refer to the accompanying drawings, in which Fig. 1 is a schematic view of an automatically focusing microscope system according to an embodiment of the present invention, Figs 2a and b illustrate the effect of three different focus positions on a slide with printed calibra- tion lines, Figs 3a and b illustrate the effect of five different focus positions on a stained red blood cell, Figs 4a and b illustrate the effect of five different focus positions on another stained red blood cell, Figs 5a and b illustrate the effect of three different focus positions on a stained white blood cell, Figs 6a-c show results of ray-tracing experiments of three different objects each having five different focus positions, Fig. 7 shows the ray trace for the ray-tracing experiments in Fig. 6, Figs 8a-c illustrate schematically a model to explain the intensity variation that appears at the periphery of a structure, and Fig. 9 illustrates schematically an optical system for automatic control of a structure in accordance with an embodiment of the present invention. Description of Preferred Embodiments of the Invention Fig. 1 is a schematic view of an optical system in the form of an automatically focusing microscope system 10. The microscope system 10 has a light source 12, which illuminates an object 14 which is to be studied in the microscope. The object 14 can be, for instance, a blood smear on a slide, in which one wants to study white blood cells, and in which red blood cells are used as a basis for automatic focusing. The microscope system 10 further comprises an objective 16, which is adapted to reproduce, by means of the light from the light source 12, that part of the object 14 which is within the field of view of the objective on a digital image sensor 18, which produces an image in electronic form. The image produced by the image sensor 18 is stored in an image storage 20. An image-processing unit 22 and an image-analysing unit 24 are connected to the image storage 20. These units are intended for pro- cessing of the useful images from the image sensor 18. An example of processing that can take place m these units is automatic classification of the white blood cells in the above-mentioned blood smear. Since the units 22, 24 do not affect the automatic focusing, they will not be described in more detail . An ocular (not shown) can be connected to the objective 16 for manual studying of the object 14. The microscope system 10 further comprises a device for providing automatic focusing, which comprises, con- nected m series, a first focus analyser 28 connected to the image storage 20, a focus controller 30, and a focus mechanism 32. The focus mechanism 32, which may comprise, for instance, a motor, moves the objective 16 according to a control signal from the focus controller 30, which in turn generates the control signal on the basis of an application focus value received from the first focus analyser. The microscope system 10 also comprises a second focus analyser 34 which can be used as a supplement or alternative to the first focus analyser 28. The second focus analyser operates with a traditional focus measure, such as the sample variance for the intensity m an image of the object, and will therefore not be described m more detail. The second focus analyser can be used, for instance, to monitor the first focus analyser and/or m other fields of operation than those of the first focus analyser. The two focus analysers 28, 34 and the focus controller 30 can be implemented in hardware such as an ASIC or FPGA or preferably as software in a microprocessor 36, which is illustrated schematically in Fig. 1 with a dashed box around the focus analysers and the focus controller . The first focus analyser with or without the focus controller and the second focus analyser can be manufactured and sold separately from the remaining parts of the optical system or be mounted later in existing systems. It may also comprise one or more further parts of the optical system. The first focus analyser 28 operates as follows. It receives a digital image from the image storage 20. The image shows part of the object 14 and contains one or more structures which can be used for automatic focusing. To simplify the description, it is assumed that these structures are red blood cells. The focus analyser 28 then locates in a first step a red blood cell . This can be carried out by using a conventional image-processing method, such as thresholding or segmenting, which also locates the periphery of the blood cell . The periphery need not be present in its entirety in the image, but only to such an extent that the structure can be identified and its periphery be located. In the next step, the focus analyser 28 determines the intensity at the periphery of the blood cell. What is of interest is the transition between the blood cell and its surroundings or background. The blood cell should be separated from other blood cells, at least along part of its periphery so that the image in this part of the periphery contains a clear difference in intensity between the cell and the surroundings, which can constitute a background or another structure on which the blood cell is superimposed. Subsequently the focus analyser 28 analyses the appearance of the intensity variation. As will be described below, the analysis can be carried out on preprocessed intensity values, such as mean values. The parameters which are of interest in the analysis will be apparent from the experiments described with reference to Figs 2-7. According to given rules which implement the predictive focus measure, the focus analyser 28 finally determines an application focus value. The focus value is transmitted to the focus controller 30 which determines a control signal for the focus mechanism 32 based on the focus value. The detailed manner of determining the control signal depends on the application. Different applications may e.g. require different dynamics in the auto- matic focusing. This is a conventional regulating problem which could be solved by the skilled person. The focus analyser can use a neural network to determine an application focus value which indicates the distance and direction to the optimal focus position. Alternatively, the focus analyser can use a model which is described in connection with Fig. 8 to determine the focus value . Below follows a description of a plurality of experiments explaining how the focus position can be deter- mined on the basis of the intensity variations that arise at the periphery or the edge of a structure. The predictive focus measure is based on the fact that certain structures in misfocusing exhibit asymmetric effects at the periphery. Fig. 2a shows images 200, 210, 220 of a slide with imprinted free calibration lines, and Fig. 2b shows cross-sectional plots 230, 240, 250 for the intensity in the images in Fig. 2a. The uppermost image 200 in Fig. 2a is taken with the objective 1.5 μm above the position for the optimal focus. The uppermost image 230 in Fig. 2b is a cross-section of pixel values through the uppermost image in Fig. 2a. The intermediate image 210 in Fig. 2a and the associated cross-section 240 in Fig. 2b show the same part of the object at the optimal focus, while the lowermost image 220 m Fig. 2a and the corresponding cross-section 250 in Fig. 2b show the effect when the objective is located 1.5 μm below the position for the optimal focus. The effects m the form of the amplitudes and width of overshoots and maximum inclination of the ramps m the image are not symmetric around the optimal focus and can therefore be used to decide whether an image is taken above or below the optimal focus. The variance of the three images is, relative to the variance of the best focused one, from above downwards, about 0.165; 1 and 0.346, which indicates a skewness for the variance as focus measure. The lower image has a significantly higher variance than the one taken at a corresponding distance above the optimal focus. The reason for this is that the lowermost image has more overshoots than the upper. The variance would presumably not be a good focus measure for this object if the images had been collected m a series with a smaller space between the refocusing operations since the peak value for the variance probably does not coincide with the desired optimal focus. It is hardly no use calculating the variance of a high-pass filtered image since the high-pass filter lets through the high- frequency components of the overshoots which to a great extent are to be found in the lowermost image, but to a very small extent m the uppermost. It is expected that a predictive focus measure which is based on the above- mentioned asymmetric appearance of the intensity varia- tion at the periphery of the structure would give a better result . Figs 3a and b show another example of the asymmetric intensity variation. The structure is m this case a red blood cell stained according to the May-Grunwald-Giemsa method. Like m Fig. 2, the structure is reproduced (images 300, 310, 320, 330, 340) m a number of focus positions m Fig. 3a and with corresponding horizontal cross-sections thereof at the largest width of pixel values in the respective adjacent plots 350, 360, 370, 380, 390 in Fig. 3b. The focus positions are, from above downwards, +2.5; +1.5; -0.5; -1.5 and -2.5 μm, a negative value indicating that the objective is positioned below the position of the optimal focus. The two upper images 300, 310; 350, 360 have more or less terraced height differences, above all the average inclination and the width of the terraces in the image varying. The two lower images 330, 340; 380, 390 show more or less wide overshoot phenomena. The intermediate image 320; 370, the one taken 0.5 μm below the optimal focus, has the steepest change in intensity from background to object while at the same time its overshoots are the narrowest . The variance of the five images is, relative to the variance of the best focused one, from above downwards, 0.365; 0.502; 1; 0.923 and 0.757, which also in this example indicates a skewness and unfitness of the variance as a focus measure in this case. On the other hand, the asymmetric intensity variations can be used to implement the predictive focus measure. Figs 4a and b show one more example of the asymmetric intensity variation. In this case the object is another red blood cell, which is also stained according to the May-Grϋnwald-Giemsa method. The cell at issue has some details in the centre. The cell is not circular and therefore shows that the terracing and overshoot phenomena that follow from the misfocusings have the same form as the cell itself, i.e. slightly oval. The object is shown in Fig. 4a for a number of focus positions (images 400, 410, 420, 430, 440) which from above downwards are +2, +1, ±0, -1 and -2 μm relative to the optimal focus. Fig. 4b does not show cross-sections but a kind of radial mean values 450, 460, 470, 480, 490. The individual cell images have been thresholded in two regions, an "outer" with the pixels having values above a specific threshold and an "inner" region with the pixels having values below a specific threshold, zero on the x axis indicating the thresholding point. As threshold, use is made of the mean value of the maximum and minimum pixel value in the respective images, which resulted in well cohering regions. Subsequently the radial mean values were calculated both inwards from the region border (negative values of the x axis) and outwards from the same. The radial mean values are much more stable than the somewhat noisy corresponding cross-sections in Fig. 3. It is therefore presently preferred that the predictive focus measure be based on radial mean values . Also in Fig. 4b, the two upper images 450, 460 have more or less terraced intensity variations, in which above all the average inclination, corresponding to the width of the rings in the image, varies. In the transition to the background of the image (at positive radii) there are practically no overshoots at all . The two lower images 480, 490 show also in Fig. 4b more or less broad overshoot phenomena. The intermediate image 470, the one which is taken in the optimal focus, has the steepest change in intensity from background to object while at the same time its overshoots are the narrowest. The variance of the five images is, relative to the variance of the best focused, from above downwards, 0.656; 0.778; 1; 0.973 and 0.866, which indicates a skewness and unfit- ness of the variance as a focus measure also in this case. Once more, however, the intensity variations can be used for implementation of the predictive focus measure. Finally, Figs 5a and b show an example of a white blood cell which is also stained as described above. A white blood cell frequently has many small details. Moreover it causes two great intensity changes. One arises in the transition between the background and the so-called cytoplasm. The other in the transition from the cytoplasm to the nucleus. The white blood cell is shown in three focus positions (images 500, 510, 520) which from above downwards are +2, ±0 and -2 μm. Owing to the details in the cytoplasm, it is more difficult to see the ring phenomena in this example compared with the above examples. On the other hand, it is still relatively easy to see the phenomena in the adjoining red blood cells (in the upper and lower right corners of the image) . Furthermore the intensity variations have in the cross-sectional plots 550, 560, 570 in Fig. 5b different inclinations and different degrees of overshoots which can be used to determine the focus position. The variance of the three images is, relative to the variance of the best focused, from above downwards 0.791; 1; 0.862, which indicates a small skewness around the optimal focus. The variance had probably functioned less poorly as a focus measure of this white blood cell compared with the other objects above . Figs 6a-c show the result of three ray-tracing experiments, which aim at explaining for which kinds of structure the asymmetric intensity variations arise. The experiments permit separated studies of height and inten- sity differences in a manner which is difficult to provide with red and white blood cells as well as calibration rules. In all cases, one-dimensional objects with a one-dimensional ray trace are simulated. Diffraction effects, if any, are not taken into consideration, and intensities are summed up regardless of phase in the sensor . More specifically the ray-tracing experiments consist in one-dimensionally following a number of rays per point of the object. Each individual ray is followed from the object via a lens with two spherical "surfaces" and until it reaches a one-dimensional image sensor. The reason for carrying out the experiment one-dimensionally is that it is easier than a two-dimensional tracing, but is all the same sufficient to resemble the effects observed in rea- lity. All partial experiments are based on the ray trace illustrated in Fig. 7. The variations between the partial experiments consist in the height and intensity variation of the object and, owing to variations in height of the object, the distance object-lens. All measures are indicated in units of length (ul) . The simulated part of the object is ±0.04 ul , while the intermediate part, i.e. the structure with height and intensity variations, is ±0.008 ul . The intensity of the sensor has been calculated for ±0.8 ul while only the interesting part of ±0.16 ul has been indicated in Fig. 6. The enlargement is about 4 times. The simulated wavelength is 633 nm. The focus steps in Fig. 6 are 0.1 ul . As refractive index at this wavelength, 1.5207 is used for glass and 1 for air. From each point, 19 rays are radiated, the angles of which to the optical axis are uniformly distributed in the range [-0.01; 0.01] radians, i.e. about ±0.57°. The experiment thus differs radically from a well-adjusted microscope, which can very well collect rays of ±60° from the optical axis. All the same, the ray-tracing experiments qualitatively produce the same effects as those which are to be found in the microscope images . Fig. 6b shows the result of an object which has no height differences, but where the intensity goes down to 50% relative to the background in an area in the centre of the structure. Fig. 6c shows the result of an object which has no intensity variations, but a plateau having a height of 0.5 ul of the same extent and position as the intensity change in Fig. 6b. Fig. 6a shows the result of an object which has both the intensity and height differences from the other two objects. In the five plots 630, 635, 640, 645, 650 in Fig. 6b it is evident that the intensities of the five resulting one-dimensional images are practically symmetric around the optimal focus. For such a situation, variance and variance-like focus measures function well. The variance of the five images is, relative to the variance of the intermediate one, from above downwards, about 0.89; 0.95; 1; 0.95 and 0.90. In the five plots 660, 665, 670, 675, 680 in Fig. 6c it is to be seen that the intensities of the five resulting one-dimensional images, except for a change of sign, are practically symmetric around the optimal focus. For such a situation, variance and variance-like measures function well in such manner that it is a matter of minimising the variance in order to find the position of the optimal focus. The variance of the five images is, relative to the variance of the lowermost, from above down- wards, about 0.99; 0.31; 0.02; 0.32 and 1. It should be noted that for the isolated differences owing to height, it is possible to see in the images, but not in the variance, also the sign of the focus error. In the five plots 600, 605, 610, 615, 620 in Fig. 6a, the intensities of the five resulting one- dimensional images have asymmetric intensity variations similar to the ones in Figs 2-4 above. It is more difficult to make a direct comparison with Fig. 5. At the same time the intensities in the individual plots in Fig. 6a seem to be, qualitatively seen, the amount of the respective plots in Figs 6b and 6c. The variance of the five images is, relative to the variance of the lowermost, from above downwards, about 0.43; 0.49; 0.64; 0.84 and 1. For such a situation, variance does not function at all as a focus measure, although it is a measure that functions well in Fig 6b as well as in Fig. 6c, although with a minimum. The variance can thus be suitable for intensity- caused differences as well as for those owing to height as long as they are isolated, but not necessarily when they exist simultaneously. On the other hand, in the cases in Figs 6a and 6c there are asymmetric intensity variations at the periphery of the structures which can be used to implement the predictive focus measure which then gives a peak for the desired optimal focus and besides makes it possible to determine the direction and amount of focus correction on the basis of a single image . With a view to separating the effects of intensity differences, which result in a practically symmetric effect around the position of the optimal focus and the effects of height differences, which result in a practically skew-symmetric effect, the following analysis is suggested: The variance of an image is defined as I m n 2 V(A k ) = - ~∑∑a ≠ , (Equ. 1) (mn - l) .. j ,_, wherein 1 m n a ≠ = a ≠ ∑∑a„* » (Equ. 2) mn , =1 J=1 i.e. the image adjusted to the sample mean value zero. A series of images {A_(-n), A_(l-n), ..., (A_n} are taken equidistantly (i.e. with a constant difference in physical focus distance) with the focus, which is the optimal for the application at issue, of the intermediate image , image A_0. The original series is divided into two series of images : {B_(-n), B_(l-n), ..., B_n} and {C_(-n), C_(l-n), ..., C_n} defined by B_k= (A_k+A_ (-k) ) /2 and C_k= (A_k-A_( -k) ) /2. The division is unambiguous and always exists. Specifically B_0=A_0 and C_0=0. The B series is symmetric around B_0 since B_ ( -k) = (A_(-k) +A_k) /2 ) = (A_k+A_( -k) ) /2=B_k and the C series is skew-symmetric around C_0 since C_( -k) = (A_(-k) -A_k/2=- (A_k-A_ ( -k) ) /2 =-C_k. The A series is now divided into a symmetric series, corresponding to the symmetric appearance in Fig. 6b, and a skew- symmetric, corresponding appearance in Fig. 6c. Each original image A_k can be produced again according to A_k=B_k+C_k. The sample variance being symmetric around A_0 is equivalent to V(A k ) -V (A. k ) =0 for all k's. Therefore the following is studied = ∑ 1=1 ∑ ι=\ c ζ,* + Ε ≠ -(ζ,(-*) + (-*)) 2) = m n = ∑∑((b ≠ + c ≠ ) 2 - (b ≠ -Ε ≠ ) 2 ) ι=l j=\ = Σ Σ ( ζ, * + 2 b,χ≠ + C ≠ Έ ≠ ) - Ψ≠ h ≠ - 2 x≠ + d uXjk ) ) ,=1 j=\ which is, except for a factor, the sample correlation for B_k and C_k. From this follows that if the B_k ' s are significant - ly correlated with the respective C_k's, the variance will not be symmetric around the desired optimal focus and, thus, will most probably not have its maximum in the desired position either. For the purpose of practically removing the correla- tion between the B and C series, different filters could be applied to the A series and, thus, also to the resulting B and C series. However, it is difficult to find a filter which does so for arbitrary intensity and height variations . For a common type of object, two cases arise: 1) The C images are (close to) zero, which results in the correlation with corresponding B images being (close to) zero and, thus, the variance giving a symmetric measure. 2) The C images are significantly different from zero, which can be divided into two partial cases: CQ <! rt tr rt CQ CD Ω tr 0 5D Ω C 51 ) rt 51 ) H- H- ≤ to Hi rt Hi rt μ- Φ 0 tr O rt pr J t SD tr pr tr 5D 1 ) Hi Φ CQ 0 tr TJ P 3 tr . Φ tr Φ μ- co h- ■ Φ Ω Φ σ c Hi μ- 0 0 0 h- ' Ω rt 1— ' Φ ■ ζ CQ 5D TJ 5D Φ CQ φ CQ 0 l_l. rt < o C ? 0 0 1— ' rt Φ CL H- 0 rt h- 1 rt LQ rt c c P CQ rt φ Hh Φ rt Φ 0 I ! 0 rt rt • LQ tr H CQ P H- tr Φ pr 0 • —• T μ- 0 Ω μ- 0 CQ <! TJ CD CO H Φ Hi • ■ H- LQ rt H- O Ω Φ CQ φ Ω H rt Hi rt LQ t rt rt Hi n to φ 0 rt ' = = Ω 0 5D ^ — P 0 P P 51 ) •> Hi Ω tr to φ CO < P • TJ • H| 0 H{ c H- H £ CD Ω CQ rt 0 c Φ • . J μ- t Hi ■ s, Hh μ- H Φ i-h CO PS 3 > C Φ pi rt Φ > 5D C CQ ^ rt H- TJ LQ rt Hi μ- Φ Hi Hi — 0 H μ- μ- 3 — ω tr PJ φ H Φ P- H P. 3 0 H- pr 0 rt H- pr CQ CO Ω <i μ- μ- pr SD TJ s; 0 I- 1 ι-h TJ tr TJ c Hi TJ 3 3 LQ Φ PJ H- <! Φ μ- rt Φ 51 ) Ω H3 c φ rt Q Φ t 0 t 0 φ Φ H- Ω rt 0 H 5D Φ • g Φ 0 3 μ- P P 5D pr Ω Φ Φ pr Ω SD rt SD ι-h Ω P P H rt Hi Ω Φ Hi tr 5D CD < Hi TJ <! Ω P φ Φ TJ tr Hj CO Φ rt rr CO CO 0 C = > LQ Hi C 51 ) c CL H- Φ *> 51 ) h- 1 51 ) φ 0 Φ rt Hi Φ φ H- Ω CO CD H- H P CQ H- CQ X CD 51 ) H| P Φ P Ω LQ φ μ- Ω <: H- 0 SD C c 5D φ CO Ω Φ rt • €. H- Hi μ- 0 O Hi tr ^ 0 0 CL CD o O Φ CQ l-h O TJ 0 rt TJ P • H- TJ rt CL Φ H- ω 0 CQ 5D rt rt 0 rt ) Hi 0 μ- c μ- Hi G P tr ; H 0 H- P rt Ω • < Pi Ω tr CQ CL Hi Ω CD 3 ^ - ^ Hi ; PJ rt SD 3 CO rt ft T3 H- CD <! H- rt pr o rt c 3 Ω μ- Φ c Φ φ μ- Φ rt Ω 5D Ω Φ tr H φ H- 0 0 tr H 0 H- φ P Hi CQ 3 Φ CQ i. CQ CL Hi Hi H- Φ LQ to. φ LQ SD rt tr l-h H- 5D ti rt rt rt rt φ - TJ Hi Hi 5D Φ <! TJ Φ 0 SD TJ HJ Φ P H- Φ rt P Ω H- Hi Φ tr tr rt TJ rt rt Φ 3 μ- Hi Φ rt CQ Φ rt CQ CO rt H; Φ rt CD 0 rt tr LQ rt Hι 0 0 P φ Φ pr 0 Hi TJ 0 Hi φ H- 1 0 Hi μ- c μ- • Φ μ- 0 S H IQ P !D tr 5D - H- Hi P Ω CO Φ CQ μ- 0 μ- 51 ) rt Ω Φ 0 Hh tr 0 tr n- SD Hi rt 3 Φ rt Ω 0 c H- ra Hi H- Ω CQ CO 3 CQ Φ £ Pi P rt O < rt J SD P Φ pr H- 0 H- !D 3 5D CQ rt H- SD 5D rt CQ Φ φ C H{ CO rt CO Ω Φ 5D 0 tr H- ω OJ 51 ) P rt 0 P tr ^ g tr H- Hi μ- φ pi Hi Φ tr c H| — tr i— ■ 3 H- rt rt P Φ Hi ft h- 1 rt 0 3 c H- o 0 0 tr rt Φ CL 3 Hi Φ 5D CQ rt μ- Φ • Ω rt Φ rt rt ri φ ^ tr <J φ < 51 ) <i P Ω μ- φ Hi rt P 0 5D N rt J H- ω rt tr ^ rt pi φ φ 51 ) 5U SD H- 1 Φ c •• < P rt μ- μ- 5D 0 CL 3 Pi Φ • g, σ H- 0 rt tr Φ 0 !D tr CD S CQ Hi rt CQ 0 CQ 3 CQ 3 Φ φ SD Ω Hi Φ Φ P P φ Ml Ω Φ H- 0 tr rt £ H- H- 3 Φ pr 5D rt 51 ) c Φ CQ SD i- 1 Φ 0 Φ TJ 0 ) H- Ω Φ rt 5D tr H 5D 0 Φ X H- Hi Hi pr Hh φ tQ n, N Pi pr CQ rt •• P φ rt tr P rt Φ rt CD tr ; 0 Ω φ Φ rt P 5D TJ Ω C rt φ μ- <! Φ φ Φ 0 5^ Φ Ω p H- Φ Ω HI P tr 5D <! H- CQ J φ pr Pi Φ PI TJ CQ CQ Hi rt Hi Hi SD Φ rt Ω, 0 Ω μ- ■ !D rt Φ 5D Ω φ CQ o Hi 0 Hi Ω Hi 5D CL φ • O pr Φ Φ P μ- pr P 0 H- P H P H- Hi Hi TJ O J H- <1 H- H- rt TJ Ω CL Φ CL •« CL rt φ tr 3 pi CD Φ 3 LQ CD 0 rt Hi Pi 5D 3 CQ μ- Hi T 0 rt o 0 μ- TJ pr O 5D φ SD H- H- Hi tr d H- tr H- 1 Φ 0 μ- Φ P P ) ω tr pr Ω Hi φ ro rt P rt rt 0 CO 0 0 0 Pi 3 rt Φ ^ c Pi P- i μ- r+ CL P Φ 0 0 0 Hi pr 2 H- H- t-h Hi Hi c Ω 0 CL 5D pr tr H- φ rt φ rt Ω rt 0 CO 5D s; P tr SD 0 0 0 P 0 rt Φ 51J LQ CO CQ • s, Hi 5u £ rt pr rt TJ P 5^ Φ CL 5D Hi pi 0 SD Hj P P O Ω rt L 3 ω rt Hi - H- μ- 51 ) rt tr 0 Φ μ- C CQ < μ- tr 0 51 P HJ 5-: tr φ 0 Hi Hi H- 0 ι-i rt rt μ- Φ TJ rt Φ Φ rt Hi p 0 SD Hi CD φ 1 Φ 0 Φ 0 Ti Hi 51 ) Φ tr μ- 0 rt TJ o Hi Φ rt 5i Hi H- "< rt rt SD ■ s. P l Ω H- 5D X rt Ω 0- 5^ 3 tr P, 0 Pi pr Hi rt 0 tr ~ 0 Hi pr pr Hj C 0 r- 4 P = = CD H- pr C Hi 5i ) 0 rt PI φ 0 tr P- 0 φ P D σ SD Φ Φ Hi 3 0 LQ £ c • < CD φ C tr rt rr < Hi pr 5D Hi C Φ Hh μ- CQ Φ s: 0 rt CO P P 3 rt - j Ω tr H- Φ 0 Φ 0 rt C Hi Ω n CQ Hi TJ ■ pr tr rt φ C TJ H- Ω 0 51 ) Φ 0 Hi Hi rt Ω Φ Hi 0 rt H- c μ- Φ HJ Φ SD tr Φ φ P 51 ) 0 P P 5D TJ μ- pr φ tr μ- μ- φ Hi CD 3 CQ Φ 0 rt Φ ft t H 0 P rt CL Hi • rt Φ rt co Φ 51 ) LQ 3 Φ 5D TJ T < i— ' 0 rt Φ CD tr 0 h- 1 tr 51 ) pr to ua P 0 rt SD TJ rt C-. LQ Φ SD φ H- H- rt Hi Φ Φ tr Φ - Φ C Ω 0 CL 0 H{ LQ φ pr φ Ω HJ H{ 3 PT H- CQ Φ Ω φ CQ SD Φ c φ 5D 0 P- SD 0 rt CO L CD rt rt Hi φ tion and on the optical system including the sensor. A so-called sharpening filter can possibly both increase the greatest inclination and reduce the width of the overshoot simultaneously. The overshoots are most easily to be seen in the background since it has small natural variations. No terraces occur in the transition. 3) A focus position below the optimal focus results in overshoots, which are most easily to be seen in the background where the width of the overshoot depends on the amount of the misfocusing. No terraces occur in the transition. By measuring the height of the overshoots, the width of the overshoots, the greatest inclination and - in the absence of overshoots - the width of the undershoots down to, for instance, 90% of the background intensity, data is available for obtaining, by applying rules and expressions based on items 1-3 above, a value of the predictive autofocus measure, i.e. an application focus value. For example, a neural network can be trained with the obser- vations of the parameters suggested above combined with the corresponding known application focus values. Neural networks and the use thereof are well-known to the skilled person, see e.g. "Neural Networks for Pattern Recognition" by Christopher M Bishop, Oxford Press, ISBN: 0198538642. The neural network can be part of the first focus analyser 28. The above-mentioned rules probably do not function completely for white blood cells, but it is assumed that by making the corresponding experiments, it is possible to develop suitable rules for white blood cells and other structures . If the structures have no interfering internal details, an attempt at detecting the presence of terraces and an estimate of the width thereof can possibly provide more useful information. A way of facilitating the detection of terraces is the use of a modified so-called segmentation of the images. The modification consists in not only segmenting out cells which stand out from the background but also segmenting out terraced intensity patterns . The analysis of the intensity variations results in an estimate of the refocusing need both in respect of sign and amount . In the analysis one may want to use segmentation and subsequent radial mean values of pixel intensity. This is the case for, for example, round and oval cells. However, on linear objects such as line paths in semiconductor circuits, it is possible to analyse the pixel intensity one-dimensionally along lines or mean values of a plurality of lines. Furthermore, it should be mentioned that in all the experiments described above, an experimental set-up of the components below has been used. Microscope frame: Olympus BX50-WIF Condenser: Olympus U-SC2 with the top lens used, NA=0.9 Power supply: Olympus TH3 Bulb socket: Olympus U-LH100L Bulb: Osram HLX 64625 (12V 100W Xenophot) , halogen Objective: Olympus UplanFl 100X / 1.30 / oil TV adapter: Olympus U-TV1.0X Camera adapter: Olympus U-SMAD Trinocular tube: Olympus U-TR30 Immersion oil: Cargille catalogue No. 16482 Sensor: Sony 9100. Frame grabber: Matrox Meteor II In the images, a pixel corresponds to about 0.08 μm of the object, i.e. there are about 12 pixels per micro- meter. In all figures, the green (G) component from an RGB sensor has been used. In Fig. 3, the source of illumination was filtered through a green narrow-band filter with transmission at 550+5 nm. In the following a simple model for the above- described phenomena will be described with reference to Fig. 8. ω ω to to > LΠ o LΠ O LΠ o LΠ P C ■ ζ CO Hi ^ SD ω rt TJ 3 rt 0 rt SD rt Hi 3 i rt Hi SD 0 CD Pi P μ- Hi tr 0 i μ- Pi TJ SD P μ- φ μ- μ- X • pr 0 0 Ω 5^ Hi Hi Φ φ μ- pr • CO tr 3 φ 0 J μ- SD tJ Φ 3 C SD rt tr rt 3 Ω CQ μ- φ Φ Pi Ω H| Φ μ- H tJ SD Φ ^ φ CD rt LQ Ω Ω TJ SD Ω Hi Φ H pr μ- μ- . co tr - SD C Φ Ω Φ rt rt μ- g φ SD CO SD \ CO rt LQ μ- rt 0 μ- TJ Φ » Φ Hi tr CO Hi & P O Φ 0 Pi g Ω Hi • tr CO P LQ C pr Φ p μ- P Pi μ- μ- rt o CQ > SD μ- Hi Ω TJ Φ > rt Φ φ < rt Hi Hi LQ 0 • s, P Φ SD rt Ω CD LQ LQ tr Hi rt PI Hi Φ Φ μ- μ- rt μ- rt CO μ- ϋ > CD 0 Hi 0 CO Hh tr P P Pi .. Φ pr pr Φ CL tr μ- CQ P-. Hi TJ CO Pi 3 μ- 3 Hi <! PJ Hj rt μ- 5^ 0 Hi Φ CQ Φ ^ 0 Φ ■ £, Φ rt rt φ φ CQ μ- Φ Hi 5D 3 5D μ- Φ 0 φ Φ Pi i c P " • SD PJ μ- μ- CO SD Hi 3 rt Hi 0 σ ^ LQ 5D CQ Ω φ PJ Φ TJ 3 Pi Pi Hi CO CQ P X! P ^ .~. rt μ- CO Φ s- TJ pr Φ P. Φ μ- Φ φ CO ≤ X H{ Hi - Pi 0 0 rt SD rt tr Φ 5D pr co Φ Hh μ- φ pr h- 1 φ J c rt LQ CO CD Hi Ω H- SD SD 0 Φ μ- Ω HJ φ 0 Φ Φ 3 rt rt Φ 3 rt P Hh Φ φ Ω Ω ■ s, CD Hi φ Hi rt 3 Pi tr rt tJ c - 3 tr O P rt μ- 0 pr μ- rt pi CQ Φ μ- φ μ- 0 $, TJ μ- tr CD TJ 0 SD pr IQ CQ l_l- rt Ω CQ ■ ζ rt rt pr Φ TJ CD rt φ C CQ P φ CTl P Ω tr H| tr Ω rt rt Hj O rt φ Hi μ- Φ 0 tr Φ Hi Φ tr SD rt X h LQ P C μ- 0 Φ SD μ- Φ Φ tr H- 0 •• Ω tr O Ω rt Φ tr Φ μ- Φ SD 3 Φ P pr SD Hi μ- 5D ^ CO Ω Si Pi Pi Pi 0 c 5D Φ c rt Ω P μ- rt LQ P μ- CL φ M 0 P Φ rt P μ- pr e P φ 0 rt P LQ ■ tJ Hi Ω - rt LQ 5D rt tr 3 Φ TJ Hi H| TJ c Hi PT i LQ TJ Ω SD c Hi CD pr pr tr Φ tr C m Ω rt tr μ- O rt φ 0 rt φ P φ Hi Φ CO 0 SD μ- tr g 5D μ- Φ rt μ- tr μ- H| tr C pr rt P TJ SD rt SD Hi tr Φ P. 3 Φ -J CQ Hi i 0 φ J rt 3 0 SD Ω Φ SD SD co Φ Φ Hi Φ — - SD P 0 P 3 Φ SD μ- μ- Ω CO ω μ- Φ LQ < Hi Pi pr 5^ CO tr Hi CQ - <! ■ s. SD • CD rt Φ Hi 0 P rt rt rt μ- SD rt Φ μ- μ- rt rt pr 0 Φ Hj O Φ Hi μ- CD rt 0 Hi φ Hh LQ rt CQ Hi P μ- CO φ Ω Hi D rt Hi pr Φ Ω tr SD φ • s. Φ Φ rt • H SD rt PT Ω Hh μ- CD Φ C Pi SD 0 • Hh ■ £, SD Φ SD 5^ Φ μ- SD rt 0 TJ pr 3 SD CO tr 3 tr PT Φ SD LQ rt • s. Ω μ- Pi PI 3 Hh μ- J μ- J Ω LQ Pi SD TJ 3 Hi μ- μ- CO TJ 3 Φ Hh Φ ts SD pr ■ ζ tr 0 H rt Ω 5X 3 φ rt h D Φ rt 5i pr μ- rt μ- 0 Ω T Φ μ- φ c CO rt 0 Φ H| μ- pr 5D ^ ~. φ Ω tr SD 0 0 c; Φ rt tr pi μ- Ω P. h- 1 SD Ω P rt CO Pi TJ 5^ Ω CQ Pi J μ- ri rt *> Ω rt rt TJ Pi SD C Hi J Φ Φ Ω Hi 5^ to 5D rt rt Hi μ- Ω 0 Hi 0 rt CD CQ Pi rt CQ Φ Φ SD 0 Hi CO H| φ c CD Φ rt P. Pi SD 0 Ω Ω W5 Pi Hi μ- Φ μ- 3 rt O Hi Hi Φ Φ Φ rt o Φ CO ^ — ' Hi μ- φ H| Ω H{ pr μ- SD CQ Φ SD Φ C <! P Ω TJ μ- μ- 0 Hi TJ 3 3 pr rt J μ- rt • Hi Ω SD Hh rt Φ φ • SD Hi P Ω 5i Pi P Φ CO 0 rt c Φ μ- μ- Φ • CD Q s; r Φ SD TJ Φ C Pi α P 0 Hi 0 ≤ 0 Ω Ω μ- φ φ P μ- Pi CQ μ- TJ TJ μ- pr SD CQ TJ H| Hi • s. ϋ Hh φ rt pr μ- TJ £. tr 0 rt CO rt Hi O 0 TJ P H- 1 SD rt rt μ- rt tr TJ φ Φ Φ rt tr μ- Hi pr Φ 3 φ μ- Φ g μ- Φ μ- Hi rt 0 Pi μ- 0 SD 5D CQ pr Ω φ 0 ^ 5D Pi pr \-> rt rt Hh Φ Φ p μ- rt o 0 3 Φ Φ Hi Pi Pi tr J Pi • φ pr μ- PJ Hi Ω SD H{ 0 pr r 0 J Hj rt 0 pr 5D μ- Pi μ- CO Ω SD CQ P-. φ φ Φ 3 tr rt Hi Pi J Φ H| 0 0 Φ Ω Ω SD SD tr P TJ rt tr rt ω μ- - CQ 3 Φ Ω Ω SD μ- 0 SD 0 P Pi SD c Φ CD rt 5D Ω SD 0 rt CO c pr 0 rt LQ - φ rt SD 5D μ- ^ P " CQ Hi rt c LQ CO CQ rt CO μ- φ p 0 rt Hi 5D pr rt Φ P 0 0 tr Ξ rt ■ s. CQ C co LQ H- 0 0 P pr Ω 3 f- Hi rt O Ω 3 μ- P SD μ- LQ Hi rt pr tr H| Φ φ to rt rt C Pi φ SD Hi o $. C Hi P rt 0 TJ 0 rt φ rt co Ω X 5D • μ- Φ μ- Φ φ rt Hi rt μ- P ^ SD X H| Hi pr Ω c CQ μ- TJ P pr CQ 0 rt rt Ω Ω pi $ tr 5D O 0 CL μ- 1— ' μ- 0 μ- rt Ω <i rt φ φ • < Ω pr pr CQ tr 0 pr rt φ Ω Pi LQ . 3 ~ 3 c rt Ω C rt Hi φ μ- rt μ- SD tr TJ 0 Φ φ rt P s; Φ rt φ tr μ- rt φ rt CO ω μ- C p pr pr H| C 0 Ω Φ ω <! CΛ Hi Φ 0 H| tr Hi pr rt Φ pr Pi pr P- tr . Ω ≤ 3 Pi φ φ Hj Hj SD Φ * • < Pi Φ Hi 0 CQ C rt SD Hi Hi Φ tr Φ LQ φ φ LO Hi tr μ- μ- Φ O 0 3 Ω Φ rt C TJ rt Ω tr < Φ φ φ SD μ- 5D SD 0 μ- CD P Hi o O ■ s. P tr O O P rt Φ μ- rt Hi rt μ- Φ Hi Ω CO H| CD LQ φ μ- Hi TJ CD Ω tr LQ φ Hi tr tr Hj 0 rt Φ tr h- ' P " μ- C C Q Φ rt rt ► i tr X P 0 Φ 5D Ω tr SD O TJ D 0 H- SD Φ Φ Φ Hi pr μ- Φ • SD Ω Ω Hi SD Hi Hi rt g rt TJ rt c Hi P 0 Hi Hi μ- SD Hi Ω P TJ Ω P. Φ rt rt 5D rt Φ Φ Hi 5^ tr 3 φ Φ PJ μ- i TJ μ- TJ Ω 0 LQ tr Hj rt μ- pr rt CD Φ C X Ω Φ Ω Φ φ Si H| H| CL TJ Φ CQ SD P P Φ 0 Φ Φ s: £ Hi SD SD 0 CL Hi μ- μ- 3 pr (^ p c μ- Hi 0 C Hi O Hi H- Φ Pi 3 3 Φ l-h Φ Φ 5D 1 Ω CD Hi 1 pi as two superimposed, co-localised complementary steps in emitted intensity, one for each semiplane, see the two dashed curves in Fig. 8c :2. The position of these two steps, in the plane perpendicular to the optical axis of the system, is set to coincide with the position of the height step. The first step is the step in intensity between the intensity emitted in the left semiplane down to zero in intensity for all positions to the right of the height step. Correspondingly, the second step is the complementary step in intensity between zero in intensity for all positions to the left of the height step to the intensity emitted in the right semiplane. The height information is incorporated in the model by these two intensity steps being located at a height each, i.e. in a position each along the optical axis. The two intensity steps are processed separately when passing through the reproducing system and are then each reproduced with a height-dependent sharpness. Fig. 8c : 3 illustrates the reproduced intensity steps as two dashed curves when the focus plane of the objective, i.e. its current focus position, is at the height z=3. The intensity step of the left semiplane, with focus position deviation 1, is then reproduced more sharply than that of the right semiplane, which has focus position devia- tion 2. The sum of the intensity of the images is shown by an unbroken line. In Fig. 8c :4, the focus position deviations are changed owing to the focus plane of the objective being at the height z=0. A comparison of 8c: 3 and :4 indicates an asymmetric effect which is similar to the one in Fig. 6c. The focus position deviations thus indicate how the current focus position of the objective is related to the optimal focus position with regard to the structure and the surroundings, respectively. These focus position deviations are in other places in this specification referred to as the first and the second focus value. For a structure having the height difference zero from its surroundings, the two intensity steps will be located at the same height. See Figs 8b :1 and :2 where the two semiplanes have been given different emitted intensity. This results in the two focus position deviations being identical independently of the position of the focus plane of the objective and a symmetric effect being obtained, see Figs 8b: 3 and :4, which is similar to the one in Fig. 6b. Fig. 8a shows a combination of the cases in 8b and 8c. The result in Figs 8a: 3 and :4 is similar to that in Fig. 6a and that in Fig. 4b. In conclusion, this simple example exhibits asymmetric effects which explain the phenomena that appear in focusing on red blood cells. The model can be used to estimate, from curves such as those in Figs 8a: 3 and 8a:4, unknown parameters such as emitted intensity in the left and the right semiplane and, above all, knowing the characteristics of the objec- tive, the focus position deviations of the left and the right semiplane. With estimated focus position deviations for the two semiplanes and knowing which of them is closest to the objective, it is then easy to calculate, in the cases 8a and 8c, where in relation to the desired focus plane or focus position the current focus plane or focus position of the objective is located. In the case 8b, only information about how far away from the focus plane of the objective one is positioned, not on which side, will be obtained. In the example with blood, the structure can be a red cell, in which case the first focus value or the focus position deviation indicates how far away the current focus plane of the objective is from the red blood cell. The surroundings can be the slide on which the red blood cell is arranged. The second focus value or the focus position deviation thus indicates how far away the current focus plane of the objective is from the slide. The object which is to be studied in the microscope can be a white blood cell which is thin and therefore is located at about the same height as the slide. The focus should thus be essentially on the slide. Knowing this, it is possible to calculate, on the basis of the focus values, an application focus value and from that how the objective and the slide are to be moved relative to each other for the focus to be in the desired position. Besides using the model for focusing, it is also possible to use it to test how an actual structure combination (border area between structure and surroundings) of an object, such as an IC wafer, is related to an assumed structure combination. An optical reproduction of the actual structure combination is then compared with simulated reproductions of the assumed structure combination. For each simulated reproduction, focus position deviations are used, which depend on the assumed structure combination and a simulated position of the focus plane of the optical reproducing system. As long as the actual structure combination is similar (height and inclination) to the assumed structure combination, there will be a simulated reproduction which is correspondingly similar to the optical reproduction. Which of the simulated reproductions it is depends on how the focus plane of the optical reproducing system is related in height to the actual structure combination. It is the intensities emitted by the object that affect the reproduction. Therefore the model functions whether the emitted intensities originate from trans- mission illumination or reflection illumination of the object . A person skilled in the art can modify the above model which relates to bright field microscopy to other kinds of optical applications where significant height differences occur. When extending to general structure combinations, of course, the model for the height difference is important. A red blood cell can be modelled as a circle raised from a round loaf with a hole which is precisely the circle. In such a model, two-dimensional filters corresponding to the reproductions of the objective are then applied. How- ever, it is easier to convert the image into a radial mean value as has been done in Fig. 4b, whereupon one- dimensional filters corresponding to the reproductions of the objective can advantageously be used. Fig. 9 describes an example of an optical system which can be used for automatic control of an object. The optical system comprises a light source 12, an objective 16, an image sensor 18, and a focus analyser 28. The physical components can be the same as those in the optical system in Fig. 1. The function of the system, however, is different. The light source 12 illuminates the object 14 that is to be controlled. The object can be, for example, a semiconductor circuit where the depth of an etching pattern is to be controlled. The etching pattern is then a structure having a periphery in the transition to the surroundings. The objective 16 reproduces that part of the object which is within its field of view. An electronic representation of the reproduction can be produced by means of the image sensor 18. This electronic representa- tion is received by the focus analyser 28, which analyses the intensity variation at the periphery. There is a desired depth of the etching pattern, that has been supplied to the focus analyser 28. The focus analyser uses the information about the desired depth in the above described model, which models the periphery as two superimposed complementary co-localised intensity steps, and simulates by means of this model a plurality of intensity variations corresponding to different current focus positions of the objective. If one of these intensity varia- tions conforms sufficiently well with the intensity variation in the electronic representation, the actual etching depth is considered to be the desired. Otherwise the etching depth is considered not be the desired, in which case the focus analyser gives the alarm. Finally, it should be mentioned that the currently most preferred embodiment of the invention comprises the use of the above-described model for the determination of the application focus value as well as the first and the second focus value .

Claims: CLAIMS 1. A method in an optical system, comprising the steps of reproducing a structure having a periphery by means of an objective, producing an electronic representation of the structure reproduced by the objective, c h a r a c t e r i s e d by the steps of analysing how an intensity in the electronic representation varies at the periphery of the structure, and determining, by means of said intensity variation, an application focus value indicating how the current focus position of the objective is related to an optimal focus position for the application at issue. 2. A method as claimed in claim 1, wherein the step of determining an application focus value comprises determining an application focus value which indicates whether the current focus position of the objective is above or below the optimal focus position. 3. A method as claimed in claim 1 or 2 , wherein the step of determining an application focus value comprises determining an application focus value which indicates how far away the current focus position of the objective is from the optimal focus position. 4. A method as claimed in any one of the preceding claims, further comprising the step of generating, on the basis of said application focus value, a control signal for changing the mutual positioning of the objective and the structure to provide a desirable focusing. 5. A method as claimed in claim 4, wherein the control signal is generated on the basis of said application focus value only. 6. A method as claimed in any one of the preceding claims, wherein the electronic representation is produced by means of a single light-sensitive sensor and for a single exposure. ) LO NJ to H 1 H LΠ O LΠ o LΠ O LΠ pr rt 0 s: Hi Ω o Hi O 0 Ω <! α 0 rt I— ' < Ω SD C 0 μ c < Ω 0 μ TJ <! Ω 0 tr tr pr 0 tr 0 rt Hi SD μ Hi 0 ^ SD H- 1 P <J P SD H- 1 tr P H SD ■ s. Φ μ Ω SD Ω Hi SD Ω CO Hi SD rt φ rt μ Hj SD rt Φ Hi SD Φ Ω C μ Φ 5^ C rt μ s^ C 5D rt μ μ μ Φ Φ Hi Φ P μ μ φ Φ P i μ μ rt CO Ω tr CO 3 Ω CO Ω pr 3 φ Pi tr Pi φ 3 Hi Hj CQ P LQ φ 3 Ω p Φ φ 3 pr rt rt CO H rt rt φ O \-~ CD SD SD μ 1 Φ LQ CQ CO D hj CO pr Q CQ CD co rt CD rt CD CD o Φ Hi μ μ < - to μ TJ C -> Hi o ~ SD pr 0 μ SD - . μ μ Φ . 5= <! P SD • < 0 Hi μ 0 • • TJ rt SD . Ω 0 o rt rt SD < rt Hi SD Ω Ω φ Pi ■ Φ CO Φ P • g, Hi rt CQ Φ PT rt : > > Φ 0 rt • rt s: > φ •<; 3 rt $, rt μ > C C pr μ rt pr > O μ Hi Φ pr . rt - r μ tr Hi 5^ μ Ω Φ Φ 0 rt μ Φ Φ rt PJ μ rt Φ 3 φ rt φ 3 μ <J p rt φ 3 Hj Hi CO SD HJ 3 P μ CO P Hj 3 pr rt LQ 3 TJ μ tr H{ φ rt SD SD pr Hj Φ P SD φ pr Hj φ Φ Φ rt Ω φ Φ 0 CO Φ φ Φ tr φ pr P Φ Φ rt rt pr Hj CQ Φ Φ rt Hj a Φ Φ rt J Hi Φ 0 μ rt rt J SD μ μ rt φ rt rt Φ rt μ pr pr Φ μ rt μ tr H; μ μ pr rt SD Φ CO P ) pr tr CQ rt Pi pr μ pr pr Hi Φ TJ P 0 φ SD TJ p 0 Φ SD μ TJ p 0 P μ- 1 TJ 0 Φ t. • 0 J TJ φ 0 ^ P φ P. ■ s. rt 0 Φ Pi rt p Φ Pi Hh Si 5D pr Hi rt p. tr g rt α rt φ • CO Hi rt TJ μ μ P Hi rt SD μ Hi Hi rt 0 rt 0 μ pr CD μ 3 μ pr Φ H| μ μ μ pr SD H| O Φ μ tr SD rt 0 0 μ pr SD Ω SD Φ • s. O Φ SD rt Ω φ P φ SD J μ P 5D rt TJ φ O φ rt P TJ Φ CO μ p Hj TJ Φ CQ c Φ O Hi pr rt CQ CD TJ rt CO • tr CQ pr 0 pr 0 rt 3 pr CO CO CQ CD c Hi rt CO μ pr Φ Φ CO Ω Φ Hi φ CO Ω P μ SD φ D Ω φ r tr rt Ω Ω TJ μ tr rt Ω rt φ P ) Ω < Hj rt P 0 rt Hi rt p rt Hj rt TJ Ω 0 Φ i Φ H- 1 rt Hi Ω φ Hi • H| CQ SD ^ Φ 5D Ω Hh pr rt • Φ SD rt μ * ; φ SD 0 0 φ J SD C 0 C SD • ^ μ 5D H| TJ μ Φ Φ pr TJ μ 0 P 0 TJ μ CQ Pi rt Ω rt μ Hi < H φ Ω μ rt μ μ o 3 SD Φ 0 3 μ P 0 3 μ Pi pr 5^ φ 0 3 Φ μ 0 \-> rt 3 Ω ^ 3 SD Hh O Φ 0 P μ Hh 0 Φ rt Hh Hi 0 Φ rt Φ H Hi Hi Φ • Si H Φ C φ 0 φ rt Hh Hi P Hh Hh P. pr Hh SD Hi α μ Hi Hi 3 i Φ Ω Hi C 3 < Pi μ rt 0 Ω 0 rt φ φ tr rt 0 0 O Φ μ Pi CD Hi rt φ TJ SD 0 pr SD μ SD < pr SD μ Hj 0 pr SD μi LO Pi Ω TJ P J Φ μ 0 Hi μ Hi Hi μ P φ Pi ps Φ μ φ P pi 0 φ P Φ P P Ti c rt rt μ rt Pi 0 Ω 0 μ P μ μ Pi SD rt Hi P 0 SD TJ P rt SD 0 CO μ P Φ TJ c P CO CD SD Φ CQ SD Φ CQ SD ■ ξ CD 5D rt rt CD 5D Hi 3 Hh LQ Hi 5D rt CQ μ 5D Φ rt Ω CQ rt ^ tJ Hi tr rt μ rt • PJ μ rt rt "< P < SD 0 3 P μ Ω CO P ra μ CO Hj CO • < Hi 0 μ P Hi CQ • 3 Hh pr Hi CD • rt SD h- 1 Ω SD μ 3 TJ C ^ 0 SD Φ C μ SD 0 0 LQ C μ SD 0 φ C μ pr i c P SD 0 Hi Ω Hh P μ PJ Ω J 0 Ω rt P Ω P 0 Ω Ω P 0 φ 5^ Hi CO Hi μ O CQ Φ tr 0 o 3 rt rt LQ Pi Φ - TJ rt LQ P C SD rt LQ P Φ 0 μ P Pi μ TJ P H| Φ μ C φ SD C Φ Hh CD TJ C φ 0 Ω TJ Hi LQ φ Hi rt Hi rt φ 3 O VD SD Hi tr rt rt Hj Hi tr O TJ Hj tr tr ■ s, 5^ 0 CQ 0 μ Φ pr μ CO - Φ o 0 SD pr tr SD Φ o 0 Ω TJ φ Φ 0 0 tr CQ CQ rt 5D 0 Ω 0 CQ SD 0 Pi φ ■ s, Hi P Φ Φ 3 ■ Hh C 0 SD £, Hi Φ μ μ Pi Hi 5^ PJ Φ rt Hi LQ pi • t • Ω φ Ω CQ CD Hi Ω Ω Ω TJ rt Hi CD CO P rt tr 0 rt rt ■ s, pr rt 0 rt rt μ SD 0 rt rt rt tr 0 μ 0 SD rt μ rt rt rt Hi μ Φ TJ 3 tr pr rt μ φ Φ 3 tr tr TJ rt P 3 tr pr μ CQ 0 Ω TJ t PJ SD 5D pr tr SD SD Hi Φ TJ Φ Φ pr P. μ Hi TJ Φ Φ 0 μ Ω J Φ Φ <! μ μ P C TJ Φ LQ Hi rt Φ φ P. φ Hi H| Φ rt LQ CQ Hi CQ 0 φ Hi Φ pi rt to 0 μ μ \-> μ TJ μ μ TJ pr pr μ μ TJ μ P μ μ TJ Si μ 0 μ TJ 0 C 0 <! TJ 5D • Pi Φ CO PJ Hi t. rt Hi CD P Hi rt CD 0 CD p Hj μ μ 0 Hi <! Ω h Hi J P 5D H| Pi φ rt Φ μ 0 o φ rt φ μ Hh φ rt φ CD Ω P SD SD Φ Hi φ TJ rt Pi CO Φ Ω a Hh 0 Hi O Φ Ω 0 0 CD Φ Ω SD rt rt Ω rt 0 μ Ω 3 φ pr μ Pi Φ rt Hi P Φ P Hi rt p Φ Hi rt 0 tr C μ φ pr rt Hi SD φ φ Hj Φ Ω SD CO P. pr 5D rt 3 CO Pi pr c CD Pi Φ Φ Hi φ Φ 0 Pi Φ pr Pi Pi SD TJ C P μ μ P SD pr φ μ μ rt φ Ul μ μ CO P μ φ rt Ω μ J φ CO H- 1 SD rt P 0 P φ SD rt J pr μ rt P SD P tr Φ P tJ rt SD • CQ Hi CD • LQ φ P LQ rt LQ ^ Φ LQ Hi CQ TJ ed to the optimal focus position of the surroundings of the structure. 13. A method as claimed in claim 12, wherein the step of determining a first and a second focus value com- prises simulating a plurality of intensity variations at the periphery of the structure for simulated, varying first and second focus values, and selecting the first and the second focus value which correspond to the simulated intensity variation which best conforms with the intensity variation in the electronic representation. 14. A method as claimed in claim 13, wherein the step of simulating uses a model according to which the periphery of the structure is modelled as two superimposed, co-localised complementary steps in emitted intensity. 15. A method as claimed in any one of claims 12-14, further comprising the step of estimating the height difference between the structure and the surroundings of the structure at the periphery of the structure on the basis of the first and the second focus value. 16. A method as claimed in any one of claims 1-15, which method is used in connection with analysis of blood. 17. A method in an optical system comprising the steps of reproducing a structure having a periphery and surroundings by means of an objective, and producing an electronic representation of the structure reproduced by the objective, c h a r a c t e r i s e d by the steps of analysing how an intensity in the electronic representa- tion varies at the periphery of the structure, and determining, by means of this intensity variation, a first focus value which indicates how the current focus position of the objective is related to an optimal focus position with regard to the structure and a second focus value which indicates how the current focus position of the objective is related to an optimal focus position with regard to the surroundings . 18. A method as claimed in claim 17, further comprising the step of controlling the structure on the basis of the first and the second focus value. 19. A method as claimed in claim 17 or 18, wherein there is a known expected height difference between the structure and the surroundings at the periphery of the structure and wherein the step of determining the first and the second focus value comprises simulating a plurality of intensity variations at the periphery of the structure for simulated varying current focus positions of the objective under consideration of the expected height difference, and selecting the simulated intensity variation which best conforms with the intensity variation in the electronic representation, the first and the second focus value being determined on the basis of the corresponding simulated current focus position, and further comprising the step of checking whether the actual height difference between the structure and the surroundings conforms with the expected height difference on the basis of the degree of conformity between the selected simulated intensity variation and the intensity variation in the electronic representation. 20. A method as claimed in claim 17, wherein the step of determining a first and a second focus value com- prises simulating the intensity variation at the periphery of the structure for simulated, varying first and second focus values, selecting the first and the second focus value which correspond to the simulated intensity variation which best conforms with the intensity varia- tion in the electronic representation, and estimating the height difference between the structure and its surroundings on the basis of the first and the second focus value . 21. A method as claimed in claim 19 or 20, wherein the intensity variations are simulated by means of a model according to which periphery of the structure is modelled as two superimposed, co-localised complementary steps in emitted intensity. 22. A method as claimed in any one of claims 1-15 or 17-21, which method is used in connection with con- trol of semiconductor circuits. 23. A device for use in an optical system, c h a r a c t e r i s e d by a first focus analyser (28) , which is adapted to receive an electronic representation of a structure reproduced through an objective (16), to analyse how an intensity in the electronic representation varies at the periphery of the structure, and to determine, by means of said intensity variation, an application focus value which indicates how the current focus position of the objective is related to an optimal focus position for the application. 24. A device as claimed in claim 23, further comprising said objective (16) through which the structure has been reproduced, and a light sensitive sensor (18) for producing the electronic representation of the struc- ture. 25. A device as claimed in claim 23 or 24, further comprising a focus controller (30) which is adapted to generate, on the basis of said focus value from the focus analyser (28), a control signal to a focus mechanism (32) for controlling the mutual positioning of the objective and the structure. 26. A device as claimed in claim 24 or 25, wherein the sensor (18) is a digital area sensor and the electronic representation is a digital image. 27. A device as claimed in claim 24, 25 or 26, wherein the sensor (18) is the sensor of the optical system for producing useful images . 28. A device as claimed in any one of claims 23-27, further comprising a microscope, said objective (16) con- stituting the objective of the microscope. 29. A device as claimed in any one of claims 25-28, further comprising a second focus analyser (34) for pro- ducing an alternative application focus value, said second focus analyser (34) being connected to said sensor (18) for receiving said electronic representation and to the focus controller (30) for generating a control sig- nal. 30. A device as claimed in any one of claims 23-29, wherein the first focus analyser (28) is adapted to determine an application focus value which indicates whether the current focus position of the objective is above or below the optimal focus position. 31. A device as claimed in any one of claims 23-30, wherein the first focus analyser (28) is adapted to determine an application focus value which indicates how far away the current focus position of the objective is from the optimal focus position. 32. A device as claimed in any one of claims 23-31, wherein the first focus analyser (28) is adapted to analyse how the intensity varies at the periphery of the structure by measuring at least one of the following parameters in the intensity variation: the inclination, the height of an overshoot, the width of an overshoot, the width of an undershoot, the presence of a terrace, and the width of a terrace. 33. A device as claimed in any one of claims 23-32, wherein the first focus analyser (28) comprises a neural network. 34. A device for use in an optical system, c h a r a c t e r i s e d by a first focus analyser (28) which is adapted to receive an electronic representation of a structure reproduced through an objective, to analyse how an intensity in the electronic representation varies at the periphery of the structure, and to determine, by means of said intensity variation, a first focus value which indicates how the current focus position of the objective is related to an optimal focus position with regard to the structure, and a second focus position which indicates how the current focus position of the objective is related to an optimal focus position with regard to the surroundings of the structure. 35. A computer-readable storage medium, on which a computer program is stored, which is intended to be used in an optical system, c h a r a c t e r i s e d in that the computer program comprises instructions for making the computer analyse, in an electronic representation of a structure, which has a periphery and which has been reproduced through an objective, how the intensity varies at the periphery of the structure and, by means of this intensity variation, determine an application focus value which indicates how the current focus position of an objective is related to an optimal focus position. 36. A storage medium as claimed in claim 35, where- in the instructions for determining an application focus value comprise instructions for determining an application focus value which indicates whether the current focus position of the objective is above or below the optimal focus position. 37. A storage medium as claimed in claim 35 or 36, wherein the instructions for determining an application focus value comprise instructions for determining an application focus value which indicates how far away the current focus position of the objective is from the opti- mal focus position. 38. A computer-readable storage medium, on which a computer program is stored, which is intended to be used in an optical system, c h a r a c t e r i s e d in that the computer program comprises instructions for making the computer analyse, in an electronic representation of a structure, which has a periphery and which has been reproduced through an objective, how the intensity varies at the periphery of the structure and, by means of this intensity variation, determine a first focus value which indicates how the current focus position of the objective is related to an optimal focus position with regard to the structure and a second focus value which indicates how the current focus position of the objective is related to an optimal focus position with regard to the surroundings .

Inventors: ROSENQVIST ANDERS, ROSENQVIST, ANDERS
Applicants: CELLAVISION AB, ROSENQVIST ANDERS, ROSENQVIST, ANDERS
Application year: 2000
Main classification: G02B7
IPC codes: G02B7