about cube detection algorithm
In previous entry, I made cube marker demo.
This time, I explain the detection procedure of the cube marker, step by step.
Markers
To detect cube marker, I use 3 marker files.
- top32.pat: Marker to detect the top of cube.
- cube-basic32.pat: Marker to detect side of cube.
- sideQ.pat: Marker to detect which side of cube it is.
Detection Algorithm
The algorithm to detect the cube marker is composed of 3 steps.
- Compare the marker candidate with top32.pat.
If candidate is corresponding to top32.pat, Detector consider the square is top of cube and detection is finish.
(Figure:top) - To detect side of cube.
-
Compare the marker candidates except upper right 1/4 with cube-basic32.pat.
4 cube side markers are same ,excluding upper right 1/4.
Then, Detector compares marker candidate excluding upper right 1/4 with cube-basic32.pat.
If candidate is corresponding to cube-basic32.pat, Detector consider the square is side of cube.
(Figure: side) - Compare a corresponding marker candidate to cube-basic32.pat with sideQ.pat.
If candidate is side of cube, Detector compares candidate’s upper right 1/4 with sideQ.pat to get direction.
If direction is 0, square is BACK of cube.
Else if direction is 1, square is RIGHT of cube.
Else if direction is 2, square is FRONT of cube.
Else if direction is 3, square is LEFT of cube.
(Figure:BACK/RIGHT/FRONT/LEFT)
-
Compare the marker candidates except upper right 1/4 with cube-basic32.pat.
Comments
Hi;
Bulgaria flash comunity says “Hi” to you! Really nice effects man, amazing augumented reallity. Is it possible to write some more advanced tutorials about augumented reality –> for example simple animating sprites, worm that mooves or something like this? I started to learn FLARToolkit and PPV3D about a week ago, got 2 years of as3 oop expirience , but just can’t find enough tutorials and source codes to go on :)
the flash community from Japan are the best in augumenter reality :)
Hi, Chrysto.
Please check this site.
This is very good tutorial.
http://saqoosha.net/en/flartoolkit/start-up-guide/