CN100587717C - Medical large transfusion machine vision on-line detection method - Google Patents

Medical large transfusion machine vision on-line detection method Download PDF

Info

Publication number
CN100587717C
CN100587717C CN200710035766A CN200710035766A CN100587717C CN 100587717 C CN100587717 C CN 100587717C CN 200710035766 A CN200710035766 A CN 200710035766A CN 200710035766 A CN200710035766 A CN 200710035766A CN 100587717 C CN100587717 C CN 100587717C
Authority
CN
China
Prior art keywords
image
gray
target
value
threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN200710035766A
Other languages
Chinese (zh)
Other versions
CN101165720A (en
Inventor
王耀南
鲁娟
周博文
张辉
余洪山
秦虹
朱惠峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan University
Original Assignee
Hunan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan University filed Critical Hunan University
Priority to CN200710035766A priority Critical patent/CN100587717C/en
Publication of CN101165720A publication Critical patent/CN101165720A/en
Application granted granted Critical
Publication of CN100587717C publication Critical patent/CN100587717C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The method comprises: 1) getting the sequence image after the massive transfusion rotation stops in crash; 2) making preprocess for the sequence image; 3) completing the extraction of motion particlein the sequence image; 4) selecting the multi-step threshold method to gradually determining the optimal partitioning threshold of the micro foreign substance grey scale image to realize the partitioning for the motion target; 5) using the eight connected domain mark to mark the connected area of foreign substance, and calculating the internal maximal diameter of same connected area; 6) making calculation for the target maximal diameter and eccentricity to estimate the quality state of the transfusion and to make classification for the type of the foreign substance; finally, sending out the control signals.

Description

Medical large transfusion machine vision on-line detection method
Technical field
The present invention is mainly concerned with the detection range of medical large transfusion, refers in particular to a kind of medical large transfusion machine vision on-line detection method.
Background technology
In the prior art, medical large transfusion refers to the high-capacity injection more than 100 milliliters, there is family more than 300 in the producer of the infusion solutions of China's production nowadays, productive capacity has reached annual 6900000000 bottles, annual value of production reaches more than 100 hundred million yuan, in these products, it is to adopt glass bottle packaging that product more than 90% is arranged, although novel packing continues to bring out, as the existing soft-packing transfusion that uses more than 46% in flourishing cities such as Shanghai, the output of plastics package transfusion accounts for more than 5% of the market share, but estimates that after the several years, the infusion solutions product of China is still based on vial.These are packaged products with the vial, are mostly small-volume injection, and the sterile powder of injection changes transfusion, product with low content of technology, and because the restriction of production equipment, the quality of product is uneven, and curative effect is difficult to guarantee.In the production run, often have plug bits, the water pipe iron rust enters the situation of transfusion, the collision between vial, and also regular meeting allows and vitroclastic occurs in the soup.At present the detection of transfusion finished product is mostly by manually finishing, and that can not avoid during manual detection exists efficient low, loss height, problem such as precision is low.Chinese Pharmacopoeia rose the infusion solutions clarity test and carries out the particulate matter inspection after qualified in 1985, and the size and the quantity of particulate are carried out strictness control.On August 24th, 1999, national Bureau of Drugs Supervision formally prints and distributes the notice of relevant regulations " about the enforcement<GMP〉", explicitly calls for infusion solutions production must reach the GMP standard before the end of the year 2000.After China enters WTO, face of the impact of external advanced complete medical production equipment to the home market, the international market is opened in the home market of trying hard to keep, and medicine safety in production detection packaging facilities and method that research has independent intellectual property right have crucial value.
Summary of the invention
The problem to be solved in the present invention just is: at the technical matters of prior art existence, the invention provides and a kind ofly can overcome problems such as manual detection efficiency is low, speed is slow, precision is low, loss is high, the easy fatigue of testing staff, thereby improve the medical large transfusion machine vision on-line detection method of medical large transfusion production automation degree and product quality.
For solving the problems of the technologies described above, the solution that the present invention proposes is: a kind of medical large transfusion machine vision on-line detection method is characterized in that step is:
(1), obtains consecutive image: demarcate behind the camera camera and grasp continuously that the infusion solutions rotation is anxious to stop the back sequence image, and these images are sent to industrial computer;
(2), image denoising: the image that obtains in the step (1) is carried out pre-service, remove the noise that may cause in image taking and the transmission course by median filter;
(3), moving target extracts: by second order difference and the method that the gray scale energy accumulation combines, the temporal correlation when utilizing small foreign matter imaging is finished the extraction of the moving particles target in the sequence image;
(4), moving Object Segmentation: select the multistep threshold method for use, progressively determine the optimal segmenting threshold of small foreign matter gray level image, realize cutting apart of moving target, during operation, according to the histogram distribution of image, calculate the threshold value that detects target automatically earlier, draw the approximate range of detected body, afterwards, from then on set out in the center in separated zone again, searches for along " X " word direction, draws the greatest gradient change point, choose an appropriate gray shade value in this gradient, image is finally cut apart.
(5), image recognition: by the sign of eight connected domains, identify in the image and might be the connected region of foreign matter, and calculate the inside longest diameter of same connected region;
(6), image judges: by in the connected domain, the quality situation of transfusion is judged in the calculating of target maximum gauge and eccentricity, and the type of foreign matter is classified; If be communicated with in the district, the longest diameter of target surpasses a certain setting value, thinks that then this detected transfusion does not meet production requirement, judge the shape that is communicated with the district according to the calculating of eccentricity, note the correlation parameter of defective transfusion, and communicate, send control signal with PLC.
The method flow that second order difference combines with the gray scale energy accumulation in the described step (1) is:
1., by importing the image scene that continuous three frames have sampling interval, the target information of intermediate frame is extracted, in the sequence image of continuous acquisition, choose three frame solution sequence image f (t-1)(x, y), f (t)(x, y), f (t+1)(x y) calculates the absolute difference gray level image d of adjacent two frames respectively by following formula (9) and (10) (t-1, t)(x, y) and d (t, t+1)(x, y),
d (t-1,t)(x,y)=|f (t)(x,y)-f (t-1)(x,y)| (9)
d (t,t+1)(x,y)=|f (t+1)(x,y)-f (t)(x,y)| (10);
2., utilize the gray difference of image itself to use a positive number N (2≤N≤5) to amplify this species diversity, make
Impact point has higher energy, the weighted difference image P that obtains (t-n, t)(x, y) and P (t, t+n)(x, y) as shown in the formula shown in (11) and (12),
P (t-n,t)(x,y)=d (t-n,t)(x,y)×N (11)
P (t,t+n)(x,y)=d (t,t+n)(x,y)×N (12);
Get wherein that to multiply by gray-scale value behind the N be 255 greater than 255 pixel gray-scale value;
3., the difference image after strengthening carries out second order difference and calculates suc as formula (9), second order difference image D (x, y),
D(x,y)=|P (t-n,t)(x,y)-P (t,t+n)(x,y)| (13);
4., press the energy accumulation that following formula (14) calculates two width of cloth difference images, to increase f t(x, y) in the energy of moving particles respective pixel, the energy accumulation image A (x, y),
A(x,y)=P (t-n,t)(x,y)+P (t,t+n)(x,y) (14)
Getting gray-scale value after the addition equally is 255 greater than 255 pixel gray-scale value;
5., (x, y) (x y) subtracts each other with following formula (15), just can obtain f with second order difference image D with the energy accumulation image A at last (t)(x, y) middle particulate gray level image F (t)(x, y),
F (t)(x,y)=A(x,y)-D(x,y) (15):
Adopt the multistep value of cutting off from method to particulate gray level image F in the described step (4) (t)(x, y) carry out the idiographic flow that target cuts apart and be:
1., select an initial threshold T, order:
T = 0.9 Max ( x , y ) ∈ F ( t ) ( x , y ) { F ( t ) ( x , y ) } - - - ( 16 )
Be that T is 90% of an entire image maximum gradation value, t is the number of image;
2., entire image is cut apart by threshold value T, obtain two groups of image G 1, G 2
Wherein:
G 1 = { F ( t ) ( x , y ) } F ( t ) ( x , y ) &GreaterEqual; T G 2 = { F ( t ) ( x , y ) } F ( t ) ( x , y ) < T - - - ( 17 )
3., calculate G 1And G 2Average gray μ 1, μ 2
&mu; 1 = &Sigma; ( x , y ) &Element; G 1 F ( t ) ( x , y ) N 1
&mu; 2 = &Sigma; ( x , y ) &Element; G 2 F ( t ) ( x , y ) N 2 - - - ( 18 )
In the formula, N 1With N 2Represent G respectively 1, G 2The number summation of middle pixel;
4., calculate the new value of cutting off from T 1:
T 1 = 1 2 ( &mu; 1 + &mu; 2 )
(19);
5., repeat the and 2. went on foot for the 4. step, up to T 1With the absolute difference of T less than predetermined threshold 0.5 till, then obtain global threshold H, H is the T of this moment 1
6., image is cut apart, construct a new bianry image by H:
A ( t ) ( x , y ) = 0 F ( t ) ( x , y ) &GreaterEqual; H 1 F ( t ) ( x , y ) < H - - - ( 20 )
7., calculate A (t)(x, connected domain y), and identify the center C of each connected domain (l, n)(x, y), wherein t represents the sequence number of the particulate gray level image that obtained by previous step, n indicates the connected domain sequence;
8., at former figure F (t)(x, C y) (l, n)(x, y) with " X " direction to a round-looking scan N pixel, identify three place shade of gray and change more a little louder, shade of gray dL is defined as:
dL=p n+1-p n (21)
P in the formula nBe meant certain any pixel value along N (N is the either direction in " X " direction) direction;
9., calculate final threshold value E, the value of E should be included in above-mentioned three places' shade of gray and change between the maximum gray scale, by the E value image is carried out secondary splitting, can get and detect target more clearly
B ( t ) ( x , y ) = 0 F ( t ) ( x , y ) &GreaterEqual; E 1 F ( t ) ( x , y ) < E - - - ( 22 )
For the image that a plurality of detection targets are arranged, detect target according to each and may draw a plurality of threshold values, with this threshold value each target to be cut apart, the result after will cutting apart again at last merges on the image.
The idiographic flow of described step (5) is: in the target bianry image that obtains by step (4), white portion is numbered, calculate eight connected domains of this white portion, and add up their areas separately, obtain each regional inside longest diameter, the shortest diameter, eccentricity with the boundary line, wherein longest diameter refers to the Euclidean distance of point-to-point transmission maximum, and the shortest diameter is meant the straight line vertical with major axis, and the eccentricity of boundary line refers to the longest diameter and the ratio of short diameter.
Compared with prior art, advantage of the present invention just is:
1, ignores in the camera calibration process, the variation of absolute position in the world coordinate system, direct relative position according to the impurity of examining, calculate the size of impurity, that is: according to the coordinate of captured image in the pixel planes coordinate system, partial interior parameter during with camera imaging--adjacent two pixels in the horizontal direction with the actual range of vertical direction representative, extrapolate the actual size of imaging object;
2, small foreign matter is adopted the method for energy accumulation and second order difference:, make second order difference every the frame difference image, do not contained the intermediate frame target image for adjacent two just in three sequence images; Simultaneously, these two difference images are made addition, obtain the enhancing intermediate frame target image behind the energy accumulation; Do absolute difference processing to strengthening the intermediate frame target image and not containing the intermediate frame target image, just only comprised the intermediate frame target image after strengthening.
3, in the image segmentation process, select the multistep threshold method for use, promptly earlier by rough bianry image of global threshold method structure, then on the basis of this threshold value, roughly determine the center of each checked for impurities, the heart to round-looking scan, is determined the optimal segmenting threshold of each impurity with " X " direction hereinto.
Description of drawings
Fig. 1 is an overall procedure synoptic diagram of the present invention;
Fig. 2 is a pin-hole imaging perspective diagram among the present invention;
Fig. 3 is the structural representation of camera calibration among the present invention;
Fig. 4 is a target extraction algorithm schematic flow sheet among the present invention;
Fig. 5 is a moving Object Segmentation schematic flow sheet among the present invention;
Fig. 6 is the image that obtains behind second order difference and the gray scale energy accumulation among the present invention;
Fig. 7 is an image synoptic diagram after the Threshold Segmentation among the present invention.
Embodiment
Below with reference to the drawings and specific embodiments the present invention is described in further details.
As shown in Figure 1, the idiographic flow of medical large transfusion machine vision on-line detection method of the present invention is:
1, obtains consecutive image.This step mainly is to finish obtaining of consecutive image, and utilizes the camera calibration of finishing in advance, obtains the actual range of the image neighbor spacing representative of taking the photograph, and in the image deterministic process, the maximum gauge that calculates particulate provides the data support.Large transfusion bottle stops behind high speed rotating on the endless track immediately, and the transfusion image that the video camera continuous acquisition is anxious after stopping forms sequence image, sends to industrial computer and is used for judging whether to exist visible foreign matters.Wherein, endless track is meant that transfusion originally along the static relatively operation of track, does the high speed rotation with respect to track afterwards, makes impurity in the bottle as much as possible with the transfusion motion; Camera is meant that two high speed faces that can be used for industry spot sweep the CCD camera, and two camera vertical pendulums are put, and is detected the complete image of transfusion to obtain; Sequence image is meant anxious back 7 two field pictures of shooting continuously that stop of transfusion, and this sequence image all is to adopt annular light source to take for the light mode with the top, and background is unified; Visible foreign matters is meant the visual insoluble substance that can observe under rated condition, and its particle diameter or length comprise impurity such as floating thing, color dot, fiber, vitroclastic usually greater than 50 microns.For the function that guarantees to make a video recording photographs foreign matter in the infusion bottle, the rotational speed of bottle is 7 revolutions per seconds, and shutter speed is 1/1500 second, aperture f/8, the image size is 640 * 480 pixels, does not consider the distortion of camera lens, adopt pin hole to become the phase model, the spacing that calculates each pixel is 0.02mm.Timing signal selects for use 4 chequered with black and white square plastic sheets to do sign, and the structural representation of camera calibration as shown in Figure 2.Wherein s is the distance of plastic sheet to imaging plane, and a is each little foursquare length of side on the plastic sheet.F is a focus of camera, and x is the horizontal ordinate in the object plane coordinate system, and y is an ordinate in the object plane coordinate system, elected phasing mechanical coke apart from the time, imaging process satisfies pin-hole model, its perspective model as shown in Figure 3, object plane point Z is then arranged, and (x, y is s) to looking like planar point Z u(x u, y u) the perspective variation relation promptly:
x u y u = f s - f 0 0 f s - f x y - - - ( 1 )
Ignore the distortion of camera lens, then have as the variation relation of plane to pixel planes:
x f = N x x u + x c y f = N y y u + y c - - - ( 2 )
In the formula, (x f, y f) for object plane point Z (x, y, s) in the coordinate points of pixel planes, (N x, N y) be the pixel of unit distance on the pixel planes, (x c, y c) be the coordinate of picture planar central in pixel planes, arrangement (1), (2) two formulas can get
x f - x c = fN x s - f x y f - y c = fN y s - f y - - - ( 3 )
In this method and since the imaging of infusion bottle all the time near focal length, therefore can be similar to the actual imaging point of thinking all drop on object plane Z (x, y, s) on, thereby draw actual two point (x 1, y 1), (x 2, y 2) imager coordinate (X in distance L and the pixel planes F1, y F1), (x F2, y F2) the pass be:
L = s - f f ( x f 1 - x f 2 N x ) 2 + ( y f 1 - y f 2 N y ) 2 - - - ( 4 )
Know by following formula, only need to determine (N x, N y) just can draw the distance of actual two object points.
Determine N x, N yThe time, get 9 the coordinate (xs of four little squares after imaging on the pixel planes in the square plastic sheet of doing sign usefulness F1, y F1), (x F2, y F2), (x F3, y F3), (x F4, y F4), (x F5, y F5), (x F6, y F6), with (x F7, y F7), (x F8, y F8), (x F9, y F9), calculate the distance on these 12 limits of 4 adjacent square respectively:
S 1 = ( x f 1 - y f 1 ) 2 + ( x f 2 - y f 2 ) 2
S 2 = ( x f 2 - y f 2 ) 2 + ( x f 3 - y f 3 ) 2
S 3 = ( x f 3 - y f 3 ) 2 + ( x f 4 - y f 4 ) 2 - - - ( 5 )
....
S 12 = ( x f 6 - y f 6 ) 2 + ( x f 9 - y f 6 ) 2
Wherein, S 1, S 2, S 3, S 4, S 5, S 6Be the pixel number after little foursquare six horizontal sides imagings, S 7, S 8, S 9, S 10, S 11, S 12Be the pixel number after little foursquare six vertical edges imagings, can get in view of the above pixel coordinate tie up between the horizontal direction neighbor apart from N x:
N x = 6 a S 1 + S 2 + S 3 + S 4 + S 5 + S 6 - - - ( 6 )
Pixel coordinate tie up between the vertical direction neighbor apart from N y:
N y = 6 a S 7 + S 8 + S 9 + S 10 + S 11 + S 12 - - - ( 7 )
2, image denoising.For satisfying the needs of the speed that image handles in real time, select comparatively simple medium filtering for use, remove the noise that brings in the image acquisition process, the removal impulse noise that this wave filter can maximum probability, its expression formula is:
f ( x , y ) = median ( s , t ) &Element; S xy { g ( s , t ) } - - - ( 8 )
In the formula, select the template S of m * n for use Xy, m wherein, n is odd number, g (s, the pixel value of the template window that t) is illustrated in, f (x is after this template window filtering y), the pixel value of output, and (x y) is template S XyThe center.
3, moving target extracts.Since the existence of solution drug particles, and particulate itself is very small, and therefore, the detection that finish foreign matter in the solution is actually a kind of detection to many small objects.Here the difference method of Cai Yonging is the method that a kind of second order difference combines with the gray scale energy accumulation, and the process flow diagram of this difference as shown in Figure 3.This algorithm is actually a kind of and improves and next method on symmetric difference method basis, and it extracts the target information of intermediate frame by importing the image scene that continuous three frames have sampling interval.In the sequence image of continuous acquisition, choose three frame solution sequence image f (t-1)(x, y), f (t)(x, y), f (t+1)(x y) calculates the absolute difference gray level image d of adjacent two frames respectively (t-1, t)(x, y) and d (t, t+1)(x, y), suc as formula (9), shown in (10):
d (t-1,t)(x,y)=|f (t)(x,y)-f (t-1)(x,y)| (9)
d (t,t+1)(x,y)=|f (t+1)(x,y)-f (t)(x,y)| (10)
Impact point energy in the differentiated absolute grayscale difference image of sequence image becomes very low.Utilize the gray difference of image itself to use a positive number N (2≤N≤5) to amplify this species diversity, make impact point have higher energy, the weighted difference image P that obtains (t-n, t)(x, y) and P (t, t+n)(x, y) suc as formula (11), shown in (12):
P (t-n,t)(x,y)=d (t-n,t)(x,y)×N (11)
P (t,t+n)(x,y)=d (t,t+n)(x,y)×N (12)
Get wherein that to multiply by gray-scale value behind the N be 255 greater than 255 pixel gray-scale value.Difference image after the enhancing carries out second order difference and calculates suc as formula (9), second order difference image D (x, y).
D(x,y)=|P (t-n,t)(x,y)-P (t,t+n)(x,y)| (13)
Then calculate the energy accumulation of two width of cloth difference images again by (14) formula, to increase f t(x, y) in the energy of moving particles respective pixel, the energy accumulation image A (x, y):
A(x,y)=P (t-n,t)(x,y)+P (t,t+n)(x,y) (14)
Getting gray-scale value after the addition equally is 255 greater than 255 pixel gray-scale value.
(x, y) (x y) subtracts each other with (15) formula, just can obtain f with second order difference image D with the energy accumulation image A at last (t)(x, y) middle particulate gray level image F (t)(x, y).
F (t)(x,y)=A(x,y)-D(x,y) (15)
In this example, choose 7 frame consecutive images altogether, amplification coefficient N is 2, obtains 5 frame particulate gray level images at last.As shown in Figure 4.
4, moving Object Segmentation.5 particulate gray level image F that this example adopts the automatic threshold method that previous step is obtained (t)(x, y), carry out cutting apart of moving target (t=1,2,3,4,5), when determining concrete threshold value, adopts the multistep threshold method, and image is analyzed.At first select the total head threshold method for use, draw one roughly threshold value image is cut apart, then on the basis of global threshold, adopt " X " to search procedure, calculate local threshold, obtaining more accurate target image, its process flow diagram as shown in Figure 5, process is as follows.
(1) selected initial threshold T, order:
T = 0.9 Max ( x , y ) &Element; F ( t ) ( x , y ) { F ( t ) ( x , y ) } - - - ( 16 )
Be that T is 90% of an entire image maximum gradation value.
(2) entire image is cut apart by threshold value T, obtained two groups of image G 1, G 2
Wherein:
G 1 = { F ( t ) ( x , y ) } F ( t ) ( x , y ) &GreaterEqual; T G 2 = { F ( t ) ( x , y ) } F ( t ) ( x , y ) < T - - - ( 17 )
(3) calculate G 1And G 2Average gray μ 1, μ 2
&mu; 1 = &Sigma; ( x , y ) &Element; G 1 F ( t ) ( x , y ) N 1
&mu; 2 = &Sigma; ( x , y ) &Element; G 2 F ( t ) ( x , y ) N 2 - - - ( 18 )
In the formula, N 1With N 2Represent G respectively 1, G 2The number summation of middle pixel.
(4) calculate new threshold value T 1:
T 1 = 1 2 ( &mu; 1 + &mu; 2 ) - - - ( 19 )
(5) repeat (2) and went on foot for (4) step, up to T 1With the absolute difference of T less than predetermined threshold 0.5 till, then obtain global threshold H, H is the T of this moment 1
(6) by H image is cut apart, is constructed a new bianry image:
A ( t ) ( x , y ) = 0 F ( t ) ( x , y ) &GreaterEqual; H 1 F ( t ) ( x , y ) < H - - - ( 20 )
(7) calculate A (t)(x, connected domain y), and identify the center C of each connected domain (t, n)(x, y) (t represents the sequence number of 5 particulate gray level images being obtained by previous step, and n indicates the connected domain sequence).
(8) at former figure F (t)(x, C y) (t, n)(x, y) with " X " direction to a round-looking scan N pixel, (this pixel choose the gray-scale value that do not have the greatest impact, choosing N in this example is 50) identifies three place's shade of gray and changes more a little louder, shade of gray dL is defined as:
dL=p n+1-p n (21)
P in the formula nBe meant certain any pixel value along N (N is the either direction in " X " direction) direction.
(9) calculate final threshold value E, the value of E should be included in above-mentioned three place's shade of gray and change between the maximum gray scale, by the E value image is carried out secondary splitting, can get and detect target more clearly.Frame particulate bianry image after cutting apart as shown in Figure 5.
B ( t ) ( x , y ) = 0 F ( t ) ( x , y ) &GreaterEqual; E 1 F ( t ) ( x , y ) < E - - - ( 22 )
For the image that a plurality of detection targets are arranged, detect target according to each and may draw a plurality of threshold values, with this threshold value each target to be cut apart, the result after will cutting apart again at last merges on the image.
5, image recognition.In the target bianry image that obtains, white portion is numbered, calculate eight connected domains of this white portion, and add up their areas separately, obtain each regional inside longest diameter, the eccentricity of the shortest diameter and boundary line.Longest diameter refers to the Euclidean distance of point-to-point transmission maximum, and the shortest diameter is meant the straight line vertical with major axis, and the eccentricity of boundary line refers to the longest diameter and the ratio of short diameter.In the practical operation, the corresponding longest diameter of 5 two field pictures that obtained by previous step is compared, get rid of of the influence of foreign matter rotary course, draw the maximum gauge of foreign matter imaging.
6, image is judged.This step mainly is a technology of utilizing some image recognitions, and the quality of infusion solutions is judged that process is as follows.
(1) by (4) formula maximum gauge is converted into length L in the reality, and L and examination criteria are compared, if L, thinks then that detected transfusion is defective greater than examination criteria.
(2) judge the eccentricity of the maximum gauge foreign matter boundary line in the unacceptable product, greater than 10, think that then this foreign matter is a fiber, otherwise be other foreign matters such as color lump as this eccentricity.
(3) note testing result, communicate with PLC and send control signal.
7, last, after PLC received control signal, the control hit device hit unacceptable product to the recovery area.

Claims (5)

1, a kind of medical large transfusion machine vision on-line detection method is characterized in that step is:
(1), obtain consecutive image: after demarcating camera, camera grasps the infusion solutions rotation continuously and suddenly stops the back sequence image, and these images are sent to industrial computer;
(2), image denoising: the image that obtains in the step (1) is carried out pre-service, remove the noise that may cause in image taking and the transmission course by median filter;
(3), moving target extracts: by second order difference and the method that the gray scale energy accumulation combines, the temporal correlation when utilizing small foreign matter imaging is finished the extraction of the moving particles target in the sequence image;
(4), moving Object Segmentation: select the multistep threshold method for use, progressively determine the optimal segmenting threshold of small foreign matter gray level image, realize cutting apart of moving target, during operation, elder generation is according to the histogram distribution of image, automatically calculate the threshold value that detects target, draw the approximate range of detected body, afterwards, from then on set out in the center in separated zone again, searches for along " X " word direction, it is more a little bigger to identify three place's shade of gray, and calculate final threshold value E, the value of E should be included between the gray scale of above-mentioned three place's shade of gray maximums, according to final threshold value E image is finally cut apart at last;
(5), image recognition: by the sign of eight connected domains, identify in the image and might be the connected region of foreign matter, and calculate the inside longest diameter of same connected region;
(6), image judges: by in the connected domain, the quality situation of transfusion is judged in the calculating of target maximum gauge and eccentricity, and the type of foreign matter is classified; If be communicated with in the district, the longest diameter of target surpasses a certain setting value, thinks that then this detected transfusion does not meet production requirement, judge the shape that is communicated with the district according to the calculating of eccentricity, note the correlation parameter of defective transfusion, and communicate, send control signal with PLC.
2, medical large transfusion machine vision on-line detection method according to claim 1 is characterized in that the method flow that second order difference combines with the gray scale energy accumulation in the described step (3) is:
1., by importing the image scene that continuous three frames have sampling interval, the target information of intermediate frame is extracted, in the sequence image of continuous acquisition, choose three frame solution sequence image f (t-1)(x, y), f (t)(x, y), f (t+1)(x y) calculates the absolute difference gray level image d of adjacent two frames respectively by following formula (9) and (10) (t-1, t)(x, y) and d (t, t+1)(x, y),
d (t-1,t)(x,y)=|f (t)(x,y)-f (t-1)(x,y)| (9)
d (t,t+1)(x,y)=|f (t+1)(x,y)-f (t)(x,y)| (10);
2., utilize the gray difference of image itself to use a positive number N (2≤N≤5) to amplify this species diversity, make impact point have higher energy, the weighted difference image P that obtains (t-n, t)(x, y) and P (t, t+n)(x, y) as shown in the formula shown in (11) and (12),
P (t-n,t)(x,y)=d (t-n,t)(x,y)×N (11)
P (t,t+n)(x,y)=d (t,t+n)(x,y)×N (12)
Get wherein that to multiply by gray-scale value behind the N be 255 greater than 255 pixel gray-scale value;
3., the difference image after strengthening carries out second order difference and calculates suc as formula (9), second order difference image D (x, y),
D(x,y)=|P (t-n,t)(x,y)-P (t,t+n)(x,y)| (13);
4., press the energy accumulation that following formula (14) calculates two width of cloth difference images, to increase f t(x, y) in the energy of moving particles respective pixel, the energy accumulation image A (x, y),
A(x,y)=P (t-n,t)(x,y)+P (t,t+n)(x,y) (14)
Getting gray-scale value after the addition equally is 255 greater than 255 pixel gray-scale value;
5., (x, y) (x y) subtracts each other with following formula (15), just can obtain f with second order difference image D with the energy accumulation image A at last (t)(x, y) middle particulate gray level image F (t)(x, y),
F (t)(x,y)=A(x,y)-D(x,y) (15)。
3, medical large transfusion machine vision on-line detection method according to claim 1 and 2 is characterized in that adopting in the described step (4) the multistep threshold method to particulate gray level image F (t)(x, y) carry out the idiographic flow that target cuts apart and be:
1., a selected initial threshold is believed T, order:
T = 0.9 Max ( x , y ) &Element; F ( t ) ( x , y ) { F ( t ) ( x , y ) } - - - ( 16 )
Be that T is 90% of an entire image maximum gradation value, t is the number of image;
2., entire image is cut apart by threshold value T, obtain two groups of image G 1, G 2:
Wherein:
G 1 = { F ( t ) ( x , y ) } F ( t ) ( x , y ) &GreaterEqual; T G 2 = { F ( t ) ( x , y ) } F ( t ) ( x , y ) < T - - - ( 17 )
3., calculate G 1And G 2Average gray μ 1, μ 2:
&mu; 1 = &Sigma; ( x , y ) &Element; G 1 F ( t ) ( x , y ) N 1 (18)
&mu; 2 = &Sigma; ( x , y ) &Element; G 2 F ( t ) ( x , y ) N 2
In the formula, N 1With N 2Represent G respectively 1, G 2The number summation of middle pixel;
4., calculate new threshold value T 1:
T 1 = 1 2 ( &mu; 1 + &mu; 2 ) - - - ( 19 ) ;
5., repeat the and 2. went on foot for the 4. step, up to T 1With the absolute difference of T less than predetermined threshold 0.5 till, then obtain global threshold H, H is the T of this moment 1
6., image is cut apart, construct a new bianry image by H:
A ( t ) = ( x , y ) = 0 F ( t ) ( x , y ) &GreaterEqual; H 1 F ( t ) ( x , y ) < H - - - ( 20 )
7., calculate A (t)(x, connected domain y), and identify the center C of each connected domain (t, n)(x, y), wherein t represents the sequence number of the continuous particulate gray level image that obtained by previous step, n indicates the connected domain sequence;
8., at former figure F (t)(x, C y) (t, n)(x, y) with " X " direction to a round-looking scan N pixel, it is more a little bigger to identify three place's shade of gray, shade of gray dL is defined as:
dL=p n+1-p n (21)
P in the formula nBe meant certain any pixel value along N (N is the either direction in " X " direction) direction;
9., calculate final threshold value E, the value of E should be included between the gray scale of above-mentioned three place's shade of gray maximums, by the E value image is carried out secondary splitting, can get and detect target more clearly:
B ( t ) ( x , y ) = 0 F ( t ) ( x , y ) &GreaterEqual; E 1 F ( t ) ( x , y ) < E - - - ( 22 )
For the image that a plurality of detection targets are arranged, detect target according to each and may draw a plurality of threshold values, with this threshold value each target to be cut apart, the result after will cutting apart again at last merges on the image.
4, medical large transfusion machine vision on-line detection method according to claim 1 and 2, the idiographic flow that it is characterized in that described step (5) is: in the target bianry image that obtains by step (4), white portion is numbered, calculate eight connected domains of this white portion, and add up their areas separately, obtain each regional inside longest diameter, the shortest diameter, eccentricity with the boundary line, wherein longest diameter refers to the Euclidean distance of point-to-point transmission maximum, the shortest diameter is meant the straight line vertical with major axis, and the eccentricity of boundary line refers to the longest diameter and the ratio of short diameter.
5, medical large transfusion machine vision on-line detection method according to claim 3, the idiographic flow that it is characterized in that described step (5) is: in the target bianry image that obtains by step (4), white portion is numbered, calculate eight connected domains of this white portion, and add up their areas separately, obtain each regional inside longest diameter, the shortest diameter, eccentricity with the boundary line, wherein longest diameter refers to the Euclidean distance of point-to-point transmission maximum, the shortest diameter is meant the straight line vertical with major axis, and the eccentricity of boundary line refers to the longest diameter and the ratio of short diameter.
CN200710035766A 2007-09-18 2007-09-18 Medical large transfusion machine vision on-line detection method Expired - Fee Related CN100587717C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710035766A CN100587717C (en) 2007-09-18 2007-09-18 Medical large transfusion machine vision on-line detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710035766A CN100587717C (en) 2007-09-18 2007-09-18 Medical large transfusion machine vision on-line detection method

Publications (2)

Publication Number Publication Date
CN101165720A CN101165720A (en) 2008-04-23
CN100587717C true CN100587717C (en) 2010-02-03

Family

ID=39334406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710035766A Expired - Fee Related CN100587717C (en) 2007-09-18 2007-09-18 Medical large transfusion machine vision on-line detection method

Country Status (1)

Country Link
CN (1) CN100587717C (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101738991B (en) * 2008-11-26 2014-09-10 国立成功大学 Method for detecting out-of-specification quality of product and estimating actually measured value of product
CN101819164B (en) * 2010-05-14 2011-06-01 山东大学 Device and method for detecting impurities after filling of beverage
CN101877135B (en) * 2010-06-04 2012-06-20 长安大学 Moving target detecting method based on background reconstruction
CN102797727B (en) * 2012-08-17 2015-11-11 国电联合动力技术有限公司 A kind of Wind turbines oil leakage of hydraulic system detecting method based on CCD and device
CN103514610B (en) * 2013-09-17 2016-01-06 四川虹微技术有限公司 A kind of moving Object Segmentation method of stationary background
CN105334219B (en) * 2015-09-16 2018-03-30 湖南大学 A kind of bottle mouth defect detection method of residual analysis dynamic threshold segmentation
CN107680079B (en) * 2017-09-04 2019-10-29 湖南大学 The high-speed parallel visible detection method of visible foreign matters in a kind of medical pharmacy
CN109166142A (en) * 2018-07-30 2019-01-08 山东大学 The visible detection method of visible foreign matters in a kind of System of Infusion Drugs
CN109445388B (en) * 2018-10-29 2020-01-07 黄莹 Industrial control system data analysis processing device and method based on image recognition
CN109685814B (en) * 2019-01-02 2020-10-23 兰州交通大学 Full-automatic cholecystolithiasis ultrasonic image segmentation method based on MSPCNN
CN110263693A (en) * 2019-06-13 2019-09-20 苏州元联传感技术有限公司 In conjunction with the traffic detection recognition method of inter-frame difference and Bayes classifier
CN112986272A (en) * 2019-12-02 2021-06-18 东华大学 Detection equipment and method for foreign matters in guide hole
CN112362674A (en) * 2020-11-13 2021-02-12 四川科伦药业股份有限公司 Infusion bag foreign matter identification method and detection method based on artificial intelligence vision technology
CN112529877A (en) * 2020-12-15 2021-03-19 中国联合网络通信集团有限公司 Method and device for detecting impurities in bottled liquid
CN113538339A (en) * 2021-06-18 2021-10-22 杭州类脑科技有限公司 Medical image-based long and short path estimation method
CN116934763B (en) * 2023-09-19 2023-12-08 阿普塔恒煜(威海)医疗器材有限公司 Medical rubber plug defect detection method based on visual characteristics

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
PLC 在直线式空瓶检测机中的应用. 段峰,王耀南,段伟,段正华.包装与食品机械,第19卷第6期. 2001 *
基于双重能量累积的红外序列图像目标检测. 孙玉秋,田金文.长江大学学报(自科版),第2卷第1期. 2005 *
基于能量累积与顺序形态滤波的红外小目标检测. 叶斌,彭嘉雄.中国图象图形学报,第7卷第3期. 2002 *
灰度投影结合Fisher 准则的对象分割. 胡正平.计算机工程与设计,第26卷第9期. 2005 *

Also Published As

Publication number Publication date
CN101165720A (en) 2008-04-23

Similar Documents

Publication Publication Date Title
CN100587717C (en) Medical large transfusion machine vision on-line detection method
CN106952257B (en) A kind of curved surface label open defect detection method based on template matching and similarity calculation
Priyadumkol et al. Crack detection on unwashed eggs using image processing
CN105403147B (en) One kind being based on Embedded bottle embryo detection system and detection method
CN101354359B (en) Method for detecting, tracking and recognizing movement visible exogenous impurity in medicine liquid
CN104361353B (en) A kind of application of localization method of area-of-interest in instrument monitoring identification
CN102175693B (en) Machine vision detection method of visual foreign matters in medical medicament
Zhang et al. Vehicle detection in the aerial infrared images via an improved Yolov3 network
CN102930287B (en) A kind of detection number system and method for overlooking pedestrian
CN107392885A (en) A kind of method for detecting infrared puniness target of view-based access control model contrast mechanism
CN104077577A (en) Trademark detection method based on convolutional neural network
CN109102003B (en) Small target detection method and system based on infrared physical characteristic fusion
CN104268853A (en) Infrared image and visible image registering method
CN105893957B (en) View-based access control model lake surface ship detection recognition and tracking method
CN110189375A (en) A kind of images steganalysis method based on monocular vision measurement
CN106709438A (en) Method for collecting statistics of number of people based on video conference
CN107194946A (en) A kind of infrared obvious object detection method based on FPGA
CN106373140A (en) Transparent and semitransparent liquid impurity detection method based on monocular vision
CN103914829B (en) Method for detecting edge of noisy image
CN110335233A (en) Express-way guard-rail plates defect detecting system and method based on image processing techniques
CN101950352B (en) Target detection method capable of removing illumination influence and device thereof
CN101807297B (en) Medical ultrasonic image line detection method
CN102136060A (en) Method for detecting population density
CN103559482A (en) Pedestrian detection method based on edge symmetry
CN103605973B (en) A kind of image character detection and identification method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100203

Termination date: 20180918