A kind of microscope Atomatic focusing method that focus process model can be set

文档序号:1770958 发布日期:2019-12-03 浏览:43次 中文

阅读说明:本技术 一种对焦过程模型可设定的显微镜自动对焦方法 (A kind of microscope Atomatic focusing method that focus process model can be set ) 是由 熊永华 杨云洪 吴梁广 于 2019-07-24 设计创作,主要内容包括:本发明提供了一种对焦过程模型可设定的显微镜自动对焦方法,用于实现可人为设定对焦模型的显微镜自动对焦方法。在训练阶段:首先设定的对焦模型即对焦评价分数与显微镜头坐标之间的变化关系满足高斯函数模型,并结合显微图像清晰度评价方法以及人的视觉感知计算出显微图像的对焦评价分数,然后,基于深度神经网络建立对焦评价模型;在应用阶段:利用对焦评价模型求解出高斯函数参数,进而得到显微镜头焦点坐标位置的预测值,最后通过区域局部搜索,得到最终显微镜头的坐标。玻片等透明物体进行衍射成像时,由于光照的变化会形成双伪焦点现象。本发明的有益效果是:实现具有双伪焦点的物体在光学显微镜的准确、快速对焦。(The present invention provides a kind of microscope Atomatic focusing methods that focus process model can be set, for realizing the microscope Atomatic focusing method that focusing model can be manually set.In the training stage: the variation relation that the focusing model set first is focused between evaluation score and microlens coordinate meets Gaussian function model, and micro-image clarity evaluation method and the visual perception of people is combined to calculate the focusing evaluation score of micro-image, then, focusing evaluation model is established based on deep neural network;In the application stage: solving Gaussian function parameter using focusing evaluation model, and then obtain the predicted value of microlens focal coordinates position, finally by region local search, obtain the coordinate of final microlens.When the transparent substances such as slide carry out diffraction imaging, since the variation of illumination will form double pseudo- focus phenomenons.The beneficial effects of the present invention are: realizing has the object of double pseudo- focuses in accurate, the rapid focus of optical microscopy.)

1. a kind of microscope Atomatic focusing method that focus process model can be set, it is characterised in that: the following steps are included:

S1: using certain block region of observed objects as reference area, by one group of station acquisition that adjusts microlens at equal intervals Micro-image, and record the corresponding camera lens coordinate in each position;Using Tenengrad sharpness evaluation function, and combine human eye The focus process model of perception and setting obtains the micro-image focusing evaluation score;One micro-image and the image Corresponding focusing evaluation score forms a trained subsample, all training subsample composing training samples;The setting Focus process model is that focusing evaluation score and the variation relation of camera lens coordinate meet Gaussian function model G (x;A, μ, δ), In, x is camera lens coordinate, and a is gain, and μ is actual focal spot coordinate, and δ is variance;

S2: it according to the training sample, is trained, obtains to by the deep neural network of back bone network of MobileNetV2 Focus evaluation model Fs(x), coke evaluation model Fs(x) it is used to calculate focusing evaluation score;

S3: acquisition parsing sample, and utilize the focusing evaluation model Fs(x), focus process Gaussian function model is solvedParameterWherein parameterIndicate prediction focal coordinates;The parsing sample by with include starting focus point and Any t focus point and its corresponding picture appraisal score composition including focus point are terminated, t is positive integer, and t > 2;

S4: obtaining final focal coordinates by carrying out local search in predeterminable area around the prediction focal coordinates, The corresponding point of the final focal coordinates is obtained optical microscope inspection object auto-focusing point.

2. a kind of microscope Atomatic focusing method that focus process model can be set as described in claim 1, it is characterised in that: In step sl, the training sample is made of multiple groups micro-image and corresponding focusing evaluation score;With the minimum of microlens Moving step length is that at equal intervals, the upper and lower in image objects focal position respectively acquires m images, and m is the positive integer greater than 1;This m One group of sample of image construction is opened, mobile or replacement different objects acquire multiple groups sample according to the method described above;The multiple groups sample is Multiple groups micro-image in the training sample;It sets between the focusing evaluation score S of every group of sample and microlens coordinate x Relationship meets Gaussian function modelThe every group of best micro-image of sample perceived with human eye Corresponding camera lens coordinate is focal coordinates, which is the value of the Gaussian function Model Parameter μ;Any selection one Group sample meets as baseline sample, the baseline sample focus processWherein μ0For benchmark sample Focal coordinates, a0For the gain of benchmark sample, δ0For the variance of benchmark sample, σ0For the mean value of benchmark sample, and σ0,a0> 0; The micro-image P that Tenengrad sharpness evaluation function acquires at microlens coordinate xxCorresponding clear evaluation of estimate is T (Px);Then the focusing evaluation score of other group of sample isWherein,It is opened for jth kind sample i-th The evaluation score of image,The microlens coordinate of image, μ are opened for jth kind sample i-thjIt is right for jth group training sample focus The microlens coordinate answered, TmaxjFor jth kind Sample Maximal clarity evaluation of estimate, Tmax0It is clear for the maximum of the baseline sample Spend evaluation of estimate.

3. a kind of microscope Atomatic focusing method that focus process model can be set as described in claim 1, it is characterised in that: In step s 2, described to be set as by the output layer neuron number of the deep neural network of back bone network of MobileNetV2 1;Optimizer is declined using training sample utilization index attenuation gradient and Glorot unifies initialization technique to focusing evaluation model It is trained.

4. a kind of microscope Atomatic focusing method that focus process model can be set as described in claim 1, it is characterised in that: In step s3, the micro-image acquired at microlens coordinate x is Px, choosing includes starting focus point and termination focus point The process of any t focus point inside is as follows:

(1) the starting focus point for assuming microlens is P0, the focusing evaluation score of corresponding micro-image is Fs(P0);First Beginning focus point is P0Place adjusts microlens, towards direction D (D=1/D=-1) moving step length L (L=l0) arrive focus point P1;Compare Fs(P0) and Fs(P1) size, and more new direction D and step-length L;If Fs(P1) < Fs(P0), then direction D is updated to -1*D, and L updates For pL;Otherwise, direction D is remained unchanged, and L is updated to qL;Wherein, D=1 indicates that the direction of motion of microlens is (separate upwards Observed objects), D=-1 indicates that the direction of motion of microlens is downwards (close to observed objects);Wherein, p and q be non-zero just Integer;Wherein, l0For the minimum movement step-length of microlens;

(2) in focus point P1Place is continued to adjust microlens with updated direction D, is moved to focus point P2Place, it is corresponding aobvious The focusing evaluation score of micro- image is Fs(P2);

(3) step (2) are repeated, until meeting condition Fs(Pi) > Fs(Pi-1) and Fs(Pn) < Fs(Pn-1) until, obtain the focusing of n group The focusing evaluation score of point and its corresponding micro-image: { (P0,Fs(P0)),(P1,Fs(P1)),...,(Pn,Fs(Pn))};Its In, PnTo terminate focus point, i and n are positive integer, and 1<i<n, n>=3;

(4) from the n group focus point of step (3) and its focusing evaluation score of corresponding micro-image, choosing includes starting pair Focus and termination focus point and its corresponding image definition evaluation value (P0,Fs(P0)) and (Pn,Fs(Pn)) including any t Focus point and its corresponding image definition evaluation value are as parsing sample.

5. a kind of microscope Atomatic focusing method that focus process model can be set as claimed in claim 4, it is characterised in that: In step s3, focus process Gaussian function model is solved using the parsing sampleParameterMatrix X, A and Y are obtained using principle of least square method:

Wherein there are XA=Y, p0、p1...ptThat for selection includes starting focus point and any t focus point for terminating focus point, A For coefficient matrix, a0、a1And a2It is coefficient, Fs(p0)、Fs(p1)...Fs(pt) it is to respectively correspond focus point p0、p1...ptFigure Image sharpness evaluation of estimate, A=(XTX)-1XTY,It solvesAs predict focal coordinates.

6. a kind of microscope Atomatic focusing method that focus process model can be set as described in claim 1, it is characterised in that: It adjusts microlens respectively to move k times up and down with minimum movement step-length final focal coordinates obtained in the step S4, obtain Corresponding Tenengrad image definition evaluation value when to 2k+1 focus point and the focus point, 2k+1 obtained is focused The corresponding Tenengrad image definition evaluation value of point is compared, and minimum Tenengrad image definition evaluation value is corresponding Focus point is the focus point obtained after finely tuning, wherein k is the positive integer greater than 1.

Technical field

The present invention relates to microscope imaging field more particularly to a kind of microscope that focus process model can be set are automatically right Burnt method.

Background technique

In full microscope imaging system, auto-focusing is a very important technology.In academic and industry neck Domain, many objects require to observe or process under the microscope, it is therefore desirable to so that object is focused under the microscope.With telescope, The optical devices such as camera are compared, and microscopical areas imaging is very narrow, depth of field very little.Therefore, even if glass slide initially passes through Lens are manually adjusted to focus, mobile several microns of sliding glass also due to its non-uniform surface and cause to defocus.In order to The efficiency for improving micro-imaging, realizes that microscopical auto-focusing is particularly significant.

In general, Autofocus Technology can be divided into active autofocus method and passive auto-focusing method.It is active automatic Focusing method needs hardware supported, at high cost, in microscope using less.Passive type Autofocus Technology is mainly based upon Digital image processing techniques, wherein focusing depth method is built upon in search process, the micro-image acquired to needs is commented Valence, find evaluation of estimate it is optimal when camera lens coordinate.Depth method of focusing is a kind of pure values optimisation technique, at low cost, and precision is high, is led to It is strong with property.

It is different from most of observations object (such as biological cell smears), their focal curve be it is unimodal, focus is peak It is worth position.However, the transparent substance as glass slide carries out having double pseudo- focus phenomenons when transmission imaging, focusing curve is in Existing Double-peak Phenomenon, and focusing position is the minimum value between two peaks.Existing Autofocus Technology all cannot solution carry Slide etc. has the auto-focusing problem of the transparent substance of double pseudo- focuses.

Summary of the invention

To solve the above-mentioned problems, the present invention provides a kind of microscope auto-focusing sides that focus process model can be set Method mainly comprises the steps that

S1: using certain block region of observed objects as reference area, by the station acquisition for adjusting microlens at equal intervals One group of micro-image, and record the corresponding camera lens coordinate in each position;Using Tenengrad sharpness evaluation function, and combine The focus process model of human eye perception and setting obtains the micro-image focusing evaluation score;One micro-image and should The corresponding focusing evaluation score of image forms a trained subsample, all training subsample composing training samples;It is described to set Fixed focus process model is that focusing evaluation score and the variation relation of camera lens coordinate meet Gaussian function model G (x;A, μ, δ), Wherein, x is camera lens coordinate, and a is gain, and μ is actual focal spot coordinate, and δ is variance;

S2: according to the training sample, being trained to by the deep neural network of back bone network of MobileNetV2, Obtain focusing evaluation model Fs(x), coke evaluation model Fs(x) it is used to calculate focusing evaluation score;

S3: acquisition parsing sample, and utilize the focusing evaluation model Fs(x), focus process Gaussian function model is solvedParameterWherein parameterIndicate prediction focal coordinates;The parsing sample by with include starting focus point and Any t focus point and its corresponding picture appraisal score composition including focus point are terminated, t is positive integer, and t > 2;

S4: final focus seat is obtained by carrying out local search in predeterminable area around the prediction focal coordinates Mark, the corresponding point of the final focal coordinates are obtained optical microscope inspection object auto-focusing point.

Further, the training sample is made of multiple groups micro-image and corresponding focusing evaluation score;With microlens Minimum movement step-length be that at equal intervals, the upper and lower in image objects focal position respectively acquires m images, m is just whole greater than 1 Number;This m one group of sample of image construction, mobile or replacement different objects, acquire multiple groups sample according to the method described above;The multiple groups sample This is the multiple groups micro-image in the training sample;Set the focusing evaluation score S and microlens coordinate x of every group of sample Between relationship meet Gaussian function modelIt is most preferably aobvious with every group of sample of human eye perception The corresponding camera lens coordinate of micro- image is focal coordinates, which is the value of the Gaussian function Model Parameter μ;Arbitrarily Select one group of sample as baseline sample, which meetsWherein μ0For base The focal coordinates of quasi- sample, a0For the gain of benchmark sample, δ0For the variance of benchmark sample, σ0For the mean value of benchmark sample, and σ0,a0> 0;The micro-image P that Tenengrad sharpness evaluation function acquires at microlens coordinate xxIt is corresponding clearly to comment Value is T (Px);Then the focusing evaluation score of other group of sample isWherein,For jth kind sample The evaluation score of i-th image,The microlens coordinate of image, μ are opened for jth kind sample i-thjIt is burnt for jth group training sample The corresponding microlens coordinate of point, TmaxjFor jth kind Sample Maximal clarity evaluation of estimate, Tmax0Most for the baseline sample Big clarity evaluation of estimate.

Further, described using MobileNetV2 as the output layer neuron number of the deep neural network of back bone network It is set as 1;Optimizer is declined using training sample utilization index attenuation gradient and Glorot unifies initialization technique and comments focusing Valence model is trained.

Further, the micro-image acquired at microlens coordinate x is Px, choosing includes starting focus point and termination The process of any t focus point including focus point is as follows:

(5) the starting focus point for assuming microlens is P0, the focusing evaluation score of corresponding micro-image is Fs(P0); It is P in initial focus point0Place adjusts microlens, towards direction D (D=1/D=-1) moving step length L (L=l0) arrive focus point P1; Compare Fs(P0) and Fs(P1) size, and more new direction D and step-length L;If Fs(P1) < Fs(P0), then direction D is updated to -1*D, L It is updated to pL;Otherwise, direction D is remained unchanged, and L is updated to qL;Wherein, D=1 indicates that the direction of motion of microlens is upward (far from observed objects), D=-1 indicate that the direction of motion of microlens is downwards (close to observed objects);Wherein, p and q are Non-zero positive integer;Wherein, l0For the minimum movement step-length of microlens;

(6) in focus point P1Place is continued to adjust microlens with updated direction D, is moved to focus point P2Place, it is corresponding Micro-image focusing evaluation score be Fs(P2);

(7) step (2) are repeated, until meeting condition Fs(Pi) > Fs(Pi-1) and Fs(Pn) < Fs(Pn-1) until, obtain n group The focusing evaluation score of focus point and its corresponding micro-image: { (P0,Fs(P0)),(P1,Fs(P1)),...,(Pn,Fs (Pn))};Wherein, PnTo terminate focus point, i and n are positive integer, and 1<i<n, n>=3;

From the n group focus point of step (3) and its focusing evaluation score of corresponding micro-image, choosing includes starting pair Focus and termination focus point and its corresponding image definition evaluation value (P0,Fs(P0)) and (Pn,Fs(Pn)) including any t Focus point and its corresponding image definition evaluation value are as parsing sample.

Further, focus process Gaussian function model is solved using the parsing sample ParameterMatrix X, A and Y are obtained using principle of least square method:

Wherein there are XA=Y, p0、p1...ptWhat it is for selection includes starting focus point and any t focusing for terminating focus point Point, A are coefficient matrix, a0、a1And a2It is coefficient, Fs(p0)、Fs(p1)...Fs(pt) it is to respectively correspond focus point p0、p1...pt Image definition evaluation value, A=(XTX)-1XTY,It solvesAs predict focal coordinates.

Further, microlens are adjusted with minimum movement step-length final focal coordinates obtained in the step S4 Each movement k times up and down, obtains corresponding Tenengrad image definition evaluation value when 2k+1 focus point and the focus point, will The corresponding Tenengrad image definition evaluation value of 2k+1 obtained focus point is compared, and minimum Tenengrad image is clear The clear corresponding focus point of evaluation of estimate of spending is the focus point obtained after finely tuning, wherein k is the positive integer greater than 1.

Technical solution provided by the invention, which has the benefit that, realizes the object with double pseudo- focuses in optical microphotograph Accurate, the rapid focus of mirror improve the speed of microscope focusing, and focusing precision is higher, mention to improve the efficiency of micro-imaging For supporting.

Detailed description of the invention

Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:

Fig. 1 is a kind of process for the microscope Atomatic focusing method that focus process model can be set in the embodiment of the present invention Figure;

Fig. 2 is a kind of flow direction for the microscope Atomatic focusing method that focus process model can be set in the embodiment of the present invention Figure;

Fig. 3 is certain the block administrative division map of the observed objects that observe under microscope in the embodiment of the present invention on glass slide;

Fig. 4 is the curve after one group of test data standardization of focusing evaluation model in the embodiment of the present invention;

Fig. 5 is the test result figure focused automatically in the embodiment of the present invention.

Specific embodiment

For a clearer understanding of the technical characteristics, objects and effects of the present invention, now control attached drawing is described in detail A specific embodiment of the invention.

The embodiment provides a kind of microscope Atomatic focusing methods that focus process model can be set.

Fig. 1 and 2 is please referred to, Fig. 1 is that a kind of microscope that focus process model can be set is automatically right in the embodiment of the present invention The flow chart of burnt method, Fig. 2 are a kind of microscope Atomatic focusing methods that focus process model can be set in the embodiment of the present invention Flow graph, specifically comprise the following steps:

S1: using certain block region of observed objects as shown in Figure 3 as reference area, by adjusting microlens at equal intervals Position one group of micro-image of acquisition, and record the corresponding camera lens coordinate in each position;Letter is evaluated in Tenengrad clarity Human eye perception is combined on the basis of number and set focus process is the variation relation of focusing evaluation score and camera lens coordinate Meet Gaussian function model G (x;A, μ, δ), obtain the micro-image focusing evaluation score;Gaussian function model G (x;a,μ, Output δ) is evaluation score of focusing;Wherein, x is camera lens coordinate, and a is gain, and μ is actual focal spot coordinate, and δ is variance;One It opens micro-image focusing evaluation score corresponding with the image and forms a trained subsample, all training subsamples constitute instruction Practice sample;Wherein, during training sample is made of multiple groups micro-image and corresponding focusing evaluation score.It is moved with the minimum of microlens Dynamic step-length is that at equal intervals, the upper and lower in image objects focal position respectively acquires m images, and m is the positive integer greater than 1, this m opens One group of sample of image construction, mobile or replacement different objects, acquires multiple groups sample according to the method described above;The multiple groups sample is institute State the multiple groups micro-image in training sample;Set the pass between the focusing evaluation score S of every group of sample and microlens coordinate x System meets Gaussian function modelThe every group of best micrograph of training sample judged with human eye It is to set the value of μ in Gaussian function model as corresponding camera lens coordinate is focal coordinates.Arbitrarily select one group of sample as benchmark Sample sets its focus process satisfactionWherein μ0For the focal coordinates of benchmark sample, a0For base The gain of quasi- sample, δ0For the variance of benchmark sample, σ0For the mean value of benchmark sample, and σ0,a0> 0;Tenengrad clarity Evaluation function evaluates the micro-image P acquired at microlens coordinate xxIt is clear value be T (Px), the maximum of baseline sample is clear Degree evaluation of estimate is Tmax0, then the focusing evaluation score of other group of training sample beWherein,It is J kind sample i-th opens the evaluation score of image,The microlens coordinate of image, μ are opened for jth kind sample i-thjFor the training of jth group Microlens coordinate, T corresponding to sample focusmaxjFor jth kind Sample Maximal clarity evaluation of estimate, Tmax0For the benchmark sample This utmost sharpness evaluation of estimate;

S2: according to the training sample, being trained to by the deep neural network of back bone network of MobileNetV2, Obtain focusing evaluation model Fs(x), Fs(x) it is used to calculate focusing evaluation score;Wherein, described using MobileNetV2 as skeleton The output layer neuron number of the deep neural network of network is set as 1;Declined using training sample utilization index attenuation gradient excellent Change device and Glorot unifies initialization technique and is trained to focusing evaluation model;

As shown in figure 4, dotted line is that optional one group of test data passes through Tenengrad sharpness evaluation function in figure Obtained corresponding clarity evaluation of estimate, pecked line are the label value of the focusing evaluation score of this group of test data, and solid line is defeated Enter this group of test data to trained focusing evaluation model Fs(x) the focusing evaluation score obtained after.As can be seen from the figure There is good effect by training focusing evaluation model.

S3: acquisition parsing sample, and using focusing evaluation model, solve focus process Gaussian function model ParameterWherein parameterIndicate prediction focal coordinates;The parsing sample is by include starting focus point and termination focus point Any t focus point inside and its corresponding picture appraisal score are constituted, and t is positive integer, and t > 2;Wherein, microlens are sat Marking x to go out the micro-image acquired is Px, choose the mistake of any t focus point including starting focus point and including terminating focus point Journey is as follows:

(1) the starting focus point for assuming microlens is P0, the focusing evaluation score F of corresponding micro-images(P0);In Initial focus point is P0Place adjusts microlens, towards direction D (D=1/D=-1) moving step length L (L=l0) arrive focus point P1;Than Compared with Fs(P0) and Fs(P1) size, and more new direction D and step-length L;If Fs(P1) < Fs(P0), then direction D is updated to -1*D, and L is more It is newly pL;Otherwise, direction D is remained unchanged, and L is updated to qL;Wherein, D=1 indicates that the direction of motion of microlens is (remote upwards From observed objects), D=-1 indicates that the direction of motion of microlens is downwards (close to observed objects);Wherein, p and q is non-zero Positive integer;Wherein, l0For the minimum movement step-length of microlens.

(2) in focus point P1Place is continued to adjust microlens with updated direction D, is moved to focus point P2Place, it is corresponding Micro-image focusing evaluation score be Fs(P2);

(3) step (2) are repeated, until meeting condition Fs(Pi) > Fs(Pi-1) and Fs(Pn) < Fs(Pn-1) until, obtain n group The focusing evaluation score of focus point and its corresponding micro-image: { (P0,Fs(P0)),(P1,Fs(P1)),...,(Pn,Fs (Pn))};Wherein, PnTo terminate focus point, i and n are positive integer, and 1<i<n, n>=3;

From the n group focus point of step (3) and its focusing evaluation score of corresponding micro-image, choosing includes starting pair Focus and termination focus point and its corresponding image definition evaluation value (P0,Fs(P0)) and (Pn,Fs(Pn)) including any t Focus point and its corresponding image definition evaluation value are as parsing sample.

Focus process Gaussian function model is solved using the parsing sampleParameter X, A and Y are obtained according to principle of least square method:

Wherein there are XA=Y, p0、p1...ptWhat it is for selection includes starting focus point and any t focusing for terminating focus point Point, A are coefficient matrix, a0、a1And a2It is coefficient, Fs(p0)、Fs(p1)...Fs(pt) it is to respectively correspond focus point p0、p1...pt Image definition evaluation value, A=(XTX)-1XTY,It solvesAs predict focal coordinates.

S4: final focus seat is obtained by carrying out local search in predeterminable area around the prediction focal coordinates Mark, the corresponding point of the final focal coordinates are obtained optical microscope inspection object auto-focusing point.Wherein, by It predicts that focal coordinates region carries out local search, adjusts microlens with minimum movement step-length focus point obtained in the step S3 Each movement k times up and down, obtains corresponding Tenengrad image definition evaluation value when 2k+1 focus point and the focus point, schemes Corresponding focus point is the focus point obtained after finely tuning when image sharpness evaluation of estimate minimum, wherein k is the positive integer greater than 1.

Wherein, the operation in step S1 and step S2 is the training stage, and the operation in step S3 and step S4 is according to instruction The actual stage practicing the stage and applying.

As shown in figure 5, using the method acquisition parsing sample in step S3, and utilize trained focusing evaluation model Fs (x), it solves and obtains focus process Gaussian function model, Gaussian function model curve shown in dotted line is focus process height in figure This function model curve;Parsing data point in Fig. 5 is the focus point in the parsing sample;Pass through focus process Gauss The focusing evaluation score curve that function model is predicted and focusing evaluation score (label) curve are almost the same, described pre- to measure The focusing evaluation score curve arrived focusing evaluation score (prediction) curve i.e. shown in figure, by parsing focus process Gaussian function Prediction that digital-to-analogue shape parameter obtains focusing coordinate and true focusing coordinate very close to.Thus illustrate, utilize side provided by the invention Method can be realized the higher automatic rapid focus of precision.

The beneficial effects of the present invention are: realizing microscopical accurate, rapid focus, the speed of microscope focusing is improved, Precision of focusing is higher, provides support to improve the efficiency of micro-imaging.

The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:成像光学系统及电子装置

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!