The specific embodiment
In Fig. 1, the machine that is used for manipulating toxic substances is represented with 1 on the whole, this machine comprises: storage device 2 (being schematically shown by a parallelepiped), be used for container 3 such as capsule, arrow-necked bottle etc., these containers are used for the necessary poisonous and nontoxic material of medication preparation, in the described container each is provided with mouth 4, but respective cap 5 sealings that this mouth has axis 4a and made by perforated material; Dispensing table 6, wherein be provided with drug dispensing component 7, this drug dispensing component has three seats 8 that are designed to keep the syringe 9 of same quantity, these syringes are various forms of commercial type syringes, promptly, the syringe of such type, it comprises columniform body 10, is assemblied in the pin 11 at body 10 1 end places, plunger 12 in axial sliding in body 10; And anthropomorphic robot 13, it is provided with clamping head 14, this clamping head comprises holder 15 that is designed to holding vessels 3 and the articulated jib with six-freedom degree (articulated arm) 16, this articulated jib is designed to supporting member 14 so that container 3 can be sent to dispensing table 6 and then make the pin 11 of container 3 self near described syringe 9 by this way at the point corresponding to syringe 9 from storage device 2, that is, thus pin 11 is by penetrating in the container 3 medicated cap 5.
In addition, machine 1 is provided with control unit 17, and this control unit is used to the startup controlling robot 13, drug dispensing component 7 and be used for the member (not shown) of mobile storage device 2.Drug dispensing component 7 and robot 13 are contained in the aseptic cabin (not shown) that communicates with storage device 2, pollute medicine to prevent antibacterial or microorganism during the preparation of medicine.
Drug dispensing component 7 comprises the platform 18 that rotates around horizontal axis 18a, and three seats 8 that are used for syringe are installed on described platform 18.Each seat 8 includes: clamping element 19, and it is vertical substantially that this clamping element makes the longitudinal axis 9a of syringe 9 simultaneously with respect to platform 18 fixing bodies 10 with maintenance syringe 9; And actuation element 20, thereby be used for withdrawing plunger 12 with a certain amount of material suction syringe 9 or be used for plunger depressed 12 so that a certain amount of material is expelled in the container 3.Actuation element 20 is connected to each other rigidly by bar 21, and described bar is designed to vertically move along the linear guide 22 that forms on platform 18.The rotation of platform 18 can make that (in this position, the end of pin 11 upwards) (in this position, pin 11 downwards terminal changes direction between as shown in fig. 1) to syringe 9 with material being expelled to position in the container in the position of suction material.
This machine also comprises: the black and white that focuses simulated television video camera 23, and it is provided with the synthetic output device (not shown) of video, and is installed on 14 in mode regularly; And computer 24 (for example PC framework type computer), thereby its be connected to hospital computer system 25 be used for television camera 23 exchange about the data of preparation medicine obtain detected image and with control unit 17 exchanges about the data of preparation medicine above-mentioned member with control machine 1.
With reference to figure 2,14 holder 15 comprises two jaws 26, and these two jaws move along slip axis 26a, and by mutually near and the motion that retreats distinguish clamping and release container 3.Television camera 23 is installed on 14, and the optical axis 23a of television camera self is perpendicular to the residing plane of slip axis 26a.
Computer 24 comprises: image pick-up card 27, and its " frame grabber " type that is known, and have the synthetic input equipment (not shown) of video of the synthetic output device of video that is connected to television camera 23; Interface unit 28, touch screen for example is to realize the operation mutual with machine 1; Processing unit 29, it is designed to handle about the data of medicine and the image of acquisition, so that determine the order to control unit 17 to be sent; And communication unit 30, it is connected to control unit 17 and is connected to hospital computer system 25.
Being loaded in the processing unit 29 is control sequence, and this control sequence is designed to when implementing according to the method that is used for manipulating toxic substances of the present invention when moving on one's body at processing unit 29.
In order to simplify description, hereinafter will be with reference to the material of aequum is injected into processing example the container 3 from syringe 9, in wherein said syringe 9 has been located in the corresponding seat 8 and described material has been packed into the body 10.
In described example, this method is to arm 16 control of robot 13, so that pick up container 3 and be sent to the dispensing table 6 from storage device 2, and basically meanwhile, platform 18 rotates so that syringe 9 enters injection position, that is, pin 11 is faced down.At this moment, arm 16 is positioned at container 3 below of pin 11 and makes mouth 4 towards last.Arm makes the mouth 4 of container 3 axially aim at pin 11, that is, its axis 4a that makes mouth 4 basically with the dead in line of pin 11.Subsequently, arm vertically raises container 3 towards pin 11 by this way, that is, pin 11 is after passing medicated cap 5, and its sizable part is thrust in the container 3.At last, actuation element 20 is moved down, so that plunger 12 is pressed in the body 10 of syringe 9 and makes plunger just be enough to the material of requirement is expelled in the container 3.
According to the present invention, the mouth 4 of container 3 is designed to pin 11 axially aligned steps: two images that obtain pin 11 from two different separately points of observation; Handle described image with the position of the end of definite pin 11 and the gradient (being the gradient of the axis of pin 11) of pin 11 with respect to the axis 9a of syringe 9; And the people's 13 that starts the machine arm 16, so that come the position of Calibration Head 14 according to the gradient of the position of the end of pin 11 and pin 11, and and then the position of proofreading and correct container 3.Particularly, two treatment of picture are substantially: determine to calculate as the terminal position of the pin 11 of the function of described coordinate and the gradient of pin 11 along the space coordinates of two points of pin 11 and on the basis of known optical triangulation method principle at each image.
With reference to figure 3, identify the point of a section of having expressed pin 11 with P, this is expressed with respect to the cartesian coordinate system with three axle X, Y, Z, and its axis Z is perpendicular to the drawing plane, and the axis 9a of syringe 9 is parallel to a Z.In Fig. 3, represent two different finding a view (framing) direction perpendicular to axle Z with FT and FS.Being limited on view direction FT and the FS is two corresponding point of observation OT and OS, and these two points of observation are arranged on the substantially the same distance of range points P.In order to obtain image from each point of observation OT and OS, the arm 16 of robot 13 moves and makes 14 to rotate around axle Z, make optical axis 23a be parallel to view direction FT among the point of observation OT simultaneously thereby at first television camera 23 is positioned at, television camera is positioned at makes optical axis be parallel to view direction FS among the point of observation OS simultaneously subsequently.
It should be noted that if view direction FT is vertical mutually with FS then optical triangulation method will produce optimum result.Yet,, form acute angle between view direction FT and the FS for the mode with the external overall dimensions that reduces aseptic cabin limits the moving range of the arm 16 of robot 13.Particularly, refer again to Fig. 3, view direction FT and FS and an axle Y have formed two corresponding angle [alpha] and β, and view direction FT and FS be perpendicular to two planes of finding a view accordingly, and each plane limits by axle Z and perpendicular to corresponding axis t, the s of axle Z respectively.The value of angle [alpha] and β be make them and (alpha+beta) less than 90 °, and more specifically smaller or equal to 40 °.Point P with respect to the coordinate of cartesian axis X and Y by X
PAnd Y
PExpression, and some P with respect to the coordinate of axle t and s by t
pAnd s
pExpression.Under any circumstance, the coordinate with respect to axle t and s can come with reference to Descartes's referential by following triangular transformation:
In order to determine the gradient of pin 11, must determine at least two points of pin 11 processes, these two points will be represented by P1 and P2 hereinafter.In case known cartesian coordinate X2, Y2, the Z2 of cartesian coordinate X1, Y1, Z1 and the some P2 of some P1, just can draw gradient by following triangle relation formula:
Wherein RX and RY are the angles that forms with axle X and Y respectively in the projection of the part between a P1 and the P2 on plane X-Z and Y-Z of pin 11.
Fig. 4 shows to have described and handles flow chart with the gradient of the terminal position of determining
pin 11 and
pin 11 to obtain two images from corresponding point of observation OT and OS.Fig. 5 subsequently, 6 and 7 is sketch maps of some steps of described processing.Flame Image Process is carried out in the part of described control sequence, and described control sequence is with known programming language
Write and
Be assembled into data chained library (DLL) in the environment.
With reference to figure 4, the image of pin 11 at first obtains (module 100) by image pick-up card 27 with data mode, after this limit region-of-interest 31 (Fig. 5 of image,), that is, the rectangle part of image will be searched pin 11 (module 101) in this region-of-interest 31, and then the picture contrast threshold value is adjusted to minima, surpass this threshold value and just can detect pin (module 102).Region-of-interest 31 is to operate by the screening of the image of pin 11 being carried out known type to limit.
From the bottom (z=zi, Fig. 5) beginning delegation connects delegation ground and checks region-of-interest 31 (module 103), and searches the edge in described each enterprising line scanning of row so that use is called as the function of " IMAQEdge Tool ", and above-mentioned function setup is useful on
The storehouse that is called as IMAQ Vision of language (module 104).Under the situation of finding edge (from module 105 output YES), then verify to assess terminal compatible that described edge whether can be with
pin 11, promptly, whether described edge falls in compatibility area (compatibility area) 32 (Fig. 5), this compatibility area is defined as the given rectangle part in the region-of-
interest 31, and the end of
expectation pin 11 is positioned (module 106) in this given rectangle part.If do not find the edge, then check next line (z=z+dz, Fig. 5) (module 107).Do not find under the situation of any edge (from module 108 output YES) at the row (zmax) that arrives the number maximum, then produce the error message (module 109) of " pin can not be discerned " type.
If the edge of being found is compatible (from module 106 output YES), then from image, extract the coordinate at described edge, described edge is corresponding to first P1 that searches and the end (Fig. 5) (module 110) that limits pin 11; In addition, contrast threshold (module 111) is increased specified rate so that make the quality that the search of pin 11 is adapted to image, and since the first capable inspection (module 103) that repeats region-of-interest.But in compatibility area, do not find under the situation of any edge (from module 112 output YES) error message (module 109) that then produces " pin is in non-desired locations " type at the maximum that has reached contrast threshold.
After the coordinate of the some P1 that has determined to represent pin 11 ends, determine second P2 of pin 11 processes.
Particularly, the row that forwards capable scheduled volume (OFFSET) row of point of distance P1 to is checked (Fig. 6) (module 113), contrast threshold is adjusted to maximum (module 114), and in described row, scans so that search edge (module 115) with above-mentioned " IMAQ Edge Tool " function.
As long as found edge (from module 116 output YES), whether then verify to be evaluated at the first edge EF and the distance between the final edge EL found in the described row is compatible with the lateral dimension of pin 11, promptly, in given tolerance, whether described distance equals the diameter (module 117) of pin 11.Under the situation of not finding the distance incompatible with the size of pin 11 (from module 117 output NO) between edge (from module 116 output NO) or edge EF and the EL, then contrast threshold is reduced specified rate (module 118) and repeat the described line scanning of advancing (module 115).But do not find under the situation of the distance incompatible with the size of pin 11 (from module 119 output YES) between any edge or edge EF and the EL error message (module 119) that then produces " pin can not be discerned " type in the minima that reaches contrast threshold.
If the distance between edge EF that finds in described row and the EL and the size of pin 11 are compatible (from module 117 output YES), then put P2 and be calculated as intermediate point (Fig. 7) (module 120) between the point of determining by edge EF and EL.
It should be noted that the some P1 that provided by module 110 and 120 and the coordinate of P2 represent with pixel.Therefore, after determining some P2, undertaken the coordinate of a P1 and P2 is become the operation of millimeter (module 121) from pixel transitions, will be described below this operation by using the conversion coefficient that from calibration steps, obtains.
Each image in two images that obtain all repeated to carry out the algorithm (module 122) that limits by module 100 to 121.By this way, from the image that obtains from point of observation OT and what obtain is a P1 and the P2 coordinate with respect to axle t and z, and from the image that obtains from point of observation OS and what obtain is a P1 and the P2 coordinate with respect to axle s and z.Generally, coordinate t2, s2, the z2 of coordinate t1, s1, z1 and the some P2 of some P1 have been obtained.
At this moment, use expression formula (1) and (2) obtaining, and application expression formula (3) and (4) is calculated the gradient (module 124) as the pin 11 of the function of the coordinate of two some P1 and P2 as the cartesian coordinate X1 of the function of coordinate s1 and t1 and Y1 and as the cartesian coordinate X2 and the Y2 (module 123) of the function of coordinate s2 and t2.
About aforementioned calibration steps, it was carried out before any preparation of medicine, and this calibration steps is designed to obtain and is fixed in the normal place other three images of pin 11 of the syringe 9 of (for example, be contained in the corresponding seat 8 and make the terminal surface of pin 11 downward).Television camera 23 is positioned at (for example in an OT) in one of them point of observation and makes after optical axis 23a is parallel to corresponding view direction FT at arm 16, write down first image in the described other image by robot 13.After passing through arm 16 mobile TV video cameras 23 once more, obtain second image and the 3rd image, television camera for the first time only for the second time only moves through the corresponding known quantity of representing with millimeter along axle Z along axle t separately, and the axis 9a that keeps at a distance apart from substantially constant.By utilizing aforesaid algorithm, calculate of the displacement of the pixel of pin 11 in second image and the 3rd image with respect to the position that is recorded in the pin 11 in first image, and then, ratio by between the displacement of calculating the displacement represented with millimeter and representing with pixel has just obtained two conversion coefficients from the pixel to the millimeter.
According to still another embodiment of the invention, as shown in Figure 8, it shows a new flow chart, yet wherein, with corresponding some modules of the module of having described with Fig. 4 in the identical label of used label identify, and once more shown in Fig. 9 to 11, wherein with the element corresponding elements of describing respectively with Fig. 5 to 7 in the identical label of used label identify, the region-of-interest 31 of each data image by handling pin 11 is in a different manner determined the some P1 and the P2 that are searched.
Each data image of pin 11 constitutes by the picture element matrix that obtains according to known data acquisition technology.Therefore, Dui Ying region-of-interest 31 is made of the submatrix of described picture element matrix.
Fig. 9 shows a part of image 33 of region-of-interest 31 in a simplified manner, wherein can notice the end of pin 11.This part shown image 33 is divided into a plurality of pixels.Those pixels corresponding to the end of pin 11 are represented with oblique line.The position of relative pixel PX in the compatibility area 32 determined by a pair of coordinate of representing with pixel, and this represents with respect to axle Z in the coordinate first and identified by r, and this to second in the coordinate with respect to axle t, s represents and is identified by c.In fact, coordinate r has determined one-row pixels, and coordinate c has determined the string pixel.
In Figure 10 and 11, show that part of image 33 identical in some treatment step processes of the flow chart of Fig. 8 with Fig. 9, for the purpose of clearer, only some pixels with the end of pin 11 illustrate with oblique line.
With reference to Fig. 8, at the image that obtains pin 11 and determined corresponding region-of-interest 31 (module 100 and 101) afterwards, (pixel intensity threshold) sets predetermined value (module 200) for the pixel intensity threshold value.Selectively, the value of luminance threshold can be regulated by the operator.
Then, begin to check region-of-interest 31 (module 201) from minimum pixel column (r=0) by pixel column.In each pixel column (determining) by relative coordinate (generic coordinate) r, with respect to search the first pixel PXF and last pixel PXL (Figure 10) along the predetermined search direction 34 (Figure 10) of this pixel column, the brightness of these two pixels is higher than luminance threshold (module 202).Coordinate c, the r of pixel PXF are stored in the correspondence position of the first pixel vectors VF, and the coordinate of pixel PXL is stored in the correspondence position of the second pixel vectors VL (module 203).Subsequently, check next pixel column (r=r+1) (module 204), thereby each pixel column is repeated to be stored among the corresponding vectorial VF and VL, up to the row (r=rmax) (module 205) of the maximum number that arrives region-of-interest 31 for the search of pixel PXF and PXL and with them.These two pixel vectors VF and VL implement in the internal storage (not shown) of processing unit 29 (Fig. 2).
At this moment, carry out the linearisation circulation to determine two straight lines according to two vectorial VF and VL, these two straight lines can accurately be determined the gradient of the terminal position and the pin 11 of pin 11.
Particularly, with reference to Fig. 8 and 11, after cyclic variable I being initialized to zero (module 206), this cyclic design becomes at first to be carried out calculating first straight line (being identified by LF) on the basis of linear interpolation in Figure 11 to being stored in coordinate among the vectorial VF, and is carrying out calculating second straight line (being identified by LL) (module 207) on the basis of linear interpolation in Figure 11 to being stored in coordinate among another vectorial VL.Straight line LF is represented by following equation:
c=MF·r+QF,(5)
And straight line LL is represented by following equation:
c=ML·r+QL,(6)
Wherein, MF and ML are coefficient of angularities, and QF and QL are the side-play amounts of respective straight LF and LL.
Subsequently, check that first condition is about coefficient of angularity MF and ML, promptly so that satisfied the calculating whether correct (module 208) of verifying straight line LF and LL on the basis of following two conditions whether, whether the absolute value of their difference is less than preset limit difference DM
|MF-ML|<DM, (7)
And second condition be about side-play amount (offset) QF and QL, that is, whether their difference is included between predetermined lowest difference DQmin and the predetermined maximum DQmax of difference,
DQmin<(QF-QL)<DQmax. (8)
Limit difference DM preferably equals 0.2.Lowest difference preferably equals 10, and maximum difference DQmax preferably equals 200 pixels.
If at least one in two conditions (7) and (8) do not satisfy (from module 208 output NO), then produce error message (module 109) and termination.Otherwise promptly, if (from module 208 output YES) are all satisfied in condition (7) and (8), then program is carried out according to described below.
This paired pixel PXF, PXL from vectorial VF and VL, have been rejected, promptly, this paired pixel drops on outside the shape of pin 11 ends that limited by a part of plane that is included between straight line LF and the LL, and this paired pixel separates scheduled volume (module 209) along corresponding pixel column with straight line LF and LL self.Particularly, this disallowable paired pixel PXF, PXL must satisfy at least one in following two conditions.First of described condition is to have increased the coordinate c (being represented by c_PXF) of pixel PXF of target offset S less than the corresponding coordinate c_LF of the coordinate r with pixel PXF self that is provided by equation (5), that is,
c_PXF_+S<c_LF,(9)
Another condition is to have reduced the coordinate c (hereinafter being represented by c_PXL) of pixel PXL of deviation (deviation) S greater than the corresponding coordinate c_LL of the coordinate r with pixel PXL self that is provided by equation (6), that is,
c_PXL-S<c_LL.(10)
In Figure 11, what represented by PXFe, PXLe is wherein a pair of in the paired pixel of wanting disallowable.
At this moment, make cyclic variable I increase (I=I+1) (module 210), and the calculating of straight line LF and LL repeats as the function of vectorial VF after upgrading and VL, and up to reaching maximum number of repetitions Imax, this maximum number of repetitions preferably equals 3 or 4 (modules 211).
First P1 that is searched is defined as the function of a pair of pixel PXF1, PXL1, from all paired pixel PXF, PXL of being stored among vectorial VF and the VL, and this has the coordinate r (being represented by r1 hereinafter) of minima and remains essentially in (module 212) in the shape that is limited by straight line LF and FF pixel to pixel for this.Particularly, selected this must satisfy two further conditions to pixel PXF1, PXL1: corresponding coordinate c_PXF and the distance between the c_PXL are less than preset distance DPX, just
|c_PXF-c_PXL|<DPX;(11)
If there is not tolerance TPX, the average of coordinate c_PXF and c_PXL (mean) (hereinafter being represented by c1) is included between the straight line LF and LL corresponding to coordinate r1, just
c_LF<|c1-TPX?|<c_LL.(12)
Pixel c1 of Que Dinging and the coordinate among the r1 have determined to be in the some P1 on the plane of the image that obtains thus.
For second P2 that determine to search, the 3rd straight line LN calculates (Figure 11) (module 213) as the vector sum of the direction of being determined by two straight line LF and LL.Represented the gradient of pin 11 by the direction that straight line LN determines with respect to the axis 9a in the plane of image section 33.Described vector sum is to calculate as the average coefficient of angularity Mm of the meansigma methods of two coefficient of angularity MF and ML and as the mean shift amount Qm of the meansigma methods between side-play amount QF and the QL.Therefore, straight line LN limits by average coefficient of angularity Mm and by mean shift amount Qm.
Determine that on the plane of obtaining image coordinate second P2 being searched, that represent with pixel provides (module 214) by the intersection point of straight line LN and a pixel column (distance that this pixel column is set in distance row r1 equals the position that the line number amount is OFFSET), so be defined as coordinate:
r2=r1+OFFSET.(13)
Realize this step by simple triangulation calculation method.Pixel column with coordinate r2 does not have shown in Figure 11, just puts P2, will put P2 and be specified to point of distance P1 as far as possible, and particularly, the limit superior (r=rmax) that is in region-of-interest 31 is located, and therefore is in the outside of the image section 33 of example illustrated.
With with the similar mode of the flow chart of Fig. 4, the coordinate transformation of representing with pixel of a P1 and P2 is become the coordinate of representing with millimeter (module 121), and all repeat to carry out the algorithm (module 122) that limits by module 100,121,200 to 214 and 121 in two images that obtained each, thereby the gradient of pin 11 in cartesian space calculated (module 123 and 124) as the function of the cartesian coordinate of P1 and P2.
From above-mentioned description, can know clearly, according to the present invention, the mouth 4 of container 3 can be used in any position of syringe 9 with the axially aligning equally of pin 11 of syringe 9, for example, use in the position of syringe suction material, syringe 9 is oriented such that the terminal surface of pin 11 makes progress in this position.Under this situation, in fact, the arm 16 of control robot 13 is so that 14 move and rotate, thereby container 3 put upside down and mouth 4 is faced down, and container is set in the terminal top of pin 11, and a television camera 23 that meanwhile also will be installed on 14 is put upside down.Therefore, the image that obtains by television camera 23 gives expression to pin 11 in the mode of pin terminal surface to the image bottom once more.
Above-mentionedly be used for the method for manipulating toxic substances and the major advantage of machine 1 is: between the pin 11 of the mouth 4 of container 3 and syringe 9, realized axially aligning accurately, thereby made pin 11 also can insert by the minimum mouth 4 of size.In fact, can realize alignment error less than 0.5mm.In addition, even under pin is crooked situation, suitable axially aligning also can allow pin 11 to extract material effectively.