The content of the invention
The invention provides a kind of computational methods of digital pcr concentration of liquid drops, can effectively detect amount of droplets and
Calculate droplet size and target gene concentration.
A kind of computational methods of digital pcr concentration of liquid drops, including:
S1, digital picture acquisition;
S2, image preprocessing:Picture quality is lifted using image processing techniques such as image enhaucaments;
S3, drop positioning:Determine the position of each drop in the picture;
S4, droplet size calculate:By the area of each drop, the volume of each drop is calculated, and then obtains cumulative volume
V;
S5, concentration of liquid drops calculate:Cumulative volume V is substituted into formula and calculates target gene concentration m:
Wherein, q is the negative rate of target gene.
The preferred technical solution of the present invention is used as below:
The step S2 includes:
S21, by file reading manner, read in the image of various different-formats;
S22, using corresponding conversion formula, the image of reading is subjected to gray processing processing, is converted to gray level image;
S23, medium filtering denoising is carried out to image;
S24, the image homogenization processing that top cap conversion is carried out to image;
S25, bilateral filtering fuzzy operation and edge enhancing operation are carried out to image, complete the pretreatment of image.
The step S3 includes:
S31, image segmentation is carried out to image, obtain drop formation area image;
S32, canny rim detections are carried out to drop formation area image;
S33, multiple morphological operation is carried out to image after rim detection;
S34, connected domain analysis is carried out to the image after each morphological operation, obtain all possible candidate's drop position
Put;
S35, to each possible candidate's droplet position, using its surrounding neighbors region, reject candidate's drop centered and be located at
Background area, fringe region and multiple drop centereds are distributed in false candidate's droplet position on same drop, obtain final
Droplet position.
The step S35 includes:
S351, for each possible candidate's drop centered position, expanded respectively up and down to the left and right, obtain a W*
The topography of H sizes;
S352, remove candidate's drop that drop centered position is located at background area;
S353, remove candidate's drop that drop centered position is located at drop edge region;
S354, remove candidate's drop that drop centered position is located on same drop.
The step S352 includes:
S3521, to topography, carry out OTSU threshold operations, obtain threshold value ThrdT;
S3522, when the gray value of drop centered position is less than threshold value ThrdT, it is believed that candidate's drop centered positioned at the back of the body
Scene area, remove.
The step S353 includes:
S3531, for remaining candidate's drop centered position, using 4 neighborhoods, calculate the pixel value of its 8 neighborhood territory pixels;
S3532, when the pixel value of its 8 neighborhood territory pixels have one be less than threshold value ThrdT when, it is believed that candidate's drop centered
Positioned at fringe region, remove;
The step S354 includes:
S3541, candidate's drop for being neither located at background area and non-edge region, the connection looked for where background
Region;
S3542, look for image maximum gradation value;
S3543, look for all disconnected threshold limit values of prospect and background;
S3544, judge in the case of threshold limit value, handled candidate's drop whether in binarization with other times
Drop is selected to connect;
S3545, background UNICOM region is removed, be not involved in subsequently calculating;
S3546, less connected region is removed, be not involved in subsequently calculating;
S3547, the smaller connected region of filling, to avoid producing interference to follow-up calculate;
S3548, cut off the junction that pending candidate's drop is connected with other drops;
S3549, the border using the pending candidate's drop of morphological operation extraction;
S3550, the border to being extracted, carry out the radius calculation in 360 directions;
S3551, to each two candidate's drop, the distance between they are calculated, if the distance between they are less than them
Both radius sums, it is believed that they are located on same drop, remove one.
The step S3550 includes:
S35501, for boundary image, heart position pt1, carries out the scattering in 360 degree of directions therefrom;
S35502, it is changed into 255 point pt2 from 0 for each direction, record first;
S35503, using formula (7), calculate the Euclidean distance between pt1 to pt2, the radius r as the direction:
Wherein (x1,y1) be pt1 points coordinate, (x2,y2) be pt2 coordinate, r=D, so as to obtain 360 degree of directions of drop
Each radius value.
The step S3551 includes:
S35511, for each two candidate's drop, calculate the direction dir where two candidate's drops;
S35512, calculate Euclidean distance D1 between two candidate's drops;
S35513, respectively obtain the center that radius r1, r2, r1 of two drops on dir directions are candidate's drops
Radius value of the position on the dir of direction, r2 are radius value of the center of another candidate's drop on the dir of direction;
S35514, compare size between D1 and r1+r2, if D1<R1+r2, then two candidate's drops are positioned at same
On one drop, that less candidate's droplet position of gray value is removed;
S35515, all overlapping candidate's droplet positions are removed, obtain final positioning, complete the positioning of drop.
The step S4 includes:
S41, to each droplet position, expanded up and down, obtain the topography that size is W*H;
S42, utilize OTSU progress binarization operations;
S43, OTSU binarization operations are carried out again to background area, obtain threshold value ThrdV;
S44, using threshold value ThrdV to topography carry out binarization operation;
S45, using the drop tried to achieve above and the information of other drop adhesions, adhesion position picture is carried out to binary image
Plain value is set to 0;
S46, Boundary Extraction is carried out to the bianry image;
S47, calculate connected domain where the drop point number, plus the number of borderline point, as the drop
Area A;
S48, using formula (8), calculate the volume v of the dropi:
vi=A*H (8)
Wherein, H is height;
S49, the cumulative volume using formula (9) calculating target gene:
Wherein, n is drop total number;
And then obtain cumulative volume V.
Compared with prior art, the invention has the advantages that:
Taken pictures by industrial high-definition camera, go out the number of positive drop and total with the technology for detection of image steganalysis
The volume of number and each drop, finally calculate the target gene concentration of sample.In drop chip, drop density is big, liquid
Drip not of uniform size, and it is not very big that background and negative drop foreground, which are distinguished, and the present invention can accurately be determined by image procossing
Position goes out amount of droplets and calculates droplet size, can effectively detect amount of droplets and calculate droplet size and mesh
Mrna concentration m, so as to successfully realizing digital pcr genetic test.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
A kind of computational methods of digital pcr concentration of liquid drops, including:
S1, digital picture acquisition:The digital picture of target area is obtained using photo-sensitive cells such as CCD;
S2, image preprocessing:Picture quality is lifted using image processing techniques such as image enhaucaments;
S3, drop positioning:Determine the position of each drop in the picture;
S4, droplet size calculate:By the area of each drop, the volume of each drop is calculated, and then obtains cumulative volume;
S5, concentration of liquid drops calculate:Calculate target gene concentration.
The step S2 includes:
S21, by file reading manner, read in the image of various different-formats;
S22, using corresponding conversion formula, the image of reading is subjected to gray processing processing, is converted to gray level image, it is described
Step S22 includes:
According to corresponding formula, gray processing processing is carried out to the image read in, such as:RGB color image can be by as follows
Formula carries out gray processing processing:
GrayV=0.2989*R+0.5870*G+0.1140*B (1)
Wherein, R, G, B are respectively the R of coloured image, and G, B component, GrayV is the gray value after conversion;
The image of gray processing processing is as shown in Figure 1;
S23, medium filtering denoising is carried out to gray level image, the step S23 includes:
It is S231, such as equal to each pixel progress slide, n, m values in image by n*m slider bar to image
For 7;
S232, all pixels value in slider bar is ranked up operation (sort or sort from small to large from big to small,
Take median);
S233, the gray value by the Mesophyticum after sequence for slider bar center position in image;
S24, top cap conversion (image homogenization processing) is carried out to image, the step S24 includes:
S241, using n*n structural elements image is carried out first corrode the operation of opening expanded afterwards, n values are such as 50;
S242, using artwork image subtraction open operation after image, obtain top cap conversion image;
S25, image progress bilateral filtering fuzzy operation and edge enhancing operation, the step S25 are included:
S251, to each drop formation area image, carry out bilateral filtering operation, while noise is removed, reservation border
Information, the wherein scope of spatial domain Gaussian kernel are [5,15], and the scope of color gamut Gaussian kernel is [10,20];
Image after bilateral filtering is as shown in Figure 2;
S252, operation is sharpened to the image after bilateral filtering operation, strengthens marginal information, the step S252 bags
Include:
S2521, using gaussian filtering to after bilateral filtering image carry out Gaussian Blur, Gauss described in step S2521
It is to pass through function to obscure template usedIn δ=1, it is sampled to obtain on center, gained filtering
Template is as follows:
X in formula, y are respectively the x of image, y-coordinate value, and σ refers to variance.
S2522, the image after Gaussian Blur is subtracted using the image after bilateral filtering, obtains error image, be designated as template,
That is template image;
S2523, template image is added on original image, the image after being sharpened, the step S2523 includes:
Using equation below, the image after sharpening is calculated:
G (x, y)=f (x, y)+k*gmask(x, y) (3)
Wherein, g (x, y) is image after sharpening, and f (x, y) is original image, and k (k > > 0) is weight coefficient, is as k > 1
High boostfiltering, when k < 1 do not emphasize the scope [5,20] of the contribution, herein k of non-sharpening template, g thenmask(x, y) is Prototype drawing
Picture, it is obtained by equation below:
Wherein,For the image after Gaussian Blur;
The enhanced image in edge is as shown in Figure 3.
The step S3 includes:
S31, image segmentation is carried out to image, obtain area-of-interest, the step S31 includes:
S311, sample holes and oil storage hole are positioned, obtain processing region substantially;
S312, remove sample holes and oil storage bore region;
S313, runner position is looked for using projection;
S314, by runner, by pending area, be divided into Liang Kuai drop formations area, as area-of-interest;
S32, rim detection is carried out to pretreated image, the step S32 includes:
For pretreated image, rim detection is carried out using canny edge detection operators, two in detective operators
Threshold range be respectively [30,80], [90,240];
Image after canny rim detections is as shown in Figure 4;
S33, multiple morphological operation is carried out to image after rim detection, the step S33 includes:
S331, to the image after rim detection, repeatedly circulation expansive working is carried out, when no longer producing new connected region
Terminate circulation;
S332, expansive working, the structure used be 3*3 rectangular configuration, structure shaped like:
Image after expanding for the first time is as shown in figure 5, the image after expansion is as shown in fig. 6, last time expands for the second time
Image afterwards is as shown in Figure 7;
S34, connected domain analysis is carried out to the image after each morphological operation, obtain all possible candidate's drop position
Put, the step S34 includes:
S341, to the image after expansive working, carry out connected domain analysis, record the information of each connected region, obtain institute
Possible candidate's droplet position, it is used herein as 4 connections and is operated;
All possible candidate's droplet position is as shown in Figure 8;
S35, to each possible candidate's droplet position, using its surrounding neighbors region, reject candidate's drop centered and be located at
Background area, fringe region and multiple drop centereds are distributed in false candidate's droplet position on same drop, obtain final
Droplet position, the step S35 include:
S351, for each possible candidate's drop centered position, expanded respectively up and down to the left and right, obtain a W*
The topography of H sizes (W and H scopes are in 100-200, as the case may be determination);
Topography after one of drop centered or so expands up and down is as shown in Figure 9;
S352, candidate's drop that drop centered position is located at background area is removed, the step S352 includes:
S3521, to topography, carrying out OTSU threshold operations, (OTSU refers to the entitled big Tianjin commonly used in a kind of image procossing
The two-value method of method, it is prior art), obtain threshold value ThrdT (ThrdT is the threshold value obtained according to OTSU);
S3522, when the gray value of drop centered position is less than ThrdT, it is believed that candidate's drop centered is located at background area
Domain, remove;
It is as shown in figure 11 that candidate's drop centered is located at the schematic diagram after background area is removed;
S353, candidate's drop that drop centered position is located at drop edge region is removed, the step S353 includes:
S3531, for remaining candidate's drop centered position, using 4 neighborhoods, calculate the pixel value of its 8 neighborhood territory pixels,
Its structure is as shown in figure 19:
S3532, when the pixel value of its 8 neighborhood territory pixels have one be less than threshold value thrdT when, it is believed that candidate's drop centered
Positioned at fringe region, remove;
It is as shown in figure 12 that candidate's drop centered is located at the schematic diagram after fringe region is removed;
S354, candidate's drop that drop centered position is located on same drop is removed, the step S354 includes:
S3541, candidate's drop for being neither located at background area and non-edge region, the connection looked for where background
Region, the step S3541 include:
S35411, using threshold value ThrdT to topography carry out binarization operation;
Topography after binaryzation is as shown in Figure 10;
S35412, connected domain analysis is carried out to binary image;
S35413, the number of pixels of each connected domain of storage and pixel positional information, obtain background information, in case after
It is continuous to use;
S3542, image maximum gradation value is looked for, the step S3542 includes:
S35421, the histogram for calculating topography;
The histogram of topography is as shown in figure 13;
S35422, histogram is carried out to be normalized to scope [0,100];
S35423, from 255 to threshold value ThrdT, obtain its gray value number more than 5, and of continuous 3 gray values below
Gray value locations of the number also greater than 5, record the gray value, and the maximum gradation value using the gray value as topography
maxGrayV;
S3543, all disconnected threshold limit values of prospect and background are looked for, the step S3543 includes:
S35431, carry out binarization operation of the threshold value from threshold value ThrdT+1 to maxGrayV successively to topography, every time
Threshold value increases 1 certainly;
S35432, the information for recording connected domain in each binarization, deposit in array neighborInfoRecord,
The letters such as the number of the point of array neighborInfoRecord including connected domain total, each connected domain, center, label
Breath, in case follow-up use;
S35433, the connection domain information after each binaryzation is connected into domain information with background be compared, if both
Connected domain number is equal or fluctuates (number of pixels difference is 10 or so) in a small range, and label is right, then it is considered that
The background area and foreground area separate, and do not merge;
The number that S35434, all background areas of statistics are not merged with foreground area, if total number and background area
Number is equal, then, it is believed that under the threshold value, foreground area does not merge with background area, finds threshold limit value T, and
Recording its position start_pos in neighborInfoRecord, (described in S35431 is a circulate operation, often
Subthreshold adds 1, when the condition that meets " total number and background area number are equal ", it is believed that present threshold value is Threshold extent
Value, is designated as T, start_pos is the subscript in array neighborInfoRecord), exit circulate operation;
S35435, remaining connection domain information is recorded, allow threshold value to change from threshold limit value T to maxGrayV, record the change
The connection domain information of change process, and neighborInfoRecord total number is designated as num;
Topography's schematic diagram when prospect does not connect with background is as shown in figure 14, and center ranked third individual positioned at first
In drop;
S3544, judge in the case of threshold limit value, handled candidate's drop whether in binarization with other times
Drop is selected to connect, the step S3544 includes:
The label label of connected region where S35441, the pending candidate's drop centered of calculating;
If S35442, label non-zero, both it did not fell within background area under threshold limit value T, then whether carried out the drop
With the judgement of other drop UNICOMs, the step S35442 includes:
The position for the pixel that S354421, all labels of storage are label;
S354422, to neighborInfoRecord, traveled through from start_pos+1 to num, record label is
Label new connected domain tally set a little in change procedure, and count the number of the point of each label under the tally set,
And total number Sum;
If S354423, Sum are more than 54, and more than two labels be present, and UNICOM domain point number is more than 0.3*
Sum label number is more than 2, then it is assumed that pending candidate's drop and other drop UNICOMs, so circulation, record no longer occur new
Connection drop position pos;
S354424, if there is no candidate's drop and other drop UNICOMs, then final demarcation threshold final_T is equal to
T, otherwise, final_T are equal to pos-start_pos+T (i.e. pos subtracts start_pos and adds T);
If S35443, label are zero, then look for its label non-zero using four neighborhoods, and it is not fallen within threshold value
For the neighborhood point of the background area under thrdT, the label of UNICOM domain where calculating it, carrying out the drop using the neighborhood point is
The no and judgement of other drop UNICOMs;
S3545, background UNICOM region is removed, be not involved in subsequently calculating, the step S3545 includes:
S35451, when threshold value is final_T, background area when by neighborInfoRecord and threshold value being thrdT
Domain is compared;
If S35452, both connected domain point numbers are equal or fluctuate (number of pixels difference is 10 or so) in small range,
And there is the label in the label and neighborInfoRecord of a background dot right, then it is background area to think the connected domain
Domain, remove;
S3546, less connected region is removed, be not involved in subsequently calculating, the step S3546 includes:
S35461, to remaining connected region, if the point number of its connected domain is less than 27, namely assert minimum drop half
Footpath is 3, then it is inactive area to think the connected region, is removed;
S3547, the smaller connected region of filling, to avoid producing interference to follow-up calculate, the step S3547 includes:
If the point number of S35471, some connected region is less than 27, then by the pixel of all pixels point in the region
Value is set to 255;
Topography after small connected region is filled is as shown in figure 15, and center ranked third a drop positioned at first
In;
S3548, the junction that pending candidate's drop is connected with other drops is cut off, the step S3548 includes:
S35481, to pending drop, heart position, carries out 360 degree directions and scatters therefrom;
S35482, to each direction, find first point pt1 for thering is 0 to be changed into 255;
S35483, continue in the direction, find first be changed into from 255 0 point pt2;
If S35484, pt2 are located at background area, then in this direction, pending drop does not have and other drop adhesions;
If S35485, pt2 are located at non-background area, then in this direction, pending drop and other drop adhesions,
The gray value of the pixel of adhesion is set to 0;
Topography after drop junction is removed is as shown in figure 16, and center ranked third a drop positioned at first
In;
S3549, the border using the pending candidate's drop of morphological operation extraction, the step S3549 include:
S35491, the bianry image after processing is traveled through, if the gray value of the pixel is equal to 255, by its ash
Angle value is set to 1;
S35492, using structure it is:
Etching operation is carried out to image;
S35493, using artwork image subtraction corrode after image, if the pixel value of corresponding pixel points be 1, then by this
The pixel value of point is set to 255, and other are set to 0, obtain boundary image;
S3550, the border to being extracted, carry out the radius calculation in 360 directions, and the step S3550 includes:
S35501, for boundary image, heart position pt1, carries out the scattering in 360 degree of directions therefrom;
S35502, it is changed into 255 point pt2 from 0 for each direction, record first;
Topography after Boundary Extraction is as shown in figure 17, and center ranked third in a drop positioned at first;
S35503, using equation below, calculate the Euclidean distance between pt1 to pt2, the radius r as the direction:
Listed formula is general Euclidean distance calculation formula, wherein (x1,y1) be pt1 points coordinate, (x2,y2) it is pt2
Coordinate, r=D, so as to obtain 360 degree of each radius values in direction of drop.
S3551, to each two candidate's drop, the distance between they are calculated, if the distance between they are less than them
Both radius sums, it is believed that they are located on same drop, remove first, the step S3551 includes:
S35511, for each two candidate's drop, calculate the direction dir where two candidate's drops;
S35512, calculate Euclidean distance D1 between two candidate's drops;
S35513, respectively obtaining radius r1, r2 of two drops on dir directions, (formula in S35503, is calculated
360 degree of directions supply 360 radius values, and r1, r2 are the radius values on the dir of direction, i.e. r1 is in candidate's drop
Radius value of the heart position on the dir of direction, r2 are radius value of the center of another candidate's drop on the dir of direction);
S35514, compare size between D1 and r1+r2, if D1<R1+r2, then two candidate's drops are positioned at same
On one drop, that less candidate's droplet position of gray value is removed;
The schematic diagram that candidate's drop centered is located at after being removed on same drop is as shown in figure 18;
S35515, all overlapping candidate's droplet positions are removed, obtain final positioning (positioning for completing drop);
The step S4 includes:
S41, to each droplet position, expanded up and down, obtain topography's (W and H scopes that size is W*H
In 100-200, determine as the case may be);
S42, utilize OTSU progress binarization operations;
S43, OTSU binarization operations are carried out again to background area, obtaining threshold value ThrdV, (ThrdV is obtained according to OTSU
The threshold value arrived);
S44, using threshold value ThrdV to topography carry out binarization operation;
S45, using the drop tried to achieve above and the information of other drop adhesions, adhesion position picture is carried out to binary image
Plain value is set to 0;
S46, Boundary Extraction is carried out to the bianry image;
S47, calculate connected domain where the drop point number, plus the number of borderline point, as the drop
Area A;
S48, using formula (8), calculate the volume v of the dropi:
vi=A*H (8)
Wherein, H is height;H values are obtained by estimation at present, are 3/4*r, and r is the mean radius of drop;
S49, the cumulative volume of target gene are as follows:
Wherein, n is drop total number.
The step S5 includes:
S51, according to large sample Poisson distribution, utilize equation below, calculate target gene concentration m:
Wherein, q is the negative rate of target gene.Q value is calculated according to image, and every image is not
Together, scope 0-1, V are volumes said before.