A kind of augmented reality implementation method of picture charge pattern method and application the method
Technical field
The present invention relates to calculator visual effect field, and in particular to the expansion of a kind of picture charge pattern method and application the method
Increase real border implementation method.
Background technology
Augmented reality technology is AR, and full name is Augmented Reality, and it is by virtual world regarding effect, audio and sky
Between the information integration such as information to true environment information technology, augmented reality technology not only represents the information of true environment, also together
When by virtual presentation of information out, be complementary to one another by two kinds of information, superposition, thereby allow user to obtain more rich sense
Know information, generally, the electronic installation for carrying augmented reality technology can pass through the pick-up lens seizure true environment being configured thereon that
Image, and calculate catches position, the angle of image in real time, while plus respective virtual image, the purpose is to show
Virtual world information is enclosed within actual environment information on screen, allows user through caught image and the information of virtual world
Carry out interaction.
Augmented reality technology is mainly used in the mobile devices such as smart mobile phone, tablet PC now, in recent years due to void
Intend the development of real (Virtual Reality, VR) technology, also begin to for augmented reality technology to be applied to intelligent helmet, intelligence
In the Wearables such as glasses.Through rendering for 3D rendering animation, multimedia video, the broadcasting of audio, augmented reality technology quilt
It is widely used in the fields such as video game, broadcasting media and education.
Augmented reality technology is using the scene in virtual special efficacy enhancing true environment, it would be desirable to the mesh for being demonstrated or being highlighted
Mark things is more lively and specific, brings user strong distinct visual effect.Existing Augmented Reality application is that have with one
The image of abundant details renders true lively threedimensional model through display screen as mark on image.Its image
Tracking is the algorithm based on template identification matching, and its precision only reaches pixel i.e. integer levels.When the 2D-3D pose squares with prediction
Battle array be floating type element interaction after the pixel, the result for obtaining will be reduced into integer level.Thus result in a little in small model
Interior error is enclosed, and then influences present frame to calculate the result of 2D-3D position auto―controls.Its visual effect is in virtual three-dimensional model
When being moved with the motion of mark, virtual three-dimensional model appears in shake or motor reaction in picture and lags behind mark
The situation of thing.The phenomenon can influence the displaying of augmented reality special efficacy, influence the visual experience of user.
The content of the invention
The present invention provides the augmented reality implementation method of a kind of picture charge pattern method and application the method, solves picture and trembles
Dynamic and motor reaction lags behind the situation of mark.
The present invention is achieved through the following technical solutions:
A kind of picture charge pattern method, comprises the following steps:
A1, acquisition blip thing;
A2, the initial position auto―control for calculating blip thing;
A3, the next frame data for reading in blip thing, predicted using template matches, Markov model motion state,
The method of Kalman filtering algorithm enters follows the trail of execution thread, to determine new position auto―control;
A4, corresponding evolution is carried out to image according to new position auto―control;
A5, using A3 to A4 the step of until blip thing disappear.
This method is improved in existing picture charge pattern method, using template matches, Markov model motion shape
Execution thread is followed the trail of in state prediction, the method for Kalman filtering algorithm, and effective solution float and motor reaction lag behind mark
The situation of will thing.
A kind of augmented reality implementation method based on picture charge pattern, comprises the following steps:
1) blip thing, is generated;
2) augmented reality system, is initialized;
3) real scene image, is obtained;
4), detect and match blip thing, obtain the initial position auto―control of blip thing;
5) 3D engine animation effects, are rendered;
6), predicted using template matches, Markov model motion state, the method for Kalman filtering algorithm is initially entered
Execution thread is followed the trail of, the new position auto―control of blip thing is determined;
7) augmented reality animation effect, is updated according to new position auto―control;
8), repeat 5) to 7) until blip thing disappears in screen, reacquires real scene image or expands real
Border system decommissions.
Further, it is specially using the method for template matches:Augmented reality system will according to the position auto―control of previous frame
On the spot projection of tracking group to screen, template matches are done in the certain limit near point, for example the pros of the point 15*15 pixels
Shape region, the matching of judge templet is determined by the normalized-cross-correlation function of template all pixels value.
Further, it is specially using the method for Kalman filtering algorithm:To several frame position auto―controls and present frame before
Position auto―control do filtering process, several frame position auto―controls before are weighted, the new pose tried to achieve to present frame afterwards
Matrix does optimum estimation treatment.
Further, the method predicted using Markov model motion state is specially:
Predict the motion state of blip thing;
According to motion state real-time adjustment filtering parameter.
Further, the specific method of the motion state of prediction blip thing is:
After the Point Set of tracking group is matched by way of template matches, the coordinate that point concentrates each point in present frame is calculated
With the coordinate distance of former frame, motion state is judged according to the distance.
The method for generating blip thing includes:
Choose image;
The diminution of different scale is carried out to image with the method for linear interpolation, figure layer tower is set up, makes augmented reality system
The mark of sizes in the image of camera acquisition can be matched;
Generate the point of tracking group;
Generate the characteristic point and description of match group.
The present invention compared with prior art, has the following advantages and advantages:
1st, picture charge pattern method of the invention is using template matches, the prediction of Markov model motion state, Kalman's filter
The method of ripple algorithm follows the trail of execution thread, and effective solution float and motor reaction lag behind the situation of mark.
2nd, the present invention above-mentioned picture charge pattern method is applied to augmented reality, effectively solve virtual three-dimensional model with
Shake or motor reaction lag behind the situation of mark during mark appears in picture in motion, enhance Consumer's Experience.
Brief description of the drawings
Accompanying drawing described herein is used for providing further understanding the embodiment of the present invention, constitutes of the application
Point, do not constitute the restriction to the embodiment of the present invention.In the accompanying drawings:
Fig. 1 be impact point in this condition next frame possibly into motion state diagram.
Specific embodiment
To make the object, technical solutions and advantages of the present invention become more apparent, with reference to embodiment and accompanying drawing, to this
Invention is described in further detail, and exemplary embodiment of the invention and its explanation are only used for explaining the present invention, do not make
It is limitation of the invention.
Embodiment 1
A kind of picture charge pattern method, comprises the following steps:
A1, acquisition blip thing;
A2, the initial position auto―control for calculating blip thing;
A3, the next frame data for reading in blip thing, predicted using template matches, Markov model motion state,
The method of Kalman filtering algorithm enters follows the trail of execution thread, to determine new position auto―control;
A4, corresponding evolution is carried out to image according to new position auto―control;
A5, using A3 to A4 the step of until blip thing disappear.
This picture charge pattern method may be used in many very Multiple systems.Below with augmented reality systematic difference to this
The detailed step of method is illustrated.
Embodiment 2
A kind of augmented reality implementation method based on picture charge pattern, comprises the following steps:
1) blip thing, is generated;
2) augmented reality system, is initialized;
3) real scene image, is obtained;
4), detect and match blip thing, obtain the initial position auto―control of blip thing;
5) 3D engine animation effects, are rendered;
6), open and follow the trail of execution thread, determine the new position auto―control of blip thing;
7) augmented reality animation effect, is updated according to new position auto―control;
8), repeat 5) to 7) until blip thing disappears in screen, reacquires real scene image or expands real
Border system decommissions.
Specifically, step 2) in, augmented reality system can be realized in the equipment with camera, for example mobile phone, flat
Plate computer, intelligent glasses or helmet etc..Initialization augmented reality system mainly includes two aspects:1. the calibration of camera and just
Beginningization, for obtaining real scene image, initialization camera is referred specifically to the internal intrinsic ginseng such as the focal length of camera and deformation
Number is read in internal memory;2. augmented reality system reads the local data for pre-storing that technology of realizing needs, including blip
Thing file, the information of 3D models.
Step 3) image for real scene is obtained by camera.
Whether contain blip thing in detection image, if there is flow to proceed, otherwise reacquire image with detection.
Set up screen coordinate of the blip thing in camera and pose coordinate of the blip thing in real scene
2D-3D position auto―controls, determine putting position, size of the 3D models in screen, and per the anglec of rotation on one-dimensional, so
The 3D models with animation are drawn with 3D engines afterwards.
Pose coordinate of the point of tracking group in real scene is projected to the two dimension on screen according to 2D-3D position auto―controls
Coordinate system.
Predicted using template matches, Markov model motion state, the method for Kalman filtering algorithm starts tracking and holds
Line journey, it is determined that the simultaneously new position auto―control of optimization aim mark.
Specifically, being specially using the method for Kalman filtering algorithm:Several frame position auto―controls before are weighted, it
The new position auto―control tried to achieve to present frame afterwards does optimum estimation treatment.An aluminium foil parameter is there is provision of, to number before
The position auto―control of frame position auto―control and present frame does filtering process.When the parameter is larger, closer to the 2D-3D pose squares of present frame
The weight that battle array is obtained is bigger, and the result for causing is that the 2D-3D position auto―controls of present frame update rapid, but the position of point has pixel
The deviation of level, it is exactly that augmented reality special efficacy shake occurs to be reflected on screen.Otherwise the parameter is smaller, and weight is relatively evenly distributed in
Count before on the 2D-3D position auto―controls of frame, the result for causing is that the 2D-3D position auto―controls of present frame need a bit of time to return
Return to optimal solution, it is exactly that the motion state of augmented reality special efficacy lags behind image change to be reflected on screen.When mark is quick
During motion, shake can visually be ignored, but need big filtering parameter to cause that Augmented Reality special efficacy keeps up with the motion of mark
State.When mark low-speed motion or it is static when, hysteresis effect is not obvious, but needs small filtering parameter to cause Augmented Reality special efficacy
Display is not shaken steadily more.Therefore needs are adjusted according to the motion state of blip thing to filtering parameter so that amplification
The shake visually of real border special efficacy is preferably minimized with delayed..
Specifically, method of the method being adjusted to filtering parameter using the prediction of Markov model motion state.It is first
First, the motion state of blip thing is predicted;Further according to motion state real-time adjustment filtering parameter.The motion mode of object may
Property is divided into four kinds of states, and static, acceleration, maximal rate, deceleration can be represented with sequence number 0,1,2,3 respectively in the implementation.Prediction mesh
Mark mark can be used in the motion state method of present frame:After the Point Set of tracking group is matched by way of model is matched,
The coordinate distance that point concentrates each point in coordinate and the former frame of present frame is calculated, will obtain distance is voted, between 0 and threshold
Value one, then count the set that motion state is 0, i.e., static;Between threshold value one and threshold value two, then it is 1 to count motion state to distance
Or 3 set;The set that motion state is 2 is second counted more than threshold value.Take and be counted into the most collection of number of times and be combined into mark
Current motion state.Four combinations of continuous state between nearly five frame are taken, mark can be carried out to different combinations and integrally transported
The judgement of dynamic property and prediction, assign the suitable filtering algorithm parameter of present frame one.
See Fig. 1, point arrow represent a little next frame in this condition possibly into motion state.Such as o'clock under 0 state,
Next frame possibly into state be 0 or 1.
Assuming that first three frame is 0000 with the mark combinations of states of present frame, then the state estimation of mark is quiet
Only, then be accomplished by setting a less filter parameter preventing 3D models from shaking.
Assuming that first three frame is 2222 with the mark combinations of states of present frame, then the state estimation of mark is at a high speed
Motion, then be accomplished by setting a larger filter parameter preventing 3D model sports delayed.
The algorithm all sets corresponding filter parameter to ensure the aobvious of Augmented Reality special efficacy to different numeral combinations
Show effect, simultaneously as the state of four two field pictures is only considered, therefore the noise for producing is ignored, such as 2121 this shapes
State situation repeatedly.
Embodiment 3
The present embodiment is on the basis of embodiment 2 to step 1) refined, specifically include following steps:
An image is chosen, in order to reach the augmented reality effect of stabilization, the pixel quantity of image can not be too low, and image is not
Can be excessively simple and dull, ideally there are enough characteristic points;
The diminution of different scale is carried out to image with the method for linear interpolation, figure layer tower is set up, makes augmented reality system
The mark of sizes in the image of camera acquisition can be matched;
The point of tracking group is generated, first to image zooming-out angle point, x, gradient on y directions is to the angle point for extracting again afterwards
Calculating, leave the angle point of 20% maximum quantity of gradient as the point of tracking group;
The characteristic point and description of match group are generated, image does feature point extraction and generates corresponding description, for examining
Survey and match.
Above-described specific embodiment, has been carried out further to the purpose of the present invention, technical scheme and beneficial effect
Describe in detail, should be understood that and the foregoing is only specific embodiment of the invention, be not intended to limit the present invention
Protection domain, all any modification, equivalent substitution and improvements within the spirit and principles in the present invention, done etc. all should include
Within protection scope of the present invention.