RU2794050C1 - Autofocus method for digitizing a microscopic preparation - Google Patents

Autofocus method for digitizing a microscopic preparation Download PDF

Info

Publication number
RU2794050C1
RU2794050C1 RU2022120594A RU2022120594A RU2794050C1 RU 2794050 C1 RU2794050 C1 RU 2794050C1 RU 2022120594 A RU2022120594 A RU 2022120594A RU 2022120594 A RU2022120594 A RU 2022120594A RU 2794050 C1 RU2794050 C1 RU 2794050C1
Authority
RU
Russia
Prior art keywords
sharpness
object table
image
axis
images
Prior art date
Application number
RU2022120594A
Other languages
Russian (ru)
Inventor
Станислав Владимирович Березовский
Original Assignee
Общество с ограниченной ответственностью "Медика Продакт"
Filing date
Publication date
Application filed by Общество с ограниченной ответственностью "Медика Продакт" filed Critical Общество с ограниченной ответственностью "Медика Продакт"
Application granted granted Critical
Publication of RU2794050C1 publication Critical patent/RU2794050C1/en

Links

Images

Abstract

FIELD: digital microscopy.
SUBSTANCE: in the method of autofocusing when digitizing a microscopic preparation, which includes moving the microscope object table along the vertical Z axis to a position corresponding to the maximum value of image sharpness of the sample of the microscopic preparation, autofocusing is carried out in two stages. The first stage includes continuous movement of the object table with the sample along the Z axis towards the microscope objective at the maximum speed by a given value, then the object table is continuously moved away from the lens at a given speed while obtaining images, calculating the sharpness S of the resulting images, assigning object table coordinates along the Z axis and the calculated sharpness values for the obtained images during the movement of the object table. The sharpness values S and coordinates along the Z axis for all images are sent to the memory, the focused image is fixed by selecting the coordinate of the object table with the sample on the Z axis, which satisfies the condition under which the sharpness decreases during the passage of the object table along the specified range along the Z axis on three images in a row before the “peak” of sharpness and after the “peak” of sharpness. Moreover, if the specified condition is met, the first stage of autofocusing is considered complete, and the movement of the object table with the sample is stopped before reaching the end of the specified range, and if the specified condition is not met, the second stage is carried out with an increased focusing range, the speed of movement of the object table and a given distance to obtain a focused image while simultaneously performing image sharpening calculations.
EFFECT: increased speed of autofocusing.
1 cl, 6 dwg

Description

Изобретение относится к области цифровой микроскопии, а именно к области непрерывной автофокусировки цифровых фотосистем, и может найти применение в медицине для оцифровки микроскопических препаратов.The invention relates to the field of digital microscopy, namely to the field of continuous autofocusing of digital photosystems, and can be used in medicine for digitizing microscopic preparations.

На данный момент в системах цифровой микроскопии при оцифровке каждого отдельного поля зрения, системы цифровой микроскопии вынуждены проводить фокусировку для получения наиболее резкого изображения для его последующей оцифровки. В контексте устройств для автоматической оцифровки микроскопических препаратов, это процедура также называется автофокусировкой. Так как одно поле зрения, получаемое на большом увеличении (например, 40х), имеет размеры порядка 300 х 200 мкм, и в зависимости от характера цифрового препарата такие поля зрения могут исчисляться сотнями, время необходимое для автофокусировки каждого поля зрения значительно влияет на продолжительность всей процедуры оцифровки микроскопического препарата. В этой связи сокращение времени, необходимого на автофокусировку, представляется одним из способов сокращения времени, необходимого на оцифровку всего микроскопического препарата. At the moment, in digital microscopy systems, when digitizing each individual field of view, digital microscopy systems are forced to focus in order to obtain the sharpest image for its subsequent digitization. In the context of devices for automatically digitizing microscopic preparations, this procedure is also called autofocus. Since a single field of view obtained at a high magnification (for example, 40x) has dimensions of the order of 300 x 200 μm, and depending on the nature of the digital preparation, such fields of view can be in the hundreds, the time required to autofocus each field of view significantly affects the duration of the entire microscopic specimen digitization procedures. In this regard, reducing the time required for autofocusing seems to be one of the ways to reduce the time required to digitize the entire microscopic preparation.

Известен способ автоматической фокусировки (RU2389050, опубл. 10.05.2010 г.), который осуществляется следующим образом: A known method of automatic focusing (RU2389050, publ. 10.05.2010), which is carried out as follows:

- фокусирующее устройство перемещают в одно из крайних положений;- the focusing device is moved to one of the extreme positions;

- вычисляют параметр резкости для данного положения фокусирующего устройства при помощи проведения вейвлет анализа над множеством изображений;- calculate the sharpness parameter for a given position of the focusing device by performing wavelet analysis on a plurality of images;

- принимают вычисленное значение за предварительное максимальное значение резкости;- take the calculated value for the preliminary maximum sharpness value;

- перемещают фокусирующее устройство из одного крайнего положения в другое с заданным шагом;- move the focusing device from one extreme position to another with a given step;

- вычисляют параметр резкости для данного положения фокусирующего устройства;- calculate the sharpness parameter for a given position of the focusing device;

- вычисленное значение параметра резкости принимается за предварительное максимальное значение параметра резкости снимаемого изображения;- the calculated value of the sharpness parameter is taken as the preliminary maximum value of the sharpness parameter of the captured image;

- перемещают фокусирующее устройство из одного крайнего положения в другое пошагово для определения предварительного максимального значения параметра резкости;- move the focusing device from one extreme position to another step by step to determine the preliminary maximum value of the sharpness parameter;

- попарно сравнивают текущее значение параметра резкости снимаемого изображения с предварительным максимальным значением резкости;- comparing in pairs the current value of the sharpness parameter of the captured image with the preliminary maximum sharpness value;

- определяют максимальное значение параметра резкости за предзаданное количество этапов уточнения для чего перемещают фокусирующее устройство в положение, соответствующее предварительно максимальному значению параметра резкости; - determine the maximum value of the sharpness parameter for a predetermined number of stages of refinement, for which the focusing device is moved to a position corresponding to the previously maximum value of the sharpness parameter;

- перемещают фокусирующее устройство на шаг влево и вправо от предварительного максимального значения;- move the focusing device one step to the left and right of the preliminary maximum value;

- вычисляют текущее значение параметра резкости снимаемого изображения;- calculate the current value of the sharpness parameter of the captured image;

- сравнивают текущее значение параметра резкости с предварительно максимальным.- compare the current value of the sharpness parameter with the previously maximum.

Недостатком известного способа является необходимость перемещения фокусирующего устройства из одного крайнего положения в другое, что значительно увеличивает время, необходимое для проведения фокусировки. Еще одним недостатком является пошаговый характер выполнения движения, что отрицательно сказывается на скорости проведения фокусировки, а также оказывает дополнительную нагрузку на фокусирующее устройство, так как необходимо останавливать фокусирующее устройство на каждом шаге. Еще одним недостатком является необходимость производить уточняющие перемещение фокусирующего устройства, заключающиеся в передвижении фокусирующего устройства, после передвижения из одного крайнего положения в другое положение с наибольшим значением параметра резкости, и передвижение влево и вправо от него, что также увеличивает время, необходимое для проведения фокусировки. The disadvantage of the known method is the need to move the focusing device from one extreme position to another, which significantly increases the time required for focusing. Another disadvantage is the step-by-step nature of the movement, which adversely affects the speed of focusing, and also puts an additional burden on the focusing device, since it is necessary to stop the focusing device at each step. Another disadvantage is the need to perform refining movements of the focusing device, which consists in moving the focusing device, after moving from one extreme position to another position with the highest value of the sharpness parameter, and moving to the left and right of it, which also increases the time required for focusing.

Известен способ автоматической фокусировки (RU 2528582, опубл.20.09.2014 г.), который осуществляется следующим образом:A known method of automatic focusing (RU 2528582, publ. 20.09.2014), which is carried out as follows:

- пошагово сканируют зону фокусировки, при этом снимают характеристику изменения контраста (резкости) изображения;- step by step scanning the focus area, while removing the characteristics of changes in the contrast (sharpness) of the image;

- перемещают наблюдаемый объект в точку наилучшего контраста, которую определяют по результатам сравнения функции изменения контраста, полученной на первой фазе и текущего значения контраста.- move the observed object to the point of the best contrast, which is determined by the results of comparing the contrast change function obtained in the first phase and the current contrast value.

Недостатками данного способа являются необходимость сканирования всей зоны фокусировки, что увеличивает время, необходимое для проведения сканирования, а также пошаговый способ перемещения, что уменьшает ресурс механизма фокусировки и увеличивает время, необходимое для сканирования зоны фокусировки. Еще одним недостатком данного способа является необходимость возвращения объекта наблюдения в точку наилучшего контраста, что также увеличивает время сканирования. The disadvantages of this method are the need to scan the entire focus area, which increases the time required for scanning, as well as the step-by-step method of movement, which reduces the resource of the focusing mechanism and increases the time required to scan the focus area. Another disadvantage of this method is the need to return the object of observation to the point of the best contrast, which also increases the scanning time.

Наиболее близким аналогом к заявляемому изобретению является способ автофокусировки для микроскопа (US7027221B2, опубл.11.04.2006 г.). Микроскоп выполнен с возможностью обеспечивать относительное непрерывное движение между предметным столом и объективом и выполнять следующую последовательность действий: The closest analogue to the claimed invention is a method of autofocusing for a microscope (US7027221B2, publ.11.04.2006). The microscope is configured to provide a relatively continuous movement between the object table and the objective and perform the following sequence of actions:

a) получение изображения с камеры во время непрерывного движения по оси Z предметного стола относительно объектива;a) acquisition of an image from the camera during continuous movement along the Z-axis of the object table relative to the lens;

b) определение положения по оси Z, достигнутого в ходе относительного перемещения по оси Z, в котором было получено изображение с камеры;b) determining the position along the Z-axis, reached during the relative movement along the Z-axis, in which the image from the camera was received;

c) расчет значения контраста полученного изображения;c) calculating the contrast value of the resulting image;

d) запись положения по оси Z, достигнутого в ходе относительного перемещения по оси Z, совместно со значением контраста для данного положения;d) a record of the Z-axis position reached during the relative Z-axis movement, together with the contrast value for that position;

e) выполнение шагов a) – d) до тех пор, пока не будет достигнуто определенное конечное положение при движении по оси Z;e) executing steps a) to d) until a certain end position is reached when moving along the Z axis;

f) вычисление непрерывной функции контраста в зависимости от положений по оси Z, и присвоение значений контраста соответствующим положениям по оси Z;f) calculating a continuous function of contrast depending on the positions along the Z-axis, and assigning contrast values to the corresponding positions along the Z-axis;

g) расчёт, используя непрерывную функцию контраста, максимального значения контраста и соответствующего ему положения по оси Z;g) calculation, using a continuous function of contrast, of the maximum contrast value and its corresponding z-position;

h) перемещение в положение по оси Z, которому соответствует наибольшее значение контраста.h) moving to the position along the Z-axis, which corresponds to the largest contrast value.

Недостатком известного способа является невысокая скорость автофокусировки при работе с микроскопическими образцами за счет необходимости перемещения предметного стола микроскопа с препаратом в положение, соответствующее наибольшему значению резкости изображения, а также использование многоступенчатых математических преобразований для построения кривой зависимости резкости от положения предметного стола по оси Z. The disadvantage of the known method is the low speed of autofocusing when working with microscopic samples due to the need to move the microscope object table with the preparation to the position corresponding to the highest value of the image sharpness, as well as the use of multi-stage mathematical transformations to plot the curve of sharpness dependence on the position of the object table along the Z axis.

Так как одно поле зрения, получаемое на большом увеличении (например, 40х), имеет размеры порядка 300 х 200 мкм, и в зависимости от характера микроскопического препарата такие поля зрения могут исчисляться сотнями. Время, необходимое для автофокусировки каждого поля зрения значительно влияет на продолжительность всей процедуры оцифровки микроскопического препарата. В связи с этим сокращение времени, необходимого на автофокусировку, представляется одним из способов сокращения времени, необходимого на оцифровку всего микроскопического препарата. Since one field of view, obtained at a high magnification (for example, 40x), has dimensions of the order of 300 x 200 microns, and depending on the nature of the microscopic preparation, such fields of view can be in the hundreds. The time required for autofocusing of each field of view significantly affects the duration of the entire procedure for digitizing a microscopic preparation. In this regard, reducing the time required for autofocusing seems to be one of the ways to reduce the time required to digitize the entire microscopic preparation.

Техническая задача – сокращение времени, необходимого на автофокусировку и оцифровку микроскопического препарата. The technical task is to reduce the time required for autofocusing and digitization of a microscopic preparation.

Технический результат – повышение скорости проведения автофокусировки при работе с микроскопическими образцами за счет отсутствия необходимости перемещения предметного стола микроскопа в положение, соответствующее наибольшему значению резкости изображения микроскопического препарата.The technical result is an increase in the speed of autofocusing when working with microscopic samples due to the absence of the need to move the microscope object table to the position corresponding to the highest value of the image sharpness of the microscopic preparation.

Технический результат достигается тем, что в способе автофокусировки при оцифровке микроскопического препарата, включающем перемещение предметного стола микроскопа по вертикальной оси Z в положение, соответствующее максимальному значению резкости изображения образца микроскопического препарата, согласно изобретению, автофокусировку осуществляют в два этапа. Первый этап включает непрерывное перемещение предметного стола с образцом вдоль оси Z в направлении к объективу микроскопа на максимальной скорости (так называемый «рывок») на заданную величину, далее осуществляют непрерывное перемещение предметного стола от объектива с заданной скоростью с одновременным получением изображений, передачей их на персональный компьютер (ПК), расчет резкости S получаемых изображений, присвоение координат предметного стола по оси Z и вычисленных значений резкости полученным изображениям в процессе перемещения предметного стола. При этом полученное изображение в цветовой модели RGB преобразовывают в цветовую модель YUV и производят расчет резкости S каждого изображения по формуле:The technical result is achieved by the fact that in the method of autofocusing when digitizing a microscopic preparation, including moving the microscope object table along the vertical Z axis to a position corresponding to the maximum value of the image sharpness of the sample of the microscopic preparation, according to the invention, autofocusing is carried out in two stages. The first stage includes continuous movement of the object table with the sample along the Z axis towards the microscope lens at maximum speed (the so-called "jerk") by a predetermined value, then the object table is continuously moved away from the lens at a predetermined speed with simultaneous acquisition of images, their transmission to personal computer (PC), calculation of the sharpness S of the obtained images, assignment of object table coordinates along the Z axis and calculated sharpness values to the obtained images in the process of moving the object table. In this case, the resulting image in the RGB color model is converted into the YUV color model and the sharpness S of each image is calculated using the formula:

Figure 00000001
Figure 00000001

где Where

Figure 00000002
– порядковый номер текущего пикселя изображения по горизонтали,
Figure 00000002
– serial number of the current image pixel horizontally,

Figure 00000003
– порядковый номер текущего пикселя изображения по вертикали,
Figure 00000004
Figure 00000003
– serial number of the current pixel of the image along the vertical,
Figure 00000004

Y – значение яркостного компонента пикселя изображения в цветовой модели YUV;Y is the value of the brightness component of the image pixel in the YUV color model;

Figure 00000005
– разность значений яркостного компонента соседних пикселей по горизонтали,
Figure 00000005
is the difference between the values of the brightness component of adjacent pixels horizontally,

Figure 00000006
- разность значение яркостного компонента соседних пикселей по вертикали,
Figure 00000006
- difference value of the brightness component of adjacent pixels vertically,

Figure 00000007
– количество пикселей по горизонтали,
Figure 00000007
- the number of pixels in the horizontal direction,

Figure 00000008
- количество пикселей по вертикали.
Figure 00000008
- number of vertical pixels.

В память ПК отправляют значения резкости S и координаты по оси Z для всех изображений, фиксируют сфокусированное изображение посредством выбора координаты предметного стола с образцом на оси Z, удовлетворяющей условию, при котором во время прохождения предметным столом заданного диапазона по оси Z на трех изображениях подряд резкость снижается перед «пиком» резкости и после «пика» резкости. Причем при выполнения указанного условия первый этап автофокусировки считают завершенным, и перемещение предметного стола с образцом останавливают, не доезжая до конца заданного диапазона, а при невыполнении указанного условия осуществляют второй этап с увеличенными диапазоном фокусировки, скоростью перемещения предметного стола и заданным расстоянием ( величиной «рывка») до получения сфокусированного изображения, одновременно выполняя расчет резкости изображений, при этом второй этап осуществляют до тех пор, пока не будет выполнено указанное условие. The sharpness values S and coordinates along the Z axis for all images are sent to the PC memory, the focused image is fixed by selecting the coordinates of the object table with the sample on the Z axis, which satisfies the condition under which, during the passage of the object table through the specified range along the Z axis on three images in a row, sharpness decreases before the “peak” of sharpness and after the “peak” of sharpness. Moreover, if the specified condition is met, the first stage of autofocusing is considered complete, and the movement of the object table with the sample is stopped before reaching the end of the specified range, and if the specified condition is not met, the second stage is carried out with an increased focusing range, the speed of movement of the object table and a given distance ”) until a focused image is obtained, while simultaneously performing the calculation of the sharpness of the images, while the second stage is carried out until the specified condition is met.

Изобретение проиллюстрировано следующими фигурами. The invention is illustrated by the following figures.

Фиг. 1. Схематичное представление «пика» резкости Smax.Fig. 1. Schematic representation of the "peak" sharpness S max .

Фиг. 2. Схематичное представление незначительного изменения резкости.Fig. 2. Schematic representation of a slight change in sharpness.

Фиг. 3. Возрастание резкости при прохождении диапазона фокусировки.Fig. 3. Increasing sharpness when passing through the focus range.

Фиг. 4. Схематичное представление уменьшения резкости.Fig. 4. Schematic representation of sharpening.

Фиг. 5. График движения предметного стола (а) и график резкости получаемых изображений (б) при проведении первого этапа фокусировки.Fig. Fig. 5. Graph of the movement of the object table (a) and graph of the sharpness of the obtained images (b) during the first stage of focusing.

Фиг. 6. График движения предметного стола (а) и график резкости получаемых изображений (б) при проведении первого и второго этапов фокусировки.Fig. Fig. 6. Graph of the movement of the object table (a) and graph of the sharpness of the obtained images (b) during the first and second stages of focusing.

Способ осуществляется следующим образом. The method is carried out as follows.

На предметный стол устанавливают микроскопический препарат и запускают процедуру автофокусировки. A microscopic preparation is placed on the object table and the autofocusing procedure is started.

Первый этапFirst stage

Предметный стол начинает движение вверх, т.е. по направлению к объективу цифровой камеры с максимально возможной скоростью V l , с которой позволяет передвигаться предметному столу его механизация. Предметный стол «проезжает» вверх на заранее определенное значение «рывка» -

Figure 00000009
. В данный момент цифровая камера, подключенная к микроскопу, не отправляет получаемые изображения на ПК на анализ с целью определения резкости S изображений, соответственно в этот момент отсутствует обратная связь между получаемым изображением и движением предметного стола.The object table starts moving upwards, i.e. towards the lens of a digital camera with the maximum possible speed V l , with which its mechanization allows the object table to move. The object table "drives" up by a predetermined value of "jerk" -
Figure 00000009
. At the moment, the digital camera connected to the microscope does not send the received images to the PC for analysis in order to determine the sharpness S of the images, respectively, at this moment there is no feedback between the received image and the movement of the object table.

Затем предметный стол начинает движение от объектива, т.е. вниз по оси

Figure 00000010
на длину заранее выбранного диапазона фокусировки
Figure 00000011
или до момента получения сфокусированного изображения.Then the object table starts moving away from the lens, i.e. down axis
Figure 00000010
by the length of a preselected focus range
Figure 00000011
or until a focused image is obtained.

В качестве сфокусированного изображения принимается изображение с наиболее высоким значением резкости. The image with the highest sharpness value is taken as the in-focus image.

Во время непрерывного движения вниз от объектива камера, соединенная с микроскопом посредством фотографического тубуса, снимает изображение и отправляет их на ПК с целью определения резкости S каждого полученного кадра. During a continuous downward movement from the lens, the camera connected to the microscope through a photographic tube takes an image and sends them to a PC in order to determine the sharpness S of each received frame.

Количество получаемых изображений в секунду зависит от характеристик используемой камеры. Скорость обновления кадров камеры и скорость движения предметного стола должны быть таковыми, чтобы обеспечить расстояние между двумя смежными изображениями, не превышающее значения глубины резкости используемой оптической системы. The number of images taken per second depends on the characteristics of the camera used. The frame refresh rate of the camera and the speed of movement of the object table must be such that the distance between two adjacent images does not exceed the value of the depth of field of the optical system used.

Во время непрерывного движения вниз производят анализ получаемых изображений с камеры с целью расчета резкости S изображения. Для расчета резкости изображения S вычисляют сумму квадратов разностей соседних пикселей по вертикали и горизонтали. Для этого применяют цветовую модель YUV (компонента Y). Для преобразования компонентов цветовой модели RGB в цветовую модель YUV используют следующую формулу для каждого изображения:During a continuous downward movement, the received images from the camera are analyzed in order to calculate the sharpness S of the image. To calculate the sharpness of the image S, the sum of the squared differences of adjacent pixels vertically and horizontally is calculated. For this, the YUV (Y component) color model is used. To convert the components of the RGB color model to the YUV color model, use the following formula for each image:

Figure 00000012
Figure 00000012

В полученном цветом пространстве YUV используют компоненту Y, т.е. яркость изображения. In the resulting YUV color space, the Y component is used, i.e. image brightness.

Резкость рассчитывают, как квадратный корень от суммы квадратов разностей соседних пикселей по горизонтали и вертикали: Sharpness is calculated as the square root of the sum of the squared differences of adjacent pixels horizontally and vertically:

Figure 00000013
(1)
Figure 00000013
(1)

где Where

Figure 00000002
– порядковый номер текущего пикселя изображения по горизонтали,
Figure 00000002
– serial number of the current image pixel horizontally,

Figure 00000003
– порядковый номер текущего пикселя изображения по вертикали,
Figure 00000004
Figure 00000003
– serial number of the current pixel of the image along the vertical,
Figure 00000004

Y – значение яркостного компонента пикселя изображения в цветовой модели YUV;Y is the value of the brightness component of the image pixel in the YUV color model;

Figure 00000005
– разность значений яркостного компонента соседних пикселей по горизонтали,
Figure 00000005
is the difference between the values of the brightness component of adjacent pixels horizontally,

Figure 00000006
- разность значение яркостного компонента соседних пикселей по вертикали,
Figure 00000006
- difference value of the brightness component of adjacent pixels vertically,

Figure 00000007
– количество пикселей по горизонтали,
Figure 00000007
- the number of pixels in the horizontal direction,

Figure 00000008
- количество пикселей по вертикали.
Figure 00000008
- number of vertical pixels.

В способе- прототипе использован иной, сложный и многоступенчатый алгоритм обработки изображений, согласно которому изображение получают в серых тонах (изображение черно-белое), затем его преобразуют с помощью оператора в так называемое градиентное изображение. Из градиентного изображения получают величину K, которое представляет собой значение контраста каждого изображения. K получают определением низкочастотного распределения в черно-белом изображении, которое сохраняется как массив H[1,2….N] , и считают по формуле ,представленной в описании прототипа. На основе значений K строят график зависимости величины K от положения по оси Z (фиг.7 прототипа). Для того, чтобы сделать график непрерывным, дополнительно проводят интерполяцию значений по формуле Лагранжа (формула 5 прототипа). In the prototype method, a different, complex and multi-stage image processing algorithm is used, according to which the image is obtained in gray tones (black and white image), then it is converted using an operator into the so-called gradient image. From the gradient image, a K value is obtained, which is the contrast value of each image. K is obtained by determining the low-frequency distribution in a black and white image, which is stored as an array H[1,2….N] , and calculated according to the formula presented in the description of the prototype. Based on the values of K build a graph of the value of K from the position along the Z-axis (figure 7 of the prototype). In order to make the graph continuous, the values are additionally interpolated using the Lagrange formula (formula 5 of the prototype).

В заявляемом способе обработки изображений преследуют ту же цель, которая заключается в получении зависимости значения резкости для построение кривой резкости от положения по оси Z. Однако, в заявляемом способе количество математических манипуляций с изображением гораздо меньше, что также позволяет производить расчет в реальном времени. Однако в прототипе используется камера, снимающая 25 кадров в секунду, в то время как в заявляемом способе используется камера, снимающая 75 и более кадров в секунду. Это значит, что количество изображений, поступающих на анализ в три и более раза больше, и расчет необходимо производить гораздо быстрее. In the claimed method of image processing, the same goal is pursued, which is to obtain the dependence of the sharpness value for constructing a sharpness curve on the position along the Z axis. However, in the claimed method, the number of mathematical manipulations with the image is much less, which also allows real-time calculation. However, the prototype uses a camera that shoots 25 frames per second, while the claimed method uses a camera that shoots 75 or more frames per second. This means that the number of images received for analysis is three or more times greater, and the calculation must be done much faster.

Во время процесса автофокусировки для всех полученных изображений память ПК сохраняет их значения резкости S и координаты по оси Z, на которых они были получены, и хранит до завершения автофокусировки.During the autofocusing process, for all acquired images, the PC memory stores their sharpness S values and the Z-coordinates at which they were acquired, and stores them until autofocusing is completed.

На первых полученных изображениях ожидается, что резкость

Figure 00000014
будет постоянно увеличиваться, так как был сделан «рывок» на значительное расстояние
Figure 00000009
. от возможного сфокусированного изображения. После того, как сфокусированное изображение будет достигнуто, резкость дальнейших проанализированных изображений будет уменьшаться. Таким образом, точка фокусировки – это координата по оси Z, при которой достигается сфокусированное изображение, она находится на «пике» резкости, т.е. в точке, после прохождения которой первоначальное увеличение значений резкости S изменится в сторону уменьшения.In the first images acquired, it is expected that the sharpness
Figure 00000014
will constantly increase, as a "jerk" has been made for a considerable distance
Figure 00000009
. from a possible in-focus image. Once the in-focus image is reached, the sharpness of further analyzed images will decrease. Thus, the focus point is the Z-coordinate at which a focused image is achieved, it is at the "peak" of sharpness, i.e. at the point after which the initial increase in sharpness values S will change downward.

Для того, чтобы исключить цифровой шум, при подсчете увеличения или уменьшения резкости в получаемых изображениях, в качестве изменения в большую или меньшую сторону считают изменение, превышающее 0,5% значения резкости текущего кадра от предыдущего. Также в процессе фокусировки могут возникать ложные «пики» резкости, когда резкость увеличивается в связи с попавшей в зону фокуса пылью, разводами на покровном стекле или другими артефактами. При ложных «пиках» резкость будет уменьшаться не более двух раз подряд, так как предметный стол будет приближаться к зоне сфокусированного изображения препарата, и резкость начнет возрастать. Таким образом, за «пик» резкости следует принимать только тот, при котором после увеличения резкости на трех изображениях наблюдалось уменьшение резкости на трех изображениях подряд. In order to eliminate digital noise, when calculating the increase or decrease in sharpness in the resulting images, a change, up or down, is considered to be a change that exceeds 0.5% of the sharpness value of the current frame from the previous one. Also, during focusing, false “peaks” of sharpness can occur, when sharpness is increased due to dust that has fallen into the focus area, stains on the coverslip, or other artifacts. With false “peaks”, the sharpness will decrease no more than twice in a row, since the object table will approach the area of the focused image of the preparation, and the sharpness will begin to increase. Thus, the “peak” of sharpness should be taken only as the one at which, after sharpening in three images, a decrease in sharpness was observed in three images in a row.

Далее необходимо следить за выполнением следующих условий: Next, you need to follow the following conditions:

Условие 1. Значение резкости S уменьшалось на трех изображениях подряд и во время прохождения диапазона было увеличение резкости в количестве трёх раз (фиг. 1). Условие 1 позволяет определить, что автофокусировка успешно выполнена, если значение резкости уменьшалось более трех раз подряд, и за все время движение предметного стола наблюдалось увеличение резкости три раза, то наиболее резкое изображение берется как сфокусированное изображение. Если данное условие выполняется, то первый этап фокусировки считается выполненным, и предметный стол, не доезжая до конца заданного диапазона фокусировки останавливает движение для завершения процесса автофокусировки. Condition 1. The value of sharpness S decreased on three images in a row and during the passage of the range there was an increase in sharpness in the amount of three times (Fig. 1). Condition 1 allows you to determine that autofocusing is successful, if the sharpness value has been reduced more than three times in a row, and there has been an increase in sharpness three times during the entire movement of the stage, then the sharpest image is taken as the in-focus image. If this condition is met, then the first stage of focusing is considered completed, and the object table, before reaching the end of the specified focusing range, stops moving to complete the autofocusing process.

Условие 2. Значение резкости уменьшалось на трех изображениях подряд и во время прохождения диапазона не наблюдалось увеличения резкости в количестве трёх раз (фиг. 4). Условие 2 позволяет определить, что не был достигнут «пик» резкости, то есть движение предметного стола осуществлялось в направлении, противоположном от самого резкого изображения. При выполнении этого условия первый раз первый этап необходимо повторить в обратную сторону. Если условие 2 выполняется второй раз за процесс автофокусировки, то первый этап считается не выполненным. Condition 2. The value of sharpness decreased on three images in a row and during the passage of the range there was no increase in sharpness in the amount of three times (Fig. 4). Condition 2 allows you to determine that the “peak” of sharpness was not reached, that is, the movement of the object table was carried out in the opposite direction from the sharpest image. When this condition is met for the first time, the first step must be repeated in the opposite direction. If condition 2 is met for the second time during the autofocus process, then the first stage is considered not fulfilled.

Условие 3. Значение резкости не изменялось на двадцати изображениях подряд (фиг. 2). Условие 3 позволяет определить, что предметное стекло с препаратом отсутствует. При выполнении этого условия первый этап считается не выполненным.Condition 3. The value of sharpness did not change on twenty images in a row (Fig. 2). Condition 3 allows you to determine that the glass slide with the preparation is missing. If this condition is met, the first stage is considered not fulfilled.

Условие 4. Пройден весь указанный диапазон и не выполнено ни одно из вышеприведенных условий 1,2,3 (фиг.3). Условие позволяет определить, что предметное стекло с препаратом находится на расстоянии от объектива, большем чем заданный диапазон. При выполнении этого условия первый, второй или третий раз выполняется повторная фокусировка из точки с наибольшей резкостью. Если за три повторных фокусировки не был выявлен «пик» резкости, то первый этап считается не выполненным.Condition 4. Passed the entire specified range and not met any of the above conditions 1,2,3 (figure 3). The condition allows you to determine that the slide with the preparation is at a distance from the lens that is greater than the specified range. When this condition is met, the focus is refocused from the sharpest point for the first, second, or third time. If the “peak” of sharpness was not detected after three repeated focusings, then the first stage is considered not completed.

При необходимости, даже при успешном проведении первого этапа, его можно повторить. Это может потребоваться для исключения ошибок, связанных с внешними факторами, например, с вибрацией основания, на котором стоит микроскопическая система, или непреднамеренным воздействием на предметный стол. Таким образом исключается получение ложно сфокусированного изображения и увеличивается надежность работы способа. If necessary, even if the first stage is successfully carried out, it can be repeated. This may be necessary to eliminate errors due to external factors, such as vibration of the base on which the microscope system rests, or unintentional impact on the stage. Thus, obtaining a falsely focused image is excluded and the reliability of the method is increased.

Второй этапSecond phase

Второй этап автофокусировки (далее длинный фокус) характеризуется увеличенным диапазоном фокусировки, повышенной скоростью перемещения предметного стола V l , а также длиной начального «рывка» J l . Второй этап фокусировки выполняют в том случае, если не было выполнено условие 1 в рамках прохождения первого этапа и сфокусированное изображение не было получено. The second stage of autofocusing (hereinafter referred to as long focus) is characterized by an increased focusing range, an increased speed of movement of the object table V l , and also the length of the initial "jerk" J l . The second focusing step is performed if condition 1 was not met within the framework of the first step and a focused image was not obtained.

Второй этап фокусировки начинается с «рывка» по направлению к объективу с максимально возможной скоростью V l на заранее определенное расстояние

Figure 00000009
, которое превышает значение «рывка» на первом этапе. Диапазон длинного фокуса
Figure 00000011
превышает диапазон на первом этапе. После «рывка» в режиме длинного фокуса предметный стол начинает движение навстречу объективу со скоростью
Figure 00000015
, превышающую скорость движение на 1 этапе, до получения сфокусированного изображения, или на длину, соответствующую диапазону длинного фокуса, и одновременно осуществляют анализ резкости полученных изображений.The second stage of focusing begins with a “jerk” towards the lens at the maximum possible speed V l for a predetermined distance
Figure 00000009
, which exceeds the value of "jerk" at the first stage. Long focus range
Figure 00000011
exceeds the range at the first stage. After a “jerk” in the long focus mode, the object table begins to move towards the lens at a speed
Figure 00000015
, exceeding the speed of movement at 1 stage, until a focused image is obtained, or by a length corresponding to the range of a long focus, and at the same time the analysis of the sharpness of the obtained images is carried out.

На втором этапе движение предметного стола происходит до тех пор, пока не будет выполнено одно из условий 1-4 прописанных ранее.At the second stage, the movement of the object table occurs until one of the conditions 1-4 prescribed earlier is met.

При выполнении условий 2, 3, 4 автофокусировка второго этапа считается неуспешной. When conditions 2, 3, 4 are met, autofocusing of the second stage is considered unsuccessful.

При выполнении условия 1 автофокусировка второго этапа считается успешной. Выполнение каждого из вышеприведенных условий определяет дальнейшее проведение автофокусировки. When condition 1 is met, autofocusing of the second stage is considered successful. The fulfillment of each of the above conditions determines the further performance of autofocus.

При проведении второго этапа расстояние между изображениями, которое получает камера во время непрерывного движения, больше, чем при фокусировке в рамках первого этапа в связи с более высокой скоростью движения предметного стола. В таком случае, наиболее сфокусированное изображение может оказаться в позиции по оси Z, находящейся между двумя смежными кадрами. Тогда для повышения качества сфокусированного изображения необходимо выполнить автофокусировку в рамках первого этапа, взяв в качестве отправной точки позицию по оси Z наиболее резкого изображения, полученного в рамках второго этапа. During the second stage, the distance between images that the camera receives during continuous movement is greater than when focusing within the first stage due to the higher speed of the object table. In such a case, the most focused image may be at a z-axis position between two adjacent frames. Then, in order to improve the quality of the focused image, it is necessary to autofocus within the first stage, taking as a starting point the position along the Z axis of the sharpest image obtained in the second stage.

Если в рамках первого этапа выполнено условие 1, то автофокусировка считается успешной. Если автофокусировка выполнялась для сканирования микроскопического препарата, то при переходе на следующее поле зрение одновременно с движением по осям X и Y, предметный стол перемещают в положение по оси Z, которому было присвоено максимальное значение резкости на предыдущем поле зрения. Это делается для того, чтобы сэкономить время, так как смежные поля зрения, вероятнее всего, будут иметь сфокусированное изображение на близких по оси Z координатах. При этом изображение, которое обладает наибольшим значением резкости, используют для получение оцифрованного микроскопического препарата или его выдают на монитор для проведения дальнейшего анализа врачом клинической лабораторной диагностики. If condition 1 is met in the first stage, then autofocus is considered successful. If autofocusing was performed to scan a microscopic preparation, then when moving to the next field of view simultaneously with movement along the X and Y axes, the object table is moved to the position along the Z axis, which was assigned the maximum sharpness value in the previous field of view. This is done to save time, since adjacent fields of view are more likely to have a focused image at close z-coordinates. In this case, the image that has the highest sharpness value is used to obtain a digitized microscopic preparation or it is displayed on a monitor for further analysis by a clinical laboratory diagnostics doctor.

Пример 1 осуществления способа.Example 1 of the implementation of the method.

Для осуществления данного способа был использован коммерчески доступный микроскоп фирмы Zeiss, оснащенный механизированным предметным столом, объективом с кратностью 10х и цифровой камерой Luminera Lt345R, способной снимать 75 кадров в секунду и подключенной к персональному компьютеру (ПК) с установленным программным обеспечением семейства Vision от компании West Medica. To implement this method, a commercially available Zeiss microscope was used, equipped with a mechanized object table, a 10x objective and a Luminera Lt345R digital camera capable of shooting 75 frames per second and connected to a personal computer (PC) with installed software of the Vision family from West Medica.

Предметное стекло с нанесенным на него мазком периферийной крови было помещено на автоматизированный предметный стол микроскопа. Затем была запущена процедура автофокусировки. Осуществлялась запись начальных координат предметного стола. В рамках первого этапа предметный стол совершал «рывок» в направлении к объективу со скоростью V l =12 мм/с на расстояние J l . =20 мкм. После чего предметный стол начинал непрерывное движение от объектива со скоростью 77 мкм/с, одновременно цифровая камера отправляла кадры изображений на анализ на ПК для определения значения резкости S каждого кадра, расчет резкости осуществляли по формуле (1). Диапазон фокусировки составил 50 мкм. После прохождения в первом направлении и не выполнив условие 1, то есть, не получив наиболее резкое изображение, предметный стол начинал движение в противоположную сторону в соответствии с условием 2. A glass slide with a smear of peripheral blood applied to it was placed on an automated microscope stage. Then the autofocus procedure was started. The initial coordinates of the object table were recorded. As part of the first stage, the object table made a “jerk” towards the lens at a speed V l =12 mm/s to a distance J l . =20 µm. After that, the object table began to move continuously from the lens at a speed of 77 μm/s, at the same time, the digital camera sent image frames for analysis on a PC to determine the sharpness value S of each frame, the sharpness calculation was carried out according to formula (1). The focusing range was 50 µm. After passing in the first direction and not fulfilling condition 1, that is, without obtaining the sharpest image, the object table began to move in the opposite direction in accordance with condition 2.

В противоположную сторону предметный стол двигался до тех пор, пока ПК не получил сфокусированное изображение. Так как резкость S росла достаточно быстро, то есть условие 3 не было выполнено, то переход на длинный фокус не произошел, и в рамках первого этапа было получено сфокусированное изображение. Автофокусировка считалась завершенной. Время автофокусировки на одном поле зрения при использовании первого этапа составило примерно 0,52 секунды. The object table moved in the opposite direction until the PC received a focused image. Since the sharpness S grew rather quickly, that is, condition 3 was not met, the transition to a long focus did not occur, and a focused image was obtained within the first stage. Autofocus was considered complete. AF time per field of view using the first stage was approximately 0.52 seconds.

График движения предметного стола и график резкости представлены на фиг. 5 (а, б) по примеру 1.The object table motion graph and the sharpness graph are shown in Fig. 5 (a, b) according to example 1.

Пример 2 осуществления способа.Example 2 of the implementation of the method.

Предметное стекло с нанесенным на него мазком периферийной крови было помещено на автоматизированный предметный стол микроскопа. Затем была запущена процедура автофокусировки. Осуществляли запись начальных координат предметного стола. В рамках первого этапа предметный стол совершал «рывок» в направлении к объективу со скоростью V l =12 мм/с на расстояние J l . = 20 мкм. После чего предметный стол начинал непрерывное движение от объектива со скоростью 77 мкм/с, одновременно цифровая камера отправляла кадры изображений на анализ на ПК для определения значения резкости каждого кадра с использованием формулы (1). Диапазон фокусировки составил 50 мкм. A glass slide with a smear of peripheral blood applied to it was placed on an automated microscope stage. Then the autofocus procedure was started. The initial coordinates of the object table were recorded. As part of the first stage, the object table made a “jerk” towards the lens at a speed V l =12 mm/s to a distance J l . = 20 µm. After that, the object table began to move continuously from the lens at a speed of 77 µm/s, at the same time, the digital camera sent image frames for analysis on a PC to determine the sharpness value of each frame using formula (1). The focusing range was 50 µm.

После прохождения в первом направлении, не получив наиболее резкое изображение, и не выполнив условие 1, предметный стол начал движение в противоположную сторону в соответствии с условием 2. После прохождение диапазона в обратном направлении и также без выполнения условие 1, произошел переход на второй этап фокусировки. After passing in the first direction, without obtaining the sharpest image, and without fulfilling condition 1, the object table began to move in the opposite direction in accordance with condition 2. After passing the range in the opposite direction and also without fulfilling condition 1, a transition to the second stage of focusing occurred .

Стол возвращался в начальное положение. Затем стол совершал «рывок» по направлению к объективу со скоростью V l =12 мм/с на расстояние J l . = 150 мкм. После чего начинал движение от объектива со скоростью 350 мкм/с. Получив наиболее резкое изображение и тем самым выполнив условие 1, предметный стол перемещался в положение, в котором было получено наиболее резкое изображение для повторения этапа 1. Время автофокусировки на одном поле зрения составило примерно 3,5 с. The table returned to its original position. Then the table made a "jerk" towards the lens at a speed V l =12 mm/s to a distance J l . = 150 µm. After that, it started moving away from the lens at a speed of 350 µm/s. After obtaining the sharpest image and thus fulfilling condition 1, the stage was moved to the position where the sharpest image was obtained to repeat step 1. The autofocus time per field of view was approximately 3.5 s.

На фиг. 6 (а, б) представлены график движения стола и график резкости, полученные при осуществлении вышеуказанного способа по примеру 2. In FIG. 6 (a, b) shows the table movement graph and the sharpness graph obtained by implementing the above method according to example 2.

Claims (11)

Способ автофокусировки при оцифровке микроскопического препарата, включающий перемещение предметного стола микроскопа по вертикальной оси Z в положение, соответствующее максимальному значению резкости изображения образца микроскопического препарата, отличающийся тем, что автофокусировку осуществляют в два этапа, первый этап включает непрерывное перемещение предметного стола с образцом вдоль оси Z в направлении к объективу микроскопа на максимальной скорости на заданную величину, далее осуществляют непрерывное перемещение предметного стола от объектива с заданной скоростью с одновременным получением изображений, передачей их на персональный компьютер, расчет резкости S получаемых изображений, присвоение координат предметного стола по оси Z и вычисленных значений резкости полученным изображениям в процессе перемещения предметного стола, при этом полученное изображение в цветовой модели RGB преобразовывают в цветовую модель YUV и производят расчет резкости S каждого изображения по формуле:A method for autofocusing when digitizing a microscopic preparation, which includes moving the microscope object table along the vertical Z axis to a position corresponding to the maximum image sharpness of the sample of the microscopic preparation, characterized in that autofocusing is carried out in two stages, the first stage includes continuous movement of the object table with the sample along the Z axis in the direction of the microscope lens at a maximum speed by a given value, then the object table is continuously moved from the lens at a given speed with simultaneous acquisition of images, transferring them to a personal computer, calculating the sharpness S of the images obtained, assigning the coordinates of the object table along the Z axis and the calculated values sharpness of the obtained images in the process of moving the subject table, while the resulting image in the RGB color model is converted into the YUV color model and the sharpness S of each image is calculated according to the formula:
Figure 00000016
,
Figure 00000016
,
где Where
Figure 00000017
– порядковый номер текущего пикселя изображения по горизонтали,
Figure 00000017
– serial number of the current image pixel horizontally,
Figure 00000018
– порядковый номер текущего пикселя изображения по вертикали,
Figure 00000019
Figure 00000018
– serial number of the current pixel of the image along the vertical,
Figure 00000019
Y – значение яркостного компонента пикселя изображения в цветовой модели YUV,Y is the value of the brightness component of the image pixel in the YUV color model,
Figure 00000020
– разность значений яркостного компонента соседних пикселей по горизонтали,
Figure 00000020
is the difference between the values of the brightness component of adjacent pixels horizontally,
Figure 00000021
- разность значений яркостного компонента соседних пикселей по вертикали,
Figure 00000021
- the difference between the values of the brightness component of neighboring pixels along the vertical,
n - количество пикселей по горизонтали,n - number of horizontal pixels, m - количество пикселей по вертикали,m - the number of vertical pixels, в память персонального компьютера отправляют значения резкости S и координаты по оси Z для всех изображений, фиксируют сфокусированное изображение посредством выбора координаты предметного стола с образцом на оси Z, удовлетворяющей условию, при котором во время прохождения предметным столом заданного диапазона по оси Z на трех изображениях подряд резкость снижается перед «пиком» резкости и после «пика» резкости, причем при выполнении указанного условия первый этап автофокусировки считают завершенным, и перемещение предметного стола с образцом останавливают, не доезжая до конца заданного диапазона, а при невыполнении указанного условия осуществляют второй этап с увеличенными диапазоном фокусировки, скоростью перемещения предметного стола и заданным расстоянием до получения сфокусированного изображения, одновременно выполняя расчет резкости изображений, при этом второй этап осуществляют до тех пор, пока не будет выполнено указанное условие.sharpness values S and coordinates along the Z axis for all images are sent to the memory of the personal computer, the focused image is fixed by selecting the coordinates of the object table with the sample on the Z axis, satisfying the condition under which during the passage of the object table of the specified range along the Z axis on three images in a row sharpness decreases before the “peak” of sharpness and after the “peak” of sharpness, and if the specified condition is met, the first stage of autofocusing is considered completed, and the movement of the object table with the sample is stopped before reaching the end of the specified range, and if the specified condition is not met, the second stage is carried out with increased focusing range, the speed of movement of the object table and a given distance to obtain a focused image, while calculating the sharpness of the images, while the second stage is carried out until the specified condition is met.
RU2022120594A 2022-07-27 Autofocus method for digitizing a microscopic preparation RU2794050C1 (en)

Publications (1)

Publication Number Publication Date
RU2794050C1 true RU2794050C1 (en) 2023-04-11

Family

ID=

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2522123C2 (en) * 2009-04-13 2014-07-10 Дженерал Электрик Компани System and method for enhanced predictive autofocusing
JP2019061023A (en) * 2017-09-26 2019-04-18 株式会社Jvcケンウッド Imaging apparatus
WO2022032126A1 (en) * 2020-08-07 2022-02-10 Nanotronics Imaging, Inc. Deep learning model for auto-focusing microscope systems

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2522123C2 (en) * 2009-04-13 2014-07-10 Дженерал Электрик Компани System and method for enhanced predictive autofocusing
JP2019061023A (en) * 2017-09-26 2019-04-18 株式会社Jvcケンウッド Imaging apparatus
WO2022032126A1 (en) * 2020-08-07 2022-02-10 Nanotronics Imaging, Inc. Deep learning model for auto-focusing microscope systems

Similar Documents

Publication Publication Date Title
EP1336888B1 (en) Microscopy imaging system and data acquisition method
US6816606B2 (en) Method for maintaining high-quality focus during high-throughput, microscopic digital montage imaging
US7155049B2 (en) System for creating microscopic digital montage images
CN109085113B (en) Automatic focusing method and device for cervical exfoliated cell detection device
US20190268573A1 (en) Digital microscope apparatus for reimaging blurry portion based on edge detection
RU2734447C2 (en) System for forming a synthesized two-dimensional image of a biological sample with high depth of field
US10613313B2 (en) Microscopy system, microscopy method, and computer-readable recording medium
JP2003315684A (en) Automatic focusing method of microscope and focusing device for microscope
JP2016125913A (en) Image acquisition device and control method of image acquisition device
CN114785959B (en) Automatic focusing method and device for fluorescence microscope, storage medium and electronic equipment
US11209637B2 (en) Observation device, observation control method, and observation control program that control acceleration of a moveable stage having an installed subject vessel
JP2006293219A (en) Scanning type confocal microscope and method of measuring sample information
US10721413B2 (en) Microscopy system, microscopy method, and computer readable recording medium
US10429632B2 (en) Microscopy system, microscopy method, and computer-readable recording medium
RU2794050C1 (en) Autofocus method for digitizing a microscopic preparation
CN111474103A (en) Automatic focusing scanning method and system for bone marrow cell glass slide
JPH09196621A (en) Focal plane detection method and image input/output device
CN117233921A (en) Automatic focusing method for fluorescent imaging equipment
CN114785953B (en) SFR-based camera automatic focusing method and device
US11256078B2 (en) Continuous scanning for localization microscopy
CN114815211A (en) Microscope automatic focusing method and system based on image processing
CN112053304A (en) Rapid focusing restoration method for single shooting of full-slice digital imaging
RU2785199C1 (en) Method for scanning a cervical preparation prepared by liquid cytology method
CN112070887A (en) Depth learning-based full-slice digital imaging depth of field extension method
JP2015102694A (en) Alignment device, microscopic system, alignment method, and alignment program