A kind of monocular vision pose measuring method based on Davinci technology and system
Technical field
The invention provides a kind of monocular vision pose measuring method based on Davinci technology and system, belong to vision-based detection
Technical field.
Background technology
Vision detection technology is the emerging measurement technology of developed over nearly twenties years, have employed a large amount of automatization, intelligence
Change technology, by computer identification and control, measurement process only needs little manual intervention just can complete.Along with vision skill
The development of art is ripe so that it obtains a wide range of applications in fields such as industry, medical science, Aero-Space, military affairs.
Vision technique can substitute for the mankind and carries out size detection, target tracking, robot navigation etc., and high for repeatability,
The application that non-touch precision measurement, acquisition of information are rapid and site environment is severe is more suitable for.
Great majority are all based on PC end to the research of vision measurement at present, because its volume is big, power consumption is high, the most applicable
Airborne, the most how to be applied in vision detection technology gradually receive publicity by embedded technology, and be increasingly becoming research
Focus.But vision-based detection related algorithm is complicated, and image procossing is computationally intensive, and the real time problems of tracking is had always
Effect solves, and wherein the performance of hardware platform and the efficiency of software algorithm are two big influence factors, therefore, still must in this field
Do substantial amounts of research work.
Image acquisition hardware plateform system in vision measurement system mainly includes with lower part: image acquisition units, image
Processing and analysis unit, data storage cell and control feedback unit.Wherein, image acquisition units is computer vision system
The critical component of middle acquisition information, its most essential function is exactly to convert optical signals into into the orderly signal of telecommunication and by one
Fixed mode is transferred to signal processing platform.And the design of image acquisition units mainly has with optical sensor and interface thereof
Close.
Traditional vision measurement system is mostly based on " CCD ten video frequency signal processing chip+CPLD/FPGA+DSP " framework
's.Current this framework relative maturity, but ccd sensor needs a considerable number of outside support circuit, at power supply pipe
Difficulty in reason circuit design is higher.Its power consumption and volume are relatively big, and hardware designs is complicated, and development difficulty is bigger.
Cmos sensor has that volume is little, low in energy consumption, high integration, Novel USB interface and infrared interface technology this
A little prominent advantages.The probability of the miscellaneous point of its original appearance is the biggest, it is easy to be disturbed the most ripe product of impact the most all
Can compensate from late-class circuit and optimize so that the photographic head finished product of COMS technology becomes leading market product.
USB interface-based COMS camera need not extra collecting device can obtain real-time uncompressed video data
With the seizure to image.But its transmitting procedure relates to complex communication agreement, if based on traditional " CPLD/FPGA
+ DSP " framework, need to build considerably complicated logic circuit and manage.And arm processor can be very in this kind of system
Good performance controls function, it is only necessary to the USB Host within Shi Yonging drives and receives photographic head data, it is possible to obtained
Whole or compressed image or video.In terms of the storage and process of image, for oneself through upper operating system
This image acquisition and processing platform, image can be stored in the process to data inside file system as file.And it is single
The arm processor of one is the most inadequate when processing complicated image algorithm, it is impossible to the task that competent computational complexity is higher.
The programmability of dsp chip and powerful disposal ability so that it is can be used for realizing various Digital Signal Processing rapidly and calculate
Method, becomes the optimum selection of current image processing system.Therefore, it is proposed that use " COMS+ARM+DSP " framework
Build vision measurement hardware platform.The isomery that Leonardo da Vinci's series processors of TI company is integrated with ARM and DSP is double
Core processor so that Leonardo da Vinci's processor has possessed the respective advantage of ARM and DSP, can meet application demand well.
The most domestic research for monocular vision pose measurement system, mostly also in the theoretical simulation stage, does not also have molding
Product.Monocular vision pose measuring method is also mostly based on PC end, depends on OpenCV computer vision storehouse.By
In having the powerful hardware of PC as guarantee, during application and development, need not too much consideration overhead problem,
OpenCV vision storehouse provides abundant vision processing algorithm, and simplify algorithm realizes difficulty.But in view of PC body
Type is not easy to greatly popularization and application, and along with the development of embedded technology, relevant hardware platform performance promotes further, allows embedding
Enter formula platform visual pattern process related application also is able to preferably support.And embedded itself have low-power consumption and
The feature of low cost so that vision measurement system based on embedded technology is of increased attention.Therefore, grind
The monocular vision pose measurement system studying carefully a kind of high efficient and reliable is necessary.
Summary of the invention
The invention provides a kind of monocular vision pose measuring method based on Davinci technology and system, solve background skill
Deficiency in art, the method uses methods based on four coplanar donut marks, the most permissible by gathering an image
Estimating the posture information of object, for ease of identifying the corresponding relation of circle, the size of four annulus all differs.
The method has that simple in construction, camera calibration be simple, in-site installation, the debugging advantage such as easily, also avoid solid simultaneously
The deficiency that in vision, visual field is little, Stereo matching is difficult.
Realizing the technical scheme that above-mentioned purpose of the present invention used is:
A kind of monocular vision pose measuring method based on Davinci technology, comprises the following steps:
(1) image binaryzation
Otsu method is used acquired pose image to be carried out binaryzation, gray value from the gray value side of image figure
Collection share threshold value T and is divided into two classes, then according to the meansigma methods variance of two classifications and the ratio of all kinds of variances be maximum come true
Determine threshold value T;
(2) feature point extraction
First extract all profiles in whole Zhang Weizi image, check whether as circle successively according to the character of circle, if circle is then
Extract barycenter;Travel through all of profile, it may be judged whether the pixel sum of profile is in a scope;Total by pixel
Number, filters out a part and is unlikely to be round profile;Use RANSAC algorithm to carry out Circular curve fitting, determine the center of circle,
Sort successively according to annulus size, find position corresponding relation between annulus;
(3) pose resolves
Process, according to previous image, the characteristic parameter combining camera calibrating parameters obtained and solve relative pose, set up image coordinate
And the mutual relation between locus, OwRepresenting real space coordinate system, Oc represents camera coordinates system initial point, (U, V)
It is expressed as image plane;
From OwCoordinate is tied to the transformational relation such as formula (1) between (U, V) imaging plane,
Wherein, R and T represents camera coordinates system and the attitude of world coordinate system and evolution matrix respectively, and f is camera
Focal length, dxAnd dyIt is pixel size on xy direction, utilizes the central coordinate of circle in the cooperative target extracted with corresponding
Phase point coordinates constitutes two-dimensional imaging plane and three dimensional practicality spatial match point pair, in conjunction with the inside and outside ginseng of the camera in formula (1)
Matrix number, utilizes P4P algorithm to carry out pose resolving, i.e. can get the posture information of cooperative target.
The present invention additionally provides pose measurement system based on said method simultaneously, at least includes cooperative target template, pose
Image acquisition units, graphics processing unit, power supply and display memory element, it is characterised in that: cooperative target template is carried
On object, described cooperative target template is four coplanar annulus, and the size of four annulus all differs;
Described pose image acquisition units is USB interface-based COMS camera, and described COMS camera includes image
Transducing part, signal read circuit and control circuit, image sensing part, signal read circuit and control circuit are integrated in
On chip piece, pose image acquisition units is connected with graphics processing unit, pose view data is connect by USB
Mouth output is to graphics processing unit;Described graphics processing unit receives pose view data by USB interface, through intelligence
Can be after image processing algorithm process, by intelligent algorithm result and original image through network interface or Serial Port Transmission to showing storage
Module shows and preserves, and wherein, intelligent image Processing Algorithm includes that image binaryzation, feature point extraction and pose resolve three
Part;Described power supply is for powering to graphics processing unit;Described image-display units is connected with graphics processing unit, real
Time receive, show and store raw image data and the intelligent algorithm result of graphics processing unit output, and can be right
Camera parameter and store path are configured, by display measurement system precision and reliability.
Described graphics processing unit uses the STM320DM8148 hardware platform of TI company, and it has been internally integrated ARM
With the heterogeneous dual-core processor of DSP, arm processor carries (SuSE) Linux OS, as main control processor, uses
Internal USB Host drives and receives photographic head data, it is thus achieved that complete image or video, is gathered by USB interface
The view data come leaves in shared drive;
In order to optimize view data storage in internal memory, improve the processing capability in real time of system, use EDMA to control
DSP is needed those frame data to be processed to copy DSP data section, the result that simultaneously will process to from shared drive by device
Sending back shared drive, it is simple to arm processor calls, the CPU of dsp processor is served only for the calculating of view data
Compared with prior art, the present invention uses " COMS+ARM+DSP " framework to build vision measurement hardware platform.
USB interface-based COMS camera need not extra collecting device can obtain real-time uncompressed video data and right
The seizure of image.Leonardo da Vinci's series processors of TI company is integrated with the heterogeneous dual-core processor of ARM and DSP, makes
Leonardo da Vinci's processor possessed the respective advantage of ARM and DSP, ARM as main control processor, be responsible for peripheral hardware and
Data acquisition function, DSP possesses efficient operational capability because of it, processes for pose resolving.Overcome tradition based on
In PC end vision detection technology, excessive for volume when being applied to special environment, the problem such as not readily portable, the most also
Avoid the problem bad based on common embedded platform real-time and efficiency.There is the feature of low-power consumption and low cost, energy
Meet application demand well.Pose measuring method proposes use Otsu method to carry out binaryzation, compare traditional side
Method, Otsu method is higher in embedded platform operational efficiency.Meanwhile, because the difference of two two field pictures is little, native system calculates
Can use the value that previous frame calculates during threshold value, so calculate threshold value and binaryzation can be carried out parallel, speed can pole
Big raising.
Accompanying drawing explanation
Fig. 1 is algorithm flow chart;
Fig. 2 is Coordinate Conversion figure;
The theory diagram of the pose measurement system that Fig. 3 provides for the present invention;
Fig. 4 is data transmission scheme.
Detailed description of the invention
Below in conjunction with the accompanying drawings the present invention is done detailed specific description, but protection scope of the present invention is not limited to following
Embodiment.
The flow process of the monocular vision pose measuring method based on Davinci technology that the present invention provides is as it is shown in figure 1, specifically walk
Rapid as follows:
1, binaryzation.
Spending without the concern for the time in PC end binaryzation, general employing Gaussian template carries out binaryzation, because of embedded flat
Platform is higher to rate request, it is considered to make into traditional use Gaussian template binaryzation to use Otsu method to calculate.Otsu
It is best that method is acknowledged as effect, and the binarization method that application surface is the widest is the most practical to most of samples.Otsu method two-value
The main thought changed is from the grey level histogram of image, the collection of gray value to be share threshold value T to be divided into two classes, then according to two
The meansigma methods variance (inter-class variance) of individual classification and the ratio of all kinds of variances (variance within clusters) are that maximum is to determine threshold value T.
Because the difference of two two field pictures is little, threshold value can use the value that previous frame calculates, and so calculates threshold value and two-value
Change can be carried out parallel, and speed can be greatly improved.
2, contours extract
First extract all profiles in whole pictures, check whether as circle successively according to the character of circle, if circle then extracts
Barycenter.From the point of view of in theory, profile not of uniform size, then the pixel sum on different profiles has the biggest difference.
The sum of the pixel on 4 concentrically ringed profiles meets certain scope, travels through all of profile, it may be judged whether profile
Pixel sum be in a scope.By pixel sum, filter out a part and be unlikely to be round profile, so
Calculating can be simplified further.The area S of circle is equal to π γ2, girth C is equal to 2 π r, it is seen thatFortune
Using this proportionate relationship, we can identify whether this profile is round.There is noise spot in the profile owing to extracting, extraction
Circle profile will not be strict meet this proportionate relationship, but the ratio of reality does not have the biggest ripple in the left and right of 1
Dynamic.Target circle can be quickly detected according to above method.Use RANSAC algorithm to carry out Circular curve fitting, determine circle
The heart.Sort successively according to annulus size, find position corresponding relation between annulus.
3 poses resolve
Process, according to previous image, the characteristic parameter combining camera calibrating parameters obtained and solve relative pose.As in figure 2 it is shown,
Set up the mutual relation between image coordinate and locus.OwRepresenting real space coordinate system, Oc represents camera coordinates
Being initial point, (U, V) is expressed as image plane.
From OwCoordinate is tied to the transformational relation such as formula (1) between (U, V) imaging plane, i.e. camera imaging model.Wherein,
R and T represents camera coordinates system and the attitude of world coordinate system and evolution matrix respectively.F is camera focus, dxWith
dyIt it is pixel size on xy direction.Utilize the central coordinate of circle in the cooperative target extracted and corresponding phase point coordinates structure
Become two-dimensional imaging plane and three dimensional practicality spatial match point pair.In conjunction with the camera inside and outside parameter matrix in formula (1), profit
Carry out pose resolving with P4P algorithm, obtain the posture information of cooperative target.
The pose measurement system that this utility model provides is divided into five parts: cooperative target template, pose image acquisition units,
Graphics processing unit, power supply and display and memory element.The structured flowchart of whole system is as shown in Figure 3.
(1) cooperative target template: native system cooperative target template in use is mounted on object, described cooperation
To Template uses containing four coplanar annulus marks as cooperative target template, for ease of identifying the corresponding relation of circle, four
The size of annulus is all set to difference.
(2) pose image acquisition units: present design uses USB interface-based COMS camera to obtain pose figure
Picture, described COMS camera includes image sensing part, signal read circuit and control circuit, image sensing part,
Signal read circuit and control circuit are integrated on one chip, and pose image acquisition units is connected with graphics processing unit
Connecing, by pose view data by USB interface output to graphics processing unit, the data of its output are 1280*1024
Gray level image.
(3) graphics processing unit: gather pose image information by USB interface, processes through intelligent image Processing Algorithm
After, result and original image are shown by display unit and preserved by memory element.Wherein, Intelligent treatment is calculated
Method part is mainly concerned with image binaryzation, feature point extraction and pose and resolves three parts.
(4) power supply: by civil power 220V voltage conversion DC12V voltage and power to DM8148 hardware platform.
(5) display and memory element: be responsible for setting up with graphics processing unit being connected, show in real time and store image procossing
The raw image data of unit output and intelligent algorithm result, and camera parameter and store path can be set
Put.By display measurement system precision and reliability.Described display memory element is that display screen adds SD card, or is
PC end, it is also possible to for other devices.
The exploitation of system is based on the offer of TI company for the one of Leonardo da Vinci's family chip ARM+DSP architecture feature
A whole set of component software and framework standard.Under this framework, carry out Leonardo da Vinci's application and development be capable of the reality of ARM and DSP
Shi Tongxin and co-ordination.The development difficulty of application can be simplified, shorten the construction cycle, ensure that moving of application simultaneously
Planting property.The detailed process of data transmission is as shown in Figure 4.
USB interface camera: gather image, exports view data.Photographic head is internal own through completing in image capturing system
The collection of image, conversion, output function, finally by USB Slave parts disposal data and export.
Graphics processing unit: use TI company STM320DM8148 hardware platform, its be internally integrated ARM and
The heterogeneous dual-core processor of DSP.In native system, arm processor carries (SuSE) Linux OS, as main control processor,
The USB Host using inside drives and receives photographic head data, it is possible to obtain complete image or video.Pass through USB
The view data that interface collection comes leaves in shared drive, in order to optimize view data storage in internal memory, improves system
The processing capability in real time of system, uses EDMA controller to need those frame data to be processed to copy from shared drive DSP
To DSP data section, the result processed is sent back shared drive, it is simple to arm processor calls, at DSP simultaneously
The CPU of reason device is served only for the calculating of view data.Last arm processor will be stored in the picture initial data of shared drive
Image-display units is passed to by serial ports or network interface with result.