A kind of monocular vision pose measuring method and system based on Davinci technology
Technical field
The present invention provides a kind of monocular vision pose measuring method and system based on Davinci technology belongs to vision inspection
Survey technology field.
Background technology
Vision detection technology is the emerging measuring technique developed over nearly twenties years, uses a large amount of automations, intelligence
Technology can be changed, identified and controlled by computer, measurement process only needs seldom manual intervention that can complete.With vision technique
Continuous development it is ripe so that it has been widely used in fields such as industry, medicine, aerospace, military affairs.Vision technique
The mankind can be replaced to carry out size detection, target tracking, robot navigation etc., and repeated high, non-contact precision is surveyed
Amount, the application that acquisition of information is rapid and site environment is severe are more suitable for.
Current most of researchs to vision measurement are all based on the ends PC, because its volume is big, power consumption is high, are not suitable for machine mostly
It carries, therefore how embedded technology is applied in vision detection technology to the hot spot for gradually attracting attention, and having become research.
But vision-based detection related algorithm is complicated, and image procossing is computationally intensive, and the real time problems of tracking are not solved effectively always,
The performance of middle hardware platform and the efficiency of software algorithm are two big influence factors, therefore, a large amount of research must be still done in the field
Work.
Image acquisition hardware plateform system in vision measurement system includes mainly with lower part:Image acquisition units, figure
As processing and analysis unit, data storage cell and control feedback unit.Wherein, image acquisition units are in computer vision system
The critical component of information is obtained, most essential function is exactly to convert optical signals into for orderly electric signal and by certain
Mode is transferred to signal processing platform.And the design of image acquisition units is mainly related with optical sensor and its interface.
Traditional vision measurement system is mostly based on " ten video frequency signal processing chip+CPLD/FPGA+DSP of CCD " framework
's.Current this framework relative maturity, but ccd sensor needs a considerable number of external support circuits, in electric power management circuit
Difficulty higher in design.Its power consumption and volume are larger, and hardware design is complicated, and development difficulty is larger.
Cmos sensor has small, low in energy consumption, high integration, novel USB interface and infrared interface technology, and these are prominent
The advantages of going out.Its original probability for miscellaneous point occur is very big, it is easy to be disturbed influence now ripe product also can be from rear
It compensates and optimizes on grade circuit so that the camera finished product of COMS technologies becomes leading market product.
USB interface-based COMS cameras do not need additional collecting device can be obtained real-time uncompressed video data and
Capture to image.But its transmission process is related to complex communication agreement, if based on traditional " CPLD/FPGA+DSP " framework,
It needs to build considerably complicated logic circuit to manage.And arm processor can play control function well in this kind of system,
Only need using internal USB Host driving reception camera data, so that it may with obtain complete or compressed image or
Person's video.In terms of the storage and processing of image, for oneself through the upper this image acquisition and processing platform of operating system, image
It can be used as file, be stored in the processing to data inside file system.And single arm processor is calculated in processing complicated image
It is slightly inadequate when method, the higher task of computational complexity can not be competent at.The programmability of dsp chip and powerful processing capacity,
Make it can be used for rapidly realizing various digital signal processing algorithms, becomes the optimal selection of current image processing system.Therefore,
It is proposed that building vision measurement hardware platform using " COMS+ARM+DSP " framework.Leonardo da Vinci's series processors of TI companies
It is integrated with the heterogeneous dual-core processor of ARM and DSP so that Leonardo da Vinci's processor has the respective advantages of ARM and DSP, can be very
Meet application demand well.
The research for monocular vision pose measurement system domestic at present mostly also in the theoretical simulation stage, there are no at
The product of type.Monocular vision pose measuring method is also mostly based on the ends PC, depends on OpenCV computer visions library.Due to there is PC
The powerful hardware of machine does not need excessive consideration overhead problem, OpenCV is regarded as ensureing during application and development
Feel that library provides abundant vision processing algorithm, simplifies the realization difficulty of algorithm.But in view of PC machine build is not easy to popularize greatly
Using with the development of embedded technology, relevant hardware platform performance is further promoted, and allows embedded platform for vision figure
As processing related application also can be supported preferably.And it is embedded itself have the characteristics that low-power consumption and low cost so that base
It is of increased attention in the vision measurement system of embedded technology.Therefore, a kind of monocular of high efficient and reliable is studied to regard
Feel that pose measurement system is necessary.
Invention content
The present invention provides a kind of monocular vision pose measuring method and system based on Davinci technology, solves background
Deficiency in technology, this method use the method based on four coplanar donut marks, by acquiring an image
The posture information for estimating object, for ease of the correspondence of identification circle, the size of four annulus is all different.The party
Method has many advantages, such as that simple simple in structure, camera calibration, in-site installation, debugging are easy, while also avoiding in stereoscopic vision and regarding
The deficiency that field is small, Stereo matching is difficult.
Technical solution is used by realizing above-mentioned purpose of the present invention:
A kind of monocular vision pose measuring method based on Davinci technology, includes the following steps:
(1) image binaryzation
Acquired pose image is carried out by binaryzation using Otsu methods, gray value from the gray value side of image figure
Collection shares threshold value T and be divided to for two classes, is then determined for maximum according to the ratio of the average value variance of two classifications and all kinds of variances
Threshold value T;
(2) feature point extraction
All profiles in whole Zhang Weizi images are extracted first, are checked whether successively as circle according to round property, if circle
Then extract barycenter;All profiles are traversed, judge whether that the pixel sum of profile is in a range;It is total by pixel
Number filters out a part and is unlikely to be round profile;Circular curve fitting is carried out using RANSAC algorithms, the center of circle is determined, according to circle
Ring size sorts successively, finds position correspondence between annulus;
(3) pose resolves
Relative pose is solved according to the characteristic parameter combining camera calibrating parameters that previous image is handled, establishes image seat
Correlation between mark and spatial position, OwIndicate that real space coordinate system, Oc indicate camera coordinates system origin, (U, V) table
It is shown as image plane;
From OwCoordinate system to the transformational relation such as formula (1) between (U, V) imaging plane,
Wherein, R and T indicates that the posture and evolution matrix of camera coordinates system and world coordinate system, f are camera cokes respectively
Away from dxAnd dySize of the pixel on the directions xy, using in the cooperative target of extraction central coordinate of circle and corresponding phase point coordinates
Two-dimensional imaging plane and three dimensional practicality spatial match point pair are constituted, in conjunction with the camera inside and outside parameter matrix in formula (1), is utilized
P4P algorithms carry out pose resolving, you can obtain the posture information of cooperative target.
The present invention additionally provides the pose measurement system based on the above method simultaneously, includes at least cooperative target template, position
Appearance image acquisition units, image processing unit, power supply and display storage unit, it is characterised in that:Cooperative target template is mounted in
On object, the cooperative target template is four coplanar annulus, and the size of four annulus is all different;It is described
Pose image acquisition units be USB interface-based COMS cameras, the COMS cameras include image sensing part, signal
Reading circuit and control circuit, image sensing part, signal read circuit and control circuit are integrated on one chip, pose figure
As collecting unit is connected with image processing unit, pose image data is exported by USB interface to image processing unit;Institute
The image processing unit stated receives pose image data by USB interface, after the processing of intelligent image Processing Algorithm, by intelligent calculation
Method handling result and original image are transmitted to through network interface or serial ports shows that memory module shows and preserves, wherein at intelligent image
Adjustment method includes that image binaryzation, feature point extraction and pose resolve three parts;The power supply is used to supply to image processing unit
Electricity;Described image display unit is connect with image processing unit, real-time reception, display and the original for storing image processing unit output
Beginning image data and intelligent algorithm handling result, and camera parameter and store path can be configured, it is tested by showing
System accuracy and reliability.
The image processing unit use TI companies STM320DM8148 hardware platforms, be internally integrated ARM and
The heterogeneous dual-core processor of DSP, arm processor carry (SuSE) Linux OS, as main control processor, use internal USB
Host driving receive camera data, obtain complete image or video, by USB interface acquisition come image data storage
In shared drive;
In order to optimize the storage of image data in memory, the processing capability in real time of system is improved, using EDMA controllers
DSP that frame data to be treated are copied to DSP data sections from shared drive, while the result handled being sent back
Shared drive, is called convenient for arm processor, and the CPU of dsp processor is served only for the calculating of image data
Compared with prior art, the present invention builds vision measurement hardware platform using " COMS+ARM+DSP " framework.Base
Additional collecting device is not needed in the COMS cameras of USB interface to can be obtained real-time uncompressed video data and catch image
It catches.Leonardo da Vinci's series processors of TI companies are integrated with the heterogeneous dual-core processor of ARM and DSP so that Leonardo da Vinci handles utensil
For the respective advantages of ARM and DSP, ARM is responsible for peripheral hardware and data acquisition function, DSP has height because of it as main control processor
The operational capability of effect is handled for pose resolving.It overcomes tradition to be based in the vision detection technology of the ends PC, for applied to special
Volume is excessive when environment, it is not readily portable the problems such as, while also avoiding based on common embedded platform real-time and efficiency not
Good problem.Have the characteristics that low-power consumption and low cost, application demand can be met well.It proposes to adopt on pose measuring method
Binaryzation is carried out with Otsu methods, compares traditional method, Otsu methods are in embedded platform operational efficiency higher.Meanwhile because two
The difference of frame image is little, and the value that previous frame calculates may be used in this system when calculating threshold value, calculates threshold value and two-value in this way
Change can carry out parallel, and speed can be greatly improved.
Description of the drawings
Fig. 1 is algorithm flow chart;
Fig. 2 is coordinate transition diagram;
Fig. 3 is the functional block diagram of pose measurement system provided by the invention;
Fig. 4 is data transmission scheme.
Specific implementation mode
Detailed specific description done to the present invention below in conjunction with the accompanying drawings, but protection scope of the present invention be not limited to
Lower embodiment.
The flow of monocular vision pose measuring method provided by the invention based on Davinci technology is as shown in Figure 1, specific
Steps are as follows:
1, binaryzation.
It is spent without the concern for the time in the ends PC binaryzation, binaryzation is generally carried out using Gaussian template, because embedded flat
Platform is higher to rate request, and consideration makes into calculate using Otsu methods by traditional using Gaussian template binaryzation.Otsu method quilts
It is known as being that effect is best, the most wide binarization method of application surface is all practical to most numerical example.Otsu method binaryzations it is main
Thought is that the collection of gray value is shared threshold value T to be divided to from the grey level histogram of image is two classes, then according to the flat of two classifications
Mean variance (inter-class variance) and the ratio of all kinds of variance (variance within clusters) carry out threshold value T for maximum.
Because the difference of two field pictures is little, the value that previous frame calculates may be used in threshold value, calculates threshold value and two in this way
Value can carry out parallel, and speed can be greatly improved.
2, contours extract
All profiles in whole pictures are extracted first, are checked whether successively as circle according to round property, if circle then carries
Take barycenter.Theoretically speaking profile is not of uniform size, then the pixel sum on different profiles has prodigious difference.4
The sum of pixel on the profile of a concentric circles meets certain range, traverses all profiles, judges whether the picture of profile
Vegetarian refreshments sum is in a range.By pixel sum, filters out a part and be unlikely to be round profile, it in this way can be into one
Step, which simplifies, to be calculated.Round area S is equal to π γ2, perimeter C be equal to 2 π r, it is seen thatWith this proportionate relationship, I
Can identify whether the profile is round.Since the profile of extraction is there are noise spot, the profile of the circle of extraction stringent will not be expired
This proportionate relationship of foot, but actual ratio does not have too big fluctuation in 1 left and right.It can quickly be examined according to above method
Survey target circle.Circular curve fitting is carried out using RANSAC algorithms, determines the center of circle.It is sorted, is found successively according to annulus size
Position correspondence between annulus.
3 poses resolve
Relative pose is solved according to the characteristic parameter combining camera calibrating parameters that previous image is handled.As shown in Fig. 2,
Establish the correlation between image coordinate and spatial position.OwIndicate that real space coordinate system, Oc indicate that camera coordinates system is former
Point, (U, V) indicate imaging plane.
From OwCoordinate system is to the transformational relation such as formula (1) between (U, V) imaging plane, i.e. camera imaging model.Wherein,
R and T indicates the posture and evolution matrix of camera coordinates system and world coordinate system respectively.F is camera focus, dxAnd dyIt is picture
Size of the member on the directions xy.Utilize the central coordinate of circle and corresponding phase point coordinates composition two-dimensional imaging in the cooperative target of extraction
Plane and three dimensional practicality spatial match point pair.In conjunction with the camera inside and outside parameter matrix in formula (1), using P4P algorithms into line position
Appearance resolves, and obtains the posture information of cooperative target.
Pose measurement system provided by the utility model is divided into five parts:Cooperative target template, pose Image Acquisition list
Member, image processing unit, power supply and display and storage unit.The structure diagram of whole system is as shown in Figure 3.
(1) cooperative target template:Cooperative target template is mounted on object this system when in use, the cooperative target
Template is marked to use containing four coplanar annulus marks as cooperative target template, for ease of the correspondence of identification circle, four annulus
Size be set as different.
(2) pose image acquisition units:Present design obtains pose image using USB interface-based COMS cameras,
The COMS cameras include image sensing part, signal read circuit and control circuit, and image sensing part, signal read electricity
Road and control circuit are integrated on one chip, and pose image acquisition units are connected with image processing unit, by pose image
Data are exported by USB interface to image processing unit, and the data of output are 1280*1024 gray level images.
(3) image processing unit:Pose image information is acquired by USB interface, after the processing of intelligent image Processing Algorithm,
Handling result and original image are shown by display unit and preserved by storage unit.Wherein, Intelligent treatment algorithm part
It is mainly concerned with image binaryzation, feature point extraction and pose and resolves three parts.
(4) power supply:Alternating current 220V voltages are converted into DC12V voltages and are powered to DM8148 hardware platforms.
(5) display and storage unit:It is responsible for establishing with image processing unit and connects, real-time display simultaneously stores image procossing list
The raw image data and intelligent algorithm handling result of member output, and camera parameter and store path can be configured.It is logical
Cross display measurement system precision and reliability.The display storage unit is that display screen adds SD card, or is the ends PC, can be with
For other devices.
The exploitation of system based on TI companies provide for the one whole of Leonardo da Vinci's family chip ARM+DSP architecture features
Cover component software and framework standard.Under this frame carry out Leonardo da Vinci's application and development can realize ARM and DSP real-time Communication for Power and
Co-ordination.The development difficulty of application can be simplified, shorten the development cycle, while ensure that the portability of application.Data pass
Defeated detailed process is as shown in Figure 4.
USB interface camera:Image is acquired, image data is exported.Oneself is through completing in image capturing system inside camera
The acquisition of image, conversion, output function arrange data finally by USB Slave components and export.
Image processing unit:Using the STM320DM8148 hardware platforms of TI companies, it has been internally integrated ARM's and DSP
Heterogeneous dual-core processor.Arm processor carries (SuSE) Linux OS in this system, as main control processor, uses inside
USB Host drivings receive camera data, so that it may to obtain complete image or video.By USB interface acquisition come figure
As data are stored in shared drive, in order to optimize the storage of image data in memory, the processing capability in real time of system is improved,
Data sections of DSP to is copied DSP that frame data to be treated from shared drive using EDMA controllers, while will processing
Complete result sends back shared drive, is called convenient for arm processor, and the CPU of dsp processor is served only for the calculating of image data.
The picture initial data for being stored in shared drive and handling result are transmitted to image by serial ports or network interface and shown by last arm processor
Unit.