Invention content
The present invention is simultaneous to solve the above problems, provide a kind of colloidal gold detection method and system based on image procossingCapacitive is good, applied widely, accuracy of detection is high.
To achieve the above object, the technical solution adopted by the present invention is:
A kind of colloidal gold detection method based on image procossing comprising following steps:
(10) detection image of colloidal-gold detecting-card is obtained, and the region to be identified of the detection image is carried out at gray scaleReason, obtains gray level image;
(20) the gray integration curve of the gray level image is calculated;
(30) all trough points of the gray integration curve are searched, and calculate the half-peak breadth of each trough point, peak centerPoint, effective integral area;
(40) the maximum trough point of effective integral area is searched, maximum trough point is obtained;
(50) if the half-peak breadth of the maximum trough point judges that the maximum trough point is invalid except preset rangePoint, and it is dead card to regard as the colloidal-gold detecting-card;If the half-peak breadth of the maximum trough point within preset range,The maximum trough point is judged for available point, and it is effectively to block to regard as the colloidal-gold detecting-card, then executes step (60);
(60) according to the position of the peak center point of the maximum trough point judge the maximum trough point for C line positions orPerson's T line positions;If being judged as C line positions, to other significant wave valley points of T lines direction finding, if finding other significant wave valley pointsThe trough point is then regarded as into T line positions, no T lines are regarded as if it can not find other significant wave valley points;If being judged as T lines positionIt sets, then to other significant wave valley points of C lines direction finding, the trough point is regarded as into C lines position if finding other significant wave valley pointsIt sets;No C lines are regarded as if it can not find other significant wave valley points, and it is dead card to regard as the colloidal-gold detecting-card.
Preferably, in the step (10), also further the detection image is stretched or is compressed to the length of reaction plateDegree, and according to the detection zone of the reaction plate detection image is cut to obtain the area to be identified of the detection imageDomain.
Preferably, the detection image is cut to obtain the region to be identified of the detection image, refers to describedCentered on reaction plate, retain the pixel region of transverse direction M*L, longitudinal direction M*L*0.3 as the region to be identified;Wherein, M is calibrationCoefficient, L are the length of the reaction plate;The value of the M is ranging from:0.75~0.95.
Preferably, the gray integration curve that the gray level image is calculated in the step (20), further comprises:
(21) gray value [X, Y, Z] of the gray level image is obtained, wherein X is that the pixel of the long side of the reaction plate is satMark, Y are the pixel coordinate of the short side of the reaction plate, and Z is the gray value at coordinate position (X, Y);
(22) using X-coordinate as abscissa, using Y coordinate as ordinate, gray integration summation is carried out to Y coordinate, obtains ashSpend integral curve [X, Zsum];
(23) the gray integration curve is filtered.
Preferably, in the step (30), the half-peak breadth, peak center point, effective integral area computational methods such asUnder:
(31) peak center point is calculated:
Centered on trough point, inflection point is found to both sides respectively, calculates inflection point and trough point ordinate difference Z1, Z2, andAbscissa difference X1, X2 is found according to the ordinate difference, it is peak center point to take the central point of X1, X2;
(32) half-peak breadth is calculated:
Straight line is done with X1, X2, the distance of trough point to straight line is peak height, and calculates half-peak breadth according to peak height;
(33) effective integral area is calculated:
Calculate the summation of the peak height of all the points between X1, X2, as the effective integral area of trough point.
Preferably, it carries out calculating peak center point in the step (31), also further to ordinate difference Z1, Z2Calibrated, that is, ordinate difference after calibration is N*Z1, N*Z2, and according to ordinate difference N*Z1, N*Z2 after calibration intoRow finds abscissa difference X1, X2;Wherein, N is calibration factor, and the value of N is ranging from:0.75~0.95.
Preferably, also further the half-peak breadth is calibrated, that is, the preset range of the half-peak breadth after calibration is P/VBetween P*V, the half-peak breadth then judges that the maximum trough point is available point, the half-peak breadth within the scope of P/V and P*VThen judge that the maximum trough point is Null Spot except P/V and P*V ranges;Wherein, P is half-peak breadth preset value, and V is half-peak breadthCoefficient of alteration;The value of the V is ranging from:1.1~1.8.
Preferably, still further comprise step (70), calculated according to the T line positions and the C line positions described inThe concentration value of detection sample in colloidal-gold detecting-card;Specifically include following steps:
(71) the gray integration value of the T line positions is calculated according to the T line positions in the gray integration curve,In, when regarding as no T lines, then the gray integration value of T lines is in terms of zero;
(72) the gray integration value of the C line positions is calculated according to the C line positions in the gray integration curve;
(73) ratio R of the T line positions and the gray integration value of the C line positions is calculated;
(74) ratio R is compared with typical ratio Rs, obtains sample to be tested concentration value.
Preferably, the step (74) are the standards of the standard sample by measuring a certain range of series concentrationRatio R s, each typical ratio Rs corresponds to a unique standard sample concentration value, to obtain standard curve or standardDeck watch;Then search corresponding typical ratio Rs according to the ratio R, and by the corresponding standard samples of typical ratio RsProduct concentration value is as the sample to be tested concentration value.
Correspondingly, the present invention also provides a kind of colloidal gold detecting system based on image procossing comprising:
Image pre-processing module obtains the detection image of colloidal-gold detecting-card, and to the area to be identified of the detection imageDomain carries out gray proces, obtains gray level image;
Curve processing module, the gray integration curve for calculating the gray level image;And it is bent to search the gray integrationAll trough points of line, and calculate the half-peak breadth of each trough point, peak center point, effective integral area;And search effectively productFacet accumulates maximum trough point, obtains maximum trough point;
Effective judgement module, if the half-peak breadth of the maximum trough point judges the maximum wave except preset rangeValley point is Null Spot, and it is dead card to regard as the colloidal-gold detecting-card;If the half-peak breadth of the maximum trough point is defaultWithin the scope of, then the maximum trough point is judged for available point, and it is effectively to block to regard as the colloidal-gold detecting-card;
CT line locating modules carry out judging the maximum trough point according to the position of the peak center point of the maximum trough pointFor C line positions or T line positions;If being judged as C line positions, to other significant wave valley points of T lines direction finding, if finding otherThe trough point is then regarded as T line positions by significant wave valley point, and no T lines are regarded as if it can not find other significant wave valley points;If sentencingBreak and recognizes the trough point if finding other significant wave valley points then to other significant wave valley points of C lines direction finding for T line positionsIt is set to C line positions;No C lines are regarded as if it can not find other significant wave valley points, and it is nothing to regard as the colloidal-gold detecting-cardEffect card.
Preferably, the curve processing module further comprises curve generation unit and curve computation unit, wherein:
For the curve generation unit by the gray value [X, Y, Z] of the acquisition gray level image, X is the long side of reaction platePixel coordinate, Y are the pixel coordinate of the short side of reaction plate, and Z is the gray value at coordinate position (X, Y);Using X-coordinate as horizontal seatMark carries out gray integration summation to Y coordinate, obtains gray integration curve [X, Zsum] using Y coordinate as ordinate;And furtherThe gray integration curve is filtered;
The curve computation unit carries out calculating the half-peak breadth of the trough point, peak center point, effective integral area, specifically's:
Calculate peak center point:It is by centered on trough point, finding inflection point to both sides respectively, calculating inflection point and trough pointOrdinate difference Z1, Z2, and abscissa difference X1, X2 is found according to the ordinate difference, it is in peak to take the central point of X1, X2Heart point;
Calculate half-peak breadth:It is by doing straight line with X1, X2, the distance of trough point to straight line is peak height, and according to peak heightCalculate half-peak breadth;
Calculate effective integral area:It is the summation by calculating the peak height of all the points between X1, X2, as trough point hasImitate integral area.
Preferably, quantitative analysis module is still further comprised, is counted according to the T line positions and the C line positionsCalculate the concentration value of the detection sample in the colloidal-gold detecting-card;Specifically:
The gray integration value of the T line positions is calculated according to the T line positions in the gray integration curve, wherein recognizeWhen being set to no T lines, then the gray integration value of T lines is in terms of zero;
The gray integration value of the C line positions is calculated according to the C line positions in the gray integration curve;
Calculate the ratio R of the T line positions and the gray integration value of the C line positions;
The ratio R is compared with typical ratio Rs, obtains sample to be tested concentration value.
Preferably, the ratio R is compared with typical ratio Rs, is by measuring a certain range of series concentrationStandard sample typical ratio Rs, each typical ratio Rs corresponds to a unique standard sample concentration value, to obtainStandard curve or standard comparison table;Then search corresponding typical ratio Rs according to the ratio R, and by the standard ratioThe corresponding standard sample concentration values of value Rs are as the sample to be tested concentration value.
The beneficial effects of the invention are as follows:
(1) present invention by obtain colloidal-gold detecting-card detection image, and to the region to be identified of the detection image intoRow gray proces obtain gray level image, calculate the gray integration curve of the gray level image, search the gray integration curveAll trough points, and the half-peak breadth of each trough point, peak center point, effective integral area are calculated, and search effective integral areaMaximum trough point obtains maximum trough point;It is carried out judging the colloidal gold detection according to the half-peak breadth of the maximum trough pointThe validity of card is further judged and is searched C lines if effectively according to the position of the peak center point of the maximum trough pointPosition and T line positions, to realize the qualitative analysis of colloidal-gold detecting-card, few to the image qualifications of acquisition, C lines, T linesAutomatic positioning discriminance analysis is accurate, and good compatibility is applied widely.
(2) present invention also further calculates the ratio of the T line positions and the gray integration value of the C line positions, and willThe ratio is compared with typical ratio, obtains the concentration value of sample to be tested, to realize the quantitative analysis of colloidal-gold detecting-card,Accuracy of detection is high.
Specific implementation mode
In order to keep technical problems, technical solutions and advantages to be solved clearer, clear, tie belowClosing accompanying drawings and embodiments, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only usedTo explain the present invention, it is not intended to limit the present invention.
As shown in Figure 1, a kind of colloidal gold detection method based on image procossing of the present invention comprising following steps:
(10) detection image of colloidal-gold detecting-card is obtained, and the region to be identified of the detection image is carried out at gray scaleReason, obtains gray level image (as shown in Figure 1);
(20) the gray integration curve (as shown in Figure 2) of the gray level image is calculated;
(30) all trough points of the gray integration curve are searched, and calculate the half-peak breadth of each trough point, peak centerPoint, effective integral area;
(40) the maximum trough point of effective integral area is searched, maximum trough point is obtained;
(50) if the half-peak breadth of the maximum trough point judges that the maximum trough point is invalid except preset rangePoint, and it is dead card to regard as the colloidal-gold detecting-card;If the half-peak breadth of the maximum trough point within preset range,The maximum trough point is judged for available point, and it is effectively to block to regard as the colloidal-gold detecting-card, then executes step (60);
(60) according to the position of the peak center point of the maximum trough point judge the maximum trough point for C line positions orPerson's T line positions;If being judged as C line positions, to other significant wave valley points of T lines direction finding, if finding other significant wave valley pointsThe trough point is then regarded as into T line positions, no T lines are regarded as if it can not find other significant wave valley points;If being judged as T lines positionIt sets, then to other significant wave valley points of C lines direction finding, the trough point is regarded as into C lines position if finding other significant wave valley pointsIt sets;No C lines are regarded as if it can not find other significant wave valley points, and it is dead card to regard as the colloidal-gold detecting-card.
In the step (10), the detection image of colloidal-gold detecting-card is obtained, the colloidal-gold detecting-card of the acquisitionThe pixel size of detection image need to include the region of entire reaction plate without limitation, detection image;Also, also further by the inspectionAltimetric image stretches or is compressed to the length L of reaction plate, and in the present embodiment, L is 500 pixels;And according to the reaction plateDetection zone cuts the detection image to obtain the region to be identified of the detection image.In the present embodiment, the inspectionThe method that altimetric image is stretched or compressed is as follows:Using StretchDIBits functions by picture in rectangular area in detection imageThe color data that element uses copies in specified target rectangle.If target rectangle size is bigger than source rectangle, to color dataRow and column stretched, to be matched with target rectangle;If target rectangle size is smaller than source rectangle, by using specified lightRanks are compressed in grid operation.In the present embodiment, carry out cutting the region to be identified, be centered on the reaction plate,The detection image after stretching/compressing is cut, filtering may interfere with the region of calculating, obtain region to be identified.It is right in the present embodimentThe detection image is cut to obtain the region to be identified of the detection image, refers to being retained centered on the reaction plateLateral M*L, longitudinal direction M*L*0.3 pixel region as the region to be identified;Wherein, M is calibration factor, and L is the reactionThe length of plate;The value of the M is ranging from:0.75~0.95.In the present embodiment, M=0.9, L=400 are taken, it is lateral to retain imageFor 0.9*400, longitudinal pixel region for being 0.9*400*0.3 is as region to be identified.
The gray integration curve that the gray level image is calculated in the step (20), further comprises:
(21) gray value [X, Y, Z] of the gray level image is obtained, wherein X is that the pixel of the long side of the reaction plate is satMark, Y are the pixel coordinate of the short side of the reaction plate, and Z is the gray value at coordinate position (X, Y);
(22) using X-coordinate as abscissa, using Y coordinate as ordinate, gray integration summation is carried out to Y coordinate, obtains ashSpend integral curve [X, Zsum];
(23) the gray integration curve is filtered (as shown in Figure 3);It is described to be filtered in the present embodimentIt is filtered using mean value smoothing, to eliminate noise.
In the step (30), the half-peak breadth, peak center point, the computational methods of effective integral area are as follows:
(31) peak center point is calculated:
Centered on trough point, inflection point is found to both sides respectively, calculates inflection point and trough point ordinate difference Z1, Z2, andAbscissa difference X1, X2 is found according to the ordinate difference, it is peak center point to take the central point of X1, X2;In the present embodiment, alsoFurther ordinate difference Z1, Z2 is calibrated, that is, the ordinate difference after calibration is N*Z1, N*Z2, and according to schoolOrdinate difference N*Z1, N*Z2 after standard carries out finding abscissa difference X1, X2;Wherein, N is calibration factor, and the model of the value of NEnclose for:0.75~0.95;In the present embodiment, N=0.8 is taken.
(32) half-peak breadth is calculated:
Straight line is done with X1, X2, the distance of trough point to straight line is peak height, and calculates half-peak breadth according to peak height;
(33) effective integral area is calculated:
Calculate the summation of the peak height of all the points between X1, X2, as the effective integral area S of trough point.
In the step (50), also further the half-peak breadth is calibrated, that is, half-peak breadth after calibration it is defaultBetween ranging from P/V and P*V, the half-peak breadth then judges that the maximum trough point is available point within the scope of P/V and P*V,The half-peak breadth then judges that the maximum trough point is Null Spot except P/V and P*V ranges;Wherein, P is default for half-peak breadthValue, V are half-peak breadth coefficient of alteration;Preferably, the value of the V is ranging from:1.1~1.8.In the present embodiment, the P values are32, the V values are 1.6, and the preset range of the half-peak breadth is between 32/1.6~32*1.6, that is, the half-peak breadth of trough pointIt is available point between 32/1.6~32*1.6.
In the present embodiment, step (70) is still further comprised, is calculated according to the T line positions and the C line positionsThe concentration value of detection sample in the colloidal-gold detecting-card;Specifically include following steps:
(71) the gray integration value of the T line positions is calculated according to the T line positions in the gray integration curve,In, when regarding as no T lines, then the gray integration value of T lines is in terms of zero;
(72) the gray integration value of the C line positions is calculated according to the C line positions in the gray integration curve;
(73) ratio R of the T line positions and the gray integration value of the C line positions is calculated;
(74) ratio R is compared with typical ratio Rs, obtains sample to be tested concentration value.
Specifically, the step (74), is the standard of the standard sample by measuring a certain range of series concentrationRatio R s, each typical ratio Rs corresponds to a unique standard sample concentration value, to obtain standard curve (such as Fig. 4 institutesShow) or standard comparison table;Then search corresponding typical ratio Rs according to the ratio R, and by typical ratio RsCorresponding standard sample concentration value is as the sample to be tested concentration value.
In the present embodiment, the standard curve can choose different computational methods according to different colloidal-gold detecting-cards, includingLinear fit, logistic fit, floating-point computing method etc., the present embodiment preferably use floating-point computing method.
It is corresponding with detection method above-mentioned, the colloidal gold detecting system based on image procossing that the present invention also provides a kind of,It includes:
Image pre-processing module obtains the detection image of colloidal-gold detecting-card, and to the area to be identified of the detection imageDomain carries out gray proces, obtains gray level image;
Curve processing module, the gray integration curve for calculating the gray level image;And it is bent to search the gray integrationAll trough points of line, and calculate the half-peak breadth of each trough point, peak center point, effective integral area;And search effectively productFacet accumulates maximum trough point, obtains maximum trough point;
Effective judgement module, if the half-peak breadth of the maximum trough point judges the maximum wave except preset rangeValley point is Null Spot, and it is dead card to regard as the colloidal-gold detecting-card;If the half-peak breadth of the maximum trough point is defaultWithin the scope of, then the maximum trough point is judged for available point, and it is effectively to block to regard as the colloidal-gold detecting-card;
CT line locating modules carry out judging the maximum trough point according to the position of the peak center point of the maximum trough pointFor C line positions or T line positions;If being judged as C line positions, to other significant wave valley points of T lines direction finding, if finding otherThe trough point is then regarded as T line positions by significant wave valley point, and no T lines are regarded as if it can not find other significant wave valley points;If sentencingBreak and recognizes the trough point if finding other significant wave valley points then to other significant wave valley points of C lines direction finding for T line positionsIt is set to C line positions;No C lines are regarded as if it can not find other significant wave valley points, and it is nothing to regard as the colloidal-gold detecting-cardEffect card.
The curve processing module further comprises curve generation unit and curve computation unit, wherein:
For the curve generation unit by the gray value [X, Y, Z] of the acquisition gray level image, X is the long side of reaction platePixel coordinate, Y are the pixel coordinate of the short side of reaction plate, and Z is the gray value at coordinate position (X, Y);Using X-coordinate as horizontal seatMark carries out gray integration summation to Y coordinate, obtains gray integration curve [X, Zsum] using Y coordinate as ordinate;And furtherThe gray integration curve is filtered;
The curve computation unit carries out calculating the half-peak breadth of the trough point, peak center point, effective integral area, specifically's:
Calculate peak center point:It is by centered on trough point, finding inflection point to both sides respectively, calculating inflection point and trough pointOrdinate difference Z1, Z2, and abscissa difference X1, X2 is found according to the ordinate difference, it is in peak to take the central point of X1, X2Heart point;
Calculate half-peak breadth:It is by doing straight line with X1, X2, the distance of trough point to straight line is peak height, and according to peak heightCalculate half-peak breadth;
Calculate effective integral area:It is the summation by calculating the peak height of all the points between X1, X2, as trough point hasImitate integral area.
In the present embodiment, still further comprise quantitative analysis module, according to the T line positions and the C line positions intoRow calculates the concentration value of the detection sample in the colloidal-gold detecting-card;Specifically:
The gray integration value of the T line positions is calculated according to the T line positions in the gray integration curve, wherein recognizeWhen being set to no T lines, then the gray integration value of T lines is in terms of zero;
The gray integration value of the C line positions is calculated according to the C line positions in the gray integration curve;
Calculate the ratio R of the T line positions and the gray integration value of the C line positions;
The ratio R is compared with typical ratio Rs, obtains sample to be tested concentration value.
Preferably, the ratio R is compared with typical ratio Rs, is by measuring a certain range of series concentrationStandard sample typical ratio Rs, each typical ratio Rs corresponds to a unique standard sample concentration value, to obtainStandard curve or standard comparison table;Then search corresponding typical ratio Rs according to the ratio R, and by the standard ratioThe corresponding standard sample concentration values of value Rs are as the sample to be tested concentration value.
A kind of the colloidal gold detection method and system based on image procossing of the present invention, by the glue for obtaining sample to be testedThe image of body gold detection card, and image compress/stretch, the pretreatments such as cutting processing, then pass through gray integration, filteringAlgorithm obtains the gray integration curve of image, finds out trough point and by parameter preset and calibration factor, according in half-peak breadth, peakHeart point position, effective integral area carry out C lines, the fixation and recognition of T lines and the calculating of integral area ratio, last to be waited for according toCalculating is compared with the series standard sample in the integral ratio of the T/C lines of sample, to realize colloidal-gold detecting-cardQualitative and quantitative analysis, few to the image qualifications of acquisition, C lines, the automatic positioning discriminance analysis of T lines are accurate, and good compatibility is fittedWith range is wide, accuracy of detection is high.
Colloidal-gold detecting-card described in the present embodiment mainly by taking Clenbuterol colloidal-gold detecting-card as an example, is of course also apply to itHis colloidal-gold detecting-card, is not limited, only can be according to different colloidal-gold detecting-card and difference in design parameter settingSample is detected to be configured, operation principle is substantially similar, in the contemplated scope of the present invention, and all should be in institute of the present inventionIn attached scope of the claims.
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment weightPoint explanation is all difference from other examples, and the same or similar parts between the embodiments can be referred to each other.For system embodiments, since it is basically similar to the method embodiment, thus description it is fairly simple, related place referring toThe part of embodiment of the method illustrates.Also, herein, the terms "include", "comprise" or its any other variant meaningCovering non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only thatA little elements, but also include other elements that are not explicitly listed, or further include for this process, method, article orThe intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arrangedExcept there is also other identical elements in the process, method, article or apparatus that includes the element.In addition, this field is generalLogical technical staff is appreciated that realize that all or part of step of above-described embodiment can be completed by hardware, can also pass throughProgram instructs the relevant hardware to complete, and the program can be stored in a kind of computer readable storage medium, above-mentioned to carryTo storage medium can be read-only memory, disk or CD etc..
The preferred embodiment of the present invention has shown and described in above description, it should be understood that the present invention is not limited to this paper institutesThe form of disclosure is not to be taken as excluding other embodiments, and can be used for other combinations, modifications, and environments, and energyEnough in this paper invented the scope of the idea, modifications can be made through the above teachings or related fields of technology or knowledge.And people from this fieldThe modifications and changes that member is carried out do not depart from the spirit and scope of the present invention, then all should be in the protection of appended claims of the present inventionIn range.