Summary of the invention
The object of the present invention is to provide a kind of embedded vision positioning system, be intended to solve the problem that existing vision positioning system location is inaccurate, cost is high.
The present invention realizes like this, a kind of embedded vision positioning system, described system comprises control device, embedded OS and visual performance module, wherein, described control device is for obtaining by the essential information of positioning image, the running environment of described embedded OS is provided, and communicates to connect with described visual performance module; Described embedded OS for providing the running environment of described visual performance module, and communicates to connect with described control device; Described visual performance module is used for realizing being carried out image calibration by positioning image and vision is located.
Preferably, described control device comprises: main frame, display device, input equipment, image capture device, wherein: described main frame is arithmetic core and the control core of described system, for the data in interpre(ta)tive system instruction and handling procedure; Described display device is used for display application program interface and relevant result; Described input equipment is used for running program interface and input numerical value, and described image capture device is for gathering image information.
Preferably, described display device is display screen, described image capture device is industrial camera, described input equipment is resistive touch screen or capacitive touch screen, described display device, described input equipment all connect described main frame, and described image capture device is communicated to connect by USB connecting line and described main frame.
Preferably, described visual performance module comprises vision alignment module, vision locating module and vision measurement module, and wherein, described vision alignment module is used for carrying out pixel alignment and mechanically calibrated to described system; Described vision locating module is for obtaining by the vision elements of a fix of positioning image; Described vision measurement module is gathered the geometry numerical value of image by described image capture device for measuring.
Preferably, described vision alignment module comprises pixel alignment module and mechanically calibrated module, and wherein, described pixel alignment module is for calibrating by the position relationship between the pixel of positioning image and actual range; Described mechanically calibrated module for calibrate plant equipment with by the mechanical location of positioning image.
Preferably, described vision locating module comprises memory module and Data Matching module, and wherein, described memory module is used for storage figure as Template Information; Described Data Matching module is used for determining by the elements of a fix value of positioning image.
Preferably, described embedded OS is built-in Linux operating system.
Technical scheme disclosed in this invention, achieves that embedded vision positioning system layout is simple, accurate positioning, simple to operate, and reduces production cost.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Refer to Fig. 1, be the embedded vision positioning system structure block diagram disclosed in the embodiment of the present invention, for convenience of explanation, illustrate only part related to the present embodiment.As shown in Figure 1, embedded vision positioning system disclosed in the present invention, comprise control device 10, embedded OS 20 and visual performance module 30, wherein, control device 10 is for obtaining by the essential information of positioning image, the running environment of embedded OS 20 is provided, and communicates to connect with visual performance module 30; Embedded OS 20 for providing the running environment of visual performance module 30, and communicates to connect with control device 10; Visual performance module 30 is for realizing being carried out image calibration by positioning image and vision is located.
Can find out by Fig. 1, control device 10 comprises: main frame 101, display device 102, input equipment 103, image capture device 104, wherein: main frame is arithmetic core and the control core of whole embedded vision positioning system, for the data in interpre(ta)tive system instruction and handling procedure; Display device 102 is for display application program interface and relevant result; Input equipment 103 is for running program interface and input numerical value; Image capture device 104 is for gathering by the image information of locating.In the present embodiment, main frame 101 is processor chips based on Cortex-A8 framework and relevant peripherals; Display device 102 is LED display or LCDs, recommendation 7 cun of display screens; Institute's image capture device 104 is industrial camera, and industrial camera is communicated to connect by USB connecting line and main frame 101, main frame 101 also by USB line be industrial camera power and obtain industrial camera gather view data.Input equipment 103 is resistive touch screen or capacitive touch screen.
Visual performance module 30 comprises vision alignment module 301, vision locating module 302 and vision measurement module 303, wherein, vision alignment module 301 is for being carried out pixel alignment and mechanically calibrated by positioning image, usually, vision alignment module 301 comprises mechanically calibrated module and pixel alignment module.Vision locating module 302 is for obtaining by the vision elements of a fix of positioning image; Vision measurement module 303 is for measuring by positioning image geometry numerical value.
Below the principle of work of vision measurement module 303 is set forth.System utilizes after image capture device (such as industrial camera) gathers image, and the region of the display image of operation interface there will be according to the difference of measurement function the measurement point of varying number.Behind position (the general object space according to measuring is placed) suitable in mobile these measurement points to operation interface, and will the command of execution measurement be started to after vision measurement module 303, vision measurement module 303 can perform the instruction of measuring according to following steps:
First the position coordinates of measurement point on the display image of operation interface is obtained, call corresponding measurement function, calculate its geometric parameter at the display image of operation interface, recycle the result of pixel alignment afterwards, namely geometric parameter can be obtained physical distance corresponding to geometric parameter divided by pixel resolution.
Provide following several measurement function at present:
Line segment: the distance of point-to-point transmission.The image coordinate of two measurement points is subtracted each other, and obtains this 2 distance S1 on image, more just can obtain physical distance corresponding to this two measurement points divided by pixel resolution;
Circle: the parameter calculating circle by three coordinate points, as radius.Obtain the coordinate of three measurement points on image, guarantee that these three measurement points are not on same straight line, then call and ask round algorithm to calculate radius of a circle.Namely the physical values of this radius of circle is obtained again divided by pixel resolution;
Arc: similar with solving of circle, also can return arc length except returning radius.
Distance between parallel lines: utilize four measurement points, the first two point forms Article 1 straight line, and latter two point forms Article 2 straight line, whether parallelly calculate two straight lines, if parallel, then return the distance of parallel lines on image, then obtain corresponding physical distance divided by pixel resolution;
Two included angle of straight line: with four measurement points, the first two point forms Article 1 straight line, and latter two point forms Article 2 straight line, calculates the angle of two straight lines.
Concentric circles: utilize six measurement points, first three some formation first circle (3 not conllinear), rear three points form second circle (not conllinear) at 3, calculate the position in two centers of circle, if home position is consistent, the difference then calculating two radius of a circles obtains concentrically ringed thickness, otherwise returns error message.
The object that pixel alignment module carries out pixel alignment obtains each pixel and actual range in image (actual range refers to physical distance, namely the physical distance of each pixel representative is how many, such as 1 pixel=0.01mm, the general inverse with it in use, be defined as pixel resolution, unit is pixel every millimeter) between relation, be generally the distance for determining every millimeter has how many pixels; It is the distance (such as put in glue action, what operating point center referred to is exactly Glue dripping head) calculating industrial camera and operating point center that mechanically calibrated module carries out mechanically calibrated object.Only through pixel alignment and mechanically calibrated after, accurately could carry out vision location.Example is applied as, to pixel alignment and mechanically calibrated process detailed description in addition at a glue platform below with embedded vision positioning system.
Pixel alignment module is to as follows by the pixel alignment process of positioning image: start main frame, visual calibration procedure can start together; Select " vision alignment " function; One is placed the ruler of clear scales below camera; The distance of adjustment camera and ruler, makes clear picture; Determine by the adjacent picture elements of positioning image by operation interface; Pixel alignment module is extracted by the edge line of two of positioning image adjacent picture elements automatically, and the pixel number recorded between two scale strips, thus obtain the relation of pixel and actual range, the physical distance between pixel number/two scale mark namely between pixel resolution=two scale lines
Mechanically calibrated module is to as follows by the mechanical alignment process of positioning image: be fixed on by camera on the Z axis of desktop point glue platform, and is connected with desktop point glue platform by main frame with Serial Port Line; Start desktop point glue platform, main frame and vision alignment module will be activated; Select " mechanically calibrated " function; Plasticine is placed in table plane, by the arrow button reference mark glue platform movement on main frame screen, makes dispensing needle head just to plasticine; Move Z axis at a slow speed by the Z-direction key on main frame screen, stop mobile after making syringe needle extrude an impression on plasticine; Moved in camera view by the impression of the directionkeys on main frame screen by plasticine, and make its blur-free imaging; Tracking cross on moving screen, makes the center superposition of its position and impression; Select " determination " button of operation interface, complete mechanically calibrated function.
Vision locating module 302 comprises memory module and Data Matching module, and wherein, memory module is used for storage figure as Template Information; Data Matching module is used for determining by the elements of a fix value of positioning image.Below for a glue platform, the principle of work of vision locating module 302 is described in detail.
User's mobile industrial camera, the elementary area of the first elements of a fix point A is made to appear in the picture of video camera, camera views is now amplified elementary area, therefore user is easy to see that the center A(A point of elementary area is also the first elements of a fix point), once determining A is the first elements of a fix point, then controller can by the elementary area information transmission residing for the coordinate information value PA1 of A point and A point to vision locating module 302, vision locating module 302 passes through location technology, obtain the coordinate (X in the first elements of a fix point A picture, Y), the controller of main frame is by the coordinate (X of A point, Y) turn and coordinate figure PA1 change after, obtain the coordinate PA of Glue dripping head at the first elements of a fix point A point.
In this embodiment, location technology refers in database finds specific objective image, (i.e. image template) data needing coupling are had in the memory module of known vision locating module 302, and this searched image has identical size, direction and pattern with elementary area, find the position of elementary area in searched image (i.e. image template) by matching algorithm.Refer to Fig. 2 and Fig. 3, Fig. 2 is searched figure S(in database and image template), Fig. 3 is Prototype drawing T(and elementary area).The width of S is W, and height is H; T is the width of elementary area figure, T is n, and height is m., the principle of matching algorithm is as follows:
Elementary area T overlays translation on searched figure S, and the region that elementary area T covers searched figure is called subgraph Sji, and (j, i) is the coordinate of the subgraph upper left corner in searched figure.Following algorithmic formula is followed in hunting zone:
1≤j≤W-n;
1≤i≤H-m
Algorithm is by comparing the similarity of Sji and T, complete matching process, matching process is completed by Data Matching module, concrete matching process is as follows: elementary area T is a mobile pixel in searched figure, new position is compared the similarity c1 of subgraph Sji and T and records coordinate (j, i) herein; Elementary area T moves to next location of pixels again, more herein subgraph Sji and T similarity c2 and record the coordinate (j, i) at this place; Repeat step 2, until j=W-n, i=H-m.
From all similarities, find out the coordinate (j, i) that maximal value is corresponding, namely think that this position is the optimum position of elementary area T in searched figure S.
The acquisition process of second point position coordinate figure PB and the 3rd elements of a fix value PC, with the acquisition process of the first elements of a fix value PA, repeats no more herein.
After user obtains the coordinate points by positioning image, the more manual numerical value inputted by total line number of positioning image and total columns, the controller of main frame automatically can calculate and generate by the image information of positioning image.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.