Micro-operation automatic focusing method and system based on variance combined hill-climbing search method

文档序号:1295574 发布日期:2020-08-07 浏览:17次 中文

阅读说明:本技术 基于方差结合爬山搜索法的显微操作自动聚焦方法及系统 (Micro-operation automatic focusing method and system based on variance combined hill-climbing search method ) 是由 于兴虎 于 2020-04-15 设计创作,主要内容包括:本发明公开了一种基于方差结合爬山搜索法的显微操作自动聚焦方法及系统。该方法包括:将显微图像转为灰度图像;根据灰度图像的灰度值计算方差;将方差确定为聚焦值;根据聚焦值、当前物镜位置以及上一次物镜位置,采用爬山搜素方法确定下一次物镜位置;根据物镜初始移动距离和相邻两次物镜移动位置是否相反判断是否完成聚焦;若完成聚焦,则自动聚焦结束;若未完成聚焦,则将物镜移动至下一次物镜位置,返回步骤“获取显微图像、当前物镜位置以及上一次物镜位置”。采用本发明的方法及系统,利用方差作为清晰度评价标准,计算量较小,结合爬山搜索方法,在保证准确聚焦的前提下,提高了效率的同时对噪声敏感度较低,稳定性高。(The invention discloses a micromanipulation automatic focusing method and system based on variance combined with a hill climbing search method. The method comprises the following steps: converting the microscopic image into a gray image; calculating variance according to the gray value of the gray image; determining the variance as a focus value; determining the position of the objective lens at the next time by adopting a hill climbing search method according to the focusing value, the current position of the objective lens and the position of the objective lens at the last time; judging whether the focusing is finished according to the initial moving distance of the objective lens and whether the moving positions of the two adjacent objective lenses are opposite; if the focusing is finished, the automatic focusing is finished; and if the focusing is not finished, moving the objective lens to the next objective lens position, and returning to the step of acquiring the microscopic image, the current objective lens position and the last objective lens position. By adopting the method and the system, the variance is used as the definition evaluation standard, the calculated amount is small, and the method is combined with a hill climbing search method, so that the noise sensitivity is low and the stability is high while the efficiency is improved on the premise of ensuring accurate focusing.)

1. A method of micromanipulation autofocus, comprising:

acquiring a microscopic image, a current objective lens position and a last objective lens position;

converting the microscopic image into a gray image;

calculating variance according to the gray value of the gray image;

determining the variance as a focus value;

determining the position of the objective lens at the next time by adopting a hill climbing search method according to the focusing value, the current objective lens position and the last objective lens position;

judging whether the focusing is finished according to the initial moving distance of the objective lens and whether the moving positions of the two adjacent objective lenses are opposite; if the focusing is finished, the automatic focusing is finished; and if the focusing is not finished, moving the objective lens to the next objective lens position, and returning to the step of acquiring the microscopic image, the current objective lens position and the last objective lens position.

2. The micromanipulation autofocus method of claim 1, wherein the calculating a variance from the grayscale value of the grayscale image specifically comprises:

the variance is calculated according to the following formula:

where F denotes a variance, H denotes a grayscale image height direction pixel value, W denotes a grayscale image width direction pixel value, i (x, y) denotes a grayscale value at the grayscale image (x, y) point, and μ denotes an average grayscale value of the entire grayscale image.

3. The micromanipulation automatic focusing method of claim 1, wherein determining the next objective position by using a hill-climbing search method according to the focus value, the current objective position and the last objective position specifically comprises:

the next objective position is determined according to the following formula:

in the formula In+1Indicates the next objective position,/nIndicating the current objective position,/n-1Showing last objective position, fn-1Representing the last focus value, fnIndicating the current focus value, L indicates the objective lens shift distance parameter, and L decreases to half the initial objective lens shift distance when the current shift direction of the objective lens is opposite to the last shift direction.

4. The micromanipulation automatic focusing method of claim 3, wherein whether focusing is completed is judged according to whether the initial moving distance of the objective lens is opposite to the moving positions of two adjacent objective lenses, and specifically comprises:

whether focusing is completed is judged according to the following formula:

Lcurrent=L0/2k

in the formula, LcurrentDenotes the current objective lens movement distance, k denotes the number of times of change of the objective lens movement direction, L0Indicating the initial movement distance of the objective lens.

5. A micromanipulation autofocus system comprising:

the acquisition module is used for acquiring the microscopic image, the current objective position and the last objective position;

the gray level conversion module is used for converting the microscopic image into a gray level image;

the variance calculation module is used for calculating variance according to the gray value of the gray image;

a focus value determination module for determining the variance as a focus value;

the next objective lens position determining module is used for determining the next objective lens position by adopting a hill climbing search method according to the focusing value, the current objective lens position and the last objective lens position;

the judging module is used for judging whether focusing is finished according to the fact that the initial moving distance of the objective lens is opposite to the moving positions of the two adjacent objective lenses; if the focusing is finished, sending the instruction to an automatic focusing finishing module; if the focusing is not finished, sending the instruction to an objective lens moving module;

the objective lens moving module is used for moving the objective lens to the next objective lens position and sending an instruction to the acquisition module;

and the automatic focusing ending module is used for ending automatic focusing.

6. The micromanipulation autofocus system of claim 5, wherein the variance calculation module comprises:

a variance calculating unit for calculating a variance according to the following formula:

where F denotes a variance, H denotes a grayscale image height direction pixel value, W denotes a grayscale image width direction pixel value, i (x, y) denotes a grayscale value at the grayscale image (x, y) point, and μ denotes an average grayscale value of the entire grayscale image.

7. The micromanipulation autofocus system of claim 5, wherein the next objective position determination module comprises:

a next objective lens position determining unit for determining a next objective lens position according to the following formula:

in the formula In+1Indicates the next objective position,/nIndicating the current objective position,/n-1To representLast objective position, fn-1Representing the last focus value, fnIndicating the current focus value, L indicates the objective lens shift distance parameter, and L decreases to half the initial objective lens shift distance when the current shift direction of the objective lens is opposite to the last shift direction.

8. The micromanipulation autofocus system of claim 7, wherein the determining module specifically comprises:

a judging unit for judging whether focusing is completed according to the following formula:

Lcurrent=L0/2k

in the formula, LcurrentDenotes the current objective lens movement distance, k denotes the number of times of change of the objective lens movement direction, L0Indicating the initial movement distance of the objective lens.

Technical Field

The invention relates to the technical field of micromanipulation automatic focusing, in particular to a micromanipulation automatic focusing method and a micromanipulation automatic focusing system based on variance combined with a hill climbing search method.

Background

Auto-focusing is a fundamental microscopic technique, particularly in biological observation and manipulation at the micron nanometer scale, such as: high throughput observation screens pharmacological agents, delivers foreign substances to cells, and the like. Reliable auto-focusing methods are also critical for micro-assembly of micro-electromechanical systems using microscopes. The auto-focus process can be divided into two parts: and evaluating image definition and searching algorithm. Although image sharpness evaluation indicators are a long standing topic and a significant portion of focusing algorithms have been discussed by researchers, the selection of a suitable sharpness definition and calculation for a particular experimental microscopic imaging condition remains difficult and time consuming. In addition, the traditional derivative-based algorithm is used as an image definition evaluation standard and has high sensitivity to noise.

Disclosure of Invention

The invention aims to provide a micromanipulation automatic focusing method and a micromanipulation automatic focusing system based on variance and a hill-climbing search method.

In order to achieve the purpose, the invention provides the following scheme:

a micromanipulation automatic focusing method based on variance combined with hill climbing search method includes:

acquiring a microscopic image, a current objective lens position and a last objective lens position;

converting the microscopic image into a gray image;

calculating variance according to the gray value of the gray image;

determining the variance as a focus value;

determining the position of the objective lens at the next time by adopting a hill climbing search method according to the focusing value, the current objective lens position and the last objective lens position;

judging whether the focusing is finished according to the initial moving distance of the objective lens and whether the moving positions of the two adjacent objective lenses are opposite; if the focusing is finished, the automatic focusing is finished; and if the focusing is not finished, moving the objective lens to the next objective lens position, and returning to the step of acquiring the microscopic image, the current objective lens position and the last objective lens position.

Optionally, the calculating the variance according to the gray value of the gray image specifically includes:

the variance is calculated according to the following formula:

where F denotes a variance, H denotes a grayscale image height direction pixel value, W denotes a grayscale image width direction pixel value, i (x, y) denotes a grayscale value at the grayscale image (x, y) point, and μ denotes an average grayscale value of the entire grayscale image.

Optionally, the determining, according to the focus value, the current objective position, and the last objective position, a next objective position by using a hill-climbing search method specifically includes:

the next objective position is determined according to the following formula:

in the formula In+1Indicates the next objective position,/nIndicating the current objective position,/n-1Showing last objective position, fn-1Representing the last focus value, fnIndicating the current focus value, L indicates the objective lens shift distance parameter, and L decreases to half the initial objective lens shift distance when the current shift direction of the objective lens is opposite to the last shift direction.

Optionally, judging whether to complete focusing according to whether the initial moving distance of the objective lens is opposite to the moving positions of two adjacent objective lenses, specifically including:

whether focusing is completed is judged according to the following formula:

Lcurrent=L0/2k

in the formula, LcurrentDenotes the current objective lens movement distance, k denotes the number of times of change of the objective lens movement direction, L0Indicating the initial movement distance of the objective lens.

The invention also provides a micromanipulation automatic focusing system based on variance combined with hill climbing search method, comprising:

the acquisition module is used for acquiring the microscopic image, the current objective position and the last objective position;

the gray level conversion module is used for converting the microscopic image into a gray level image;

the variance calculation module is used for calculating variance according to the gray value of the gray image;

a focus value determination module for determining the variance as a focus value;

the next objective lens position determining module is used for determining the next objective lens position by adopting a hill climbing search method according to the focusing value, the current objective lens position and the last objective lens position;

the judging module is used for judging whether focusing is finished according to the fact that the initial moving distance of the objective lens is opposite to the moving positions of the two adjacent objective lenses; if the focusing is finished, sending the instruction to an automatic focusing finishing module; if the focusing is not finished, sending the instruction to an objective lens moving module;

the objective lens moving module is used for moving the objective lens to the next objective lens position and sending an instruction to the acquisition module;

and the automatic focusing ending module is used for ending automatic focusing.

Optionally, the variance calculating module specifically includes:

a variance calculating unit for calculating a variance according to the following formula:

where F denotes a variance, H denotes a grayscale image height direction pixel value, W denotes a grayscale image width direction pixel value, i (x, y) denotes a grayscale value at the grayscale image (x, y) point, and μ denotes an average grayscale value of the entire grayscale image.

Optionally, the next objective lens position determining module specifically includes:

a next objective lens position determining unit for determining a next objective lens position according to the following formula:

in the formula In+1Indicates the next objective position,/nIndicating the current objective position,/n-1Showing last objective position, fn-1Representing the last focus value, fnIndicating the current focus value, L indicates the objective lens shift distance parameter, and L decreases to half the initial objective lens shift distance when the current shift direction of the objective lens is opposite to the last shift direction.

Optionally, the determining module specifically includes:

a judging unit for judging whether focusing is completed according to the following formula:

Lcurrent=L0/2k

in the formula, LcurrentDenotes the current objective lens movement distance, k denotes the number of times of change of the objective lens movement direction, L0Indicating the initial movement distance of the objective lens.

Compared with the prior art, the invention has the beneficial effects that:

the invention provides a micromanipulation automatic focusing method and a micromanipulation automatic focusing system based on variance combined with a hill climbing search method, wherein a microscopic image, a current objective lens position and a last objective lens position are obtained, and the image is converted into a gray image; calculating variance according to the gray value of the gray image; determining the variance as a focus value; determining the position of the objective lens at the next time by adopting a hill climbing search method according to the focusing value, the current position of the objective lens and the position of the objective lens at the last time; judging whether the focusing is finished according to the initial moving distance of the objective lens and whether the moving positions of the two adjacent objective lenses are opposite; if the focusing is finished, the automatic focusing is finished; if the focusing is not finished, the objective lens is moved to the position of the objective lens at the next time, a microscopic image is obtained again, the variance is used as a definition evaluation standard, the calculated amount is small, and the hill climbing search method is combined, so that the noise sensitivity is low and the stability is high while the efficiency is improved on the premise of ensuring the accurate focusing.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.

FIG. 1 is a flow chart of a micromanipulation auto-focusing method based on variance combined with hill-climbing search method in an embodiment of the present invention;

FIG. 2 is a diagram of a micromanipulation autofocus system based on variance in combination with hill-climbing search method according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The invention aims to provide a micromanipulation automatic focusing method and a micromanipulation automatic focusing system based on variance and a hill-climbing search method.

In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种投影物镜

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!