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; Said system comprises control device, embedded OS and visual performance module, and wherein, said control device is used to obtain the essential information of image of being positioned; The running environment of said embedded OS is provided, and communicates with said visual performance module and to be connected; Said embedded OS is used to provide the running environment of said visual performance module, and communicates with said control device and to be connected; Said visual performance module is used for realizing the image that is positioned is carried out image calibration and vision localization.
More excellent, said control device comprises: main frame, display device, input equipment, image capture device, wherein: said main frame is the arithmetic core and control core of said system, is used for the data of interpre(ta)tive system instruction and handling procedure; Said display device is used to show Application Program Interface and relevant result; Said input equipment is used for running program interface and input value, and said image capture device is used for images acquired information.
More excellent; Said display device is a display screen; Said image capture device is an industrial camera; Said input equipment is resistive touch screen or capacitive touch screen, and said display device, said input equipment all connect said main frame, and said image capture device communicates with said main frame through the USB connecting line and is connected.
More excellent, said visual performance module comprises vision calibration module, vision localization module and vision measurement module, wherein, said vision calibration module is used for said system is carried out pixel alignment and mechanically calibrated; Said vision localization module is used to obtain the vision localization coordinate of image of being positioned; Said vision measurement module is used to measure how much numerical value by said image capture device images acquired.
More excellent, said vision calibration module comprises pixel alignment module and mechanically calibrated module, and wherein, said pixel alignment module is used to calibrate the pixel and the relation of the position between the actual range of image of being positioned; Said mechanically calibrated module is used to calibrate the mechanical location of plant equipment and the image that is positioned.
More excellent, said vision localization module comprises memory module and Data Matching module, wherein, said memory module is used for the memory image Template Information; Said Data Matching module is used for the elements of a fix value to the image of confirming to be positioned.
More excellent, said embedded OS is a built-in Linux operating system.
The disclosed technical scheme of the present invention has realized that embedded vision positioning system layout is simple, accurate positioning, and is simple to operate, and reduced production cost.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
See also Fig. 1, be the disclosed embedded vision positioning system of embodiment of the invention structured flowchart,, only show the part relevant with present embodiment for the ease of explanation.As shown in Figure 1; The disclosed embedded vision positioning system of the present invention; Comprise control device 10, embedded OS 20 and visual performance module 30, wherein, control device 10 is used to obtain the essential information of image of being positioned; The running environment of embedded OS 20 is provided, and communicates with visual performance module 30 and to be connected; Embedded OS 20 is used to provide the running environment of visual performance module 30, and communicates with control device 10 and to be connected; Visual performance module 30 is used for realizing the image that is positioned is carried out image calibration and vision localization.
By finding out among Fig. 1; Control device 10 comprises: main frame 101, display device 102, input equipment 103, image capture device 104, wherein: main frame is the arithmetic core and control core of whole embedded vision positioning system, is used for the data of interpre(ta)tive system instruction and handling procedure; Display device 102 is used to show Application Program Interface and relevant result; Input equipment 103 is used for running program interface and input value; Image capture device 104 is used to gather the image information that is positioned.In the present embodiment, main frame 101 is processor chips and the relevant peripherals based on the Cortex-A8 framework; Display device 102 is LED display or LCDs, recommends to use 7 cun display screens; Institute's image capture device 104 is an industrial camera, and industrial camera communicates with main frame 101 through the USB connecting line and is connected, and main frame 101 is the industrial camera power supply through the USB line also and obtains the view data that industrial camera is gathered.Input equipment 103 is resistive touch screen or capacitive touch screen.
Visual performance module 30 comprises vision calibration module 301, vision localization module 302 and vision measurement module 303; Wherein, Vision calibration module 301 is used for the image that is positioned is carried out pixel alignment and mechanically calibrated, and usually, vision calibration module 301 comprises mechanically calibrated module and pixel alignment module.Vision localization module 302 is used to obtain the vision localization coordinate of image of being positioned; Vision measurement module 303 is used for measuring the image geometry numerical value that is positioned.
Set forth in the face of the principle of work of vision measurement module 303 down.System utilizes after image capture device (such as the industrial camera) images acquired, the measurement point of varying number on the zone of the display image of operation interface, can occur according to the difference of measurement function.Move these measurement points in the operation interface after suitable position (general place) according to the object space that will measure; And after the instruction that will begin to carry out measurement was transferred to vision measurement module 303, vision measurement module 303 can be carried out the instruction of measuring according to following steps:
At first obtain the position coordinates of measurement point on the display image of operation interface; Call corresponding measurement function; Calculate its geometric parameter at the display image of operation interface; Utilize the result of pixel alignment afterwards again, geometric parameter promptly can be obtained geometric parameter corresponding physical distance divided by pixel resolution.
Provide following several kinds of measurement functions at present:
Line segment: the distance of point-to-point transmission.The image coordinate of two measurement points is subtracted each other, obtain these 2 on image apart from S1, just can obtain this two measurement point corresponding physical distances divided by pixel resolution again;
Circle: calculate round parameter with three coordinate points, like radius.Obtain the coordinate of three measurement points on the image, guarantee that these three measurement points not on same straight line, call then and ask round algorithm computation to go out radius of a circle.Promptly obtain the physical values of this radius of circle again divided by pixel resolution;
Arc: similar with finding the solution of circle, except that returning radius, also can return arc length.
Distance between parallel lines: utilize the four measuring point, preceding two points constitute article one straight line, and latter two point constitutes the second straight line; Whether calculate two straight lines parallel; If parallel, then return the distance of parallel lines on image, obtain the corresponding physical distance divided by pixel resolution again;
Two included angle of straight line: use the four measuring point, preceding two points constitute article one straight line, and latter two point constitutes the second straight line, calculates the angle of two straight lines.
Concentric circles: utilize six measurement points; First three point constitutes first circle (not conllinear) at 3; Three points in back constitute second circle (not conllinear) at 3, calculate the position in two centers of circle, if home position is consistent; The difference of then calculating two radius of a circles obtains concentrically ringed thickness, otherwise returns error message.
The purpose that the pixel alignment module is carried out pixel alignment is to obtain in the image each pixel and actual range (actual range refers to physical distance; How many physical distances that is each pixel representative is; Such as 1 pixel=0.01mm, generally use its inverse in use, be defined as pixel resolution; Unit is every millimeter of a pixel) between relation, generally be to be used for confirming on every mm distance what pixels are arranged; It is the distance (in a glue action, what the operating point center referred to is exactly Glue dripping head) that calculates industrial camera and operating point center that mechanically calibrated module is carried out mechanically calibrated purpose.Only through pixel alignment and mechanically calibrated after, could accurately carry out vision localization.Below with the be applied as example of embedded vision positioning system, to pixel alignment and the mechanically calibrated detailed in addition explanation of process at a glue platform.
The pixel alignment module is following to the pixel alignment process of the image that is positioned: start main frame, visual calibration procedure can start together; Select " vision calibration " function; Below camera, place one scale ruler clearly; The distance of adjustment camera and ruler makes clear picture; Through operation interface confirm the to be positioned adjacent picture elements of image; The pixel alignment module is extracted the edge line of two adjacent picture elements of the image that is positioned automatically; And write down two pixel numbers between the scale strip; Thereby obtain the relation of pixel and actual range, i.e. physical distance between pixel number/two scale marks between pixel resolution=two scale lines
Mechanically calibrated module is following to the mechanically calibrated process of the image that is positioned: camera fixing on the Z axle of desktop point glue platform, and is connected main frame with Serial Port Line with desktop point glue platform; Start desktop point glue platform, main frame and vision calibration module will be activated; Select " mechanically calibrated " function; Plasticine is placed on the table plane, moves, make dispensing needle head over against plasticine through the arrow button reference mark glue platform on the main frame screen; Move the Z axle at a slow speed through the Z-direction key on the main frame screen, make syringe needle after extruding an impression on the plasticine, stop to move; Move in the camera view through the impression of the directionkeys on the main frame screen, and make its blur-free imaging plasticine; Tracking cross on the moving screen makes its position overlap with the center of impression; " confirming " button at selection operation interface is accomplished mechanically calibrated function.
Vision localization module 302 comprises memory module and Data Matching module, and wherein, memory module is used for the memory image Template Information; The Data Matching module is used for the elements of a fix value to the image of confirming to be positioned.Be example with a glue platform below, the principle of work of vision localization module 302 is described in detail.
User's mobile industrial camera; The elementary area of first elements of a fix point A is appeared in the picture of video camera, and camera views is amplified elementary area this moment, so the user is easy to see the center A (the A point also is first elements of a fix point) of elementary area; In case having confirmed A is first elements of a fix points; Then controller can be given vision localization module 302 with coordinate information value PA1 and the residing elementary area information transmission of A point that A is ordered, and vision localization module 302 obtains the coordinate (X in first elements of a fix point A picture through location technology; Y); (X Y) after commentaries on classics and the coordinate figure PA1 conversion, obtains the coordinate PA that Glue dripping head is ordered at first elements of a fix point A to the coordinate that the controller of main frame is ordered A.
In this embodiment; Location technology refers to and seeks the specific objective image in the database; (the being image template) data that need coupling are arranged in the memory module of known vision localization module 302; And should identical size, direction and pattern be arranged by searching image and elementary area, find elementary area by the position in the searching image (being image template) through matching algorithm.See also Fig. 2 and Fig. 3,, Fig. 2 be in the database by search graph S (being image template), Fig. 3 is template figure T (being elementary area).The width of S is W, and height is H; T is elementary area figure, and the width of T is n, and height is m., the principle of matching algorithm is following:
Elementary area T overlays by search graph S and goes up translation, and elementary area T covers and is called subgraph Sji by the zone of search graph, and (j is the subgraph upper left corner by the coordinate in the search graph i).Following algorithmic formula is followed in the hunting zone:
1≤j≤W-n?;
1≤i≤H-m
Algorithm is through comparing the similarity of Sji and T; Accomplish matching process, matching process is accomplished through the Data Matching module, and concrete matching process is following: elementary area T moves a pixel in by search graph; On new position relatively the similarity c1 of subgraph Sji and T and write down here coordinate (j, i); Elementary area T moves to next location of pixels again, more here the similarity c2 of subgraph Sji and T and write down this place coordinate (j, i); Repeating step 2, up to j=W-n, i=H-m.
(j i), thinks that promptly this position is elementary area T by the optimum position among the search graph S from all similarities, to find out the corresponding coordinate of maximal value.
The acquisition process of the second position coordinate value PB and the 3rd elements of a fix value PC repeats no more with the acquisition process of first elements of a fix value PA here.
The user has obtained to be positioned after the coordinate points of image, manual again input the be positioned total line number of image and the numerical value of total columns, and the controller of main frame can calculate the image information that generates the image that is positioned automatically.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.