This shows you the differences between two versions of the page.
ardrone_tag_recognition [2016/11/01 11:01] dwallace created |
ardrone_tag_recognition [2016/11/06 02:18] (current) dwallace |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Tag Recognition Using Webcam ====== | ====== Tag Recognition Using Webcam ====== | ||
- | =Introduction= | + | ===== Introduction ===== |
We will learn to do tag recognition using your web-cam. Before we continue any further lets make sure you have the necessary package. Open up a terminal and enter : | We will learn to do tag recognition using your web-cam. Before we continue any further lets make sure you have the necessary package. Open up a terminal and enter : | ||
- | <pre> roscd ar_recog </pre> | + | roscd ar_recog |
This should take you to the folder of the package "ar_recog". If you don't have the package please download it from the brown repository. Open up a terminal and enter the following line: | This should take you to the folder of the package "ar_recog". If you don't have the package please download it from the brown repository. Open up a terminal and enter the following line: | ||
- | <pre> svn checkout http://brown-ros-pkg.googlecode.com/svn/trunk/brown-ros-pkg-read-only </pre> | + | svn checkout http://brown-ros-pkg.googlecode.com/svn/trunk/brown-ros-pkg-read-only |
+ | |||
+ | ===== Print out a tag ===== | ||
- | =Print out a tag= | ||
We obviously need an image tag before we test the code. | We obviously need an image tag before we test the code. | ||
- | <br>Step 1:Go to the folder of the package "ar_recog" | ||
- | <br>Step 2:open up the file "Ar_patts.zip". | ||
- | <br>Step 3:Print out your desired image tag. | ||
- | =Test the code= | + | Step 1:Go to the folder of the package "ar_recog" |
+ | Step 2:open up the file "Ar_patts.zip". | ||
+ | Step 3:Print out your desired image tag. | ||
+ | |||
+ | ===== Test the code ===== | ||
1. Enter the following commands each in a new terminal. | 1. Enter the following commands each in a new terminal. | ||
- | <pre> | + | roscore |
- | roscore | + | rosrun gscam gscam |
- | rosrun gscam gscam | + | |
- | </pre> | + | |
2.Open up a new terminal and enter the lines one after the other : | 2.Open up a new terminal and enter the lines one after the other : | ||
- | <pre> | + | |
- | roscd ar_recog | + | roscd ar_recog |
- | cmake . | + | cmake . |
- | rosmake | + | rosmake |
- | </pre> | + | |
Make sure you get 0 failures for rosmake. | Make sure you get 0 failures for rosmake. | ||
- | <pre> | + | cd bin |
- | cd bin | + | rosparam set aov .67 |
- | rosparam set aov .67 | + | rosrun ar_recog ar_recog image:=/gscam/image_raw |
- | rosrun ar_recog ar_recog image:=/gscam/image_raw | + | |
- | </pre> | + | |
Enter the following commands each in a new terminal: | Enter the following commands each in a new terminal: | ||
- | <pre> | ||
- | rosrun image_view image_view image:=/gscam/image_raw | ||
- | rosrun image_view image_view image:=/ar/image | ||
- | </pre> | ||
- | =Testing the image tag= | + | rosrun image_view image_view image:=/gscam/image_raw |
+ | rosrun image_view image_view image:=/ar/image | ||
+ | |||
+ | ===== Testing the image tag ===== | ||
Considering the fact that you have a printed image tag. | Considering the fact that you have a printed image tag. | ||
Hold it in-front of the camera in such a way that your fingers don't touch the surface of the tag. | Hold it in-front of the camera in such a way that your fingers don't touch the surface of the tag. | ||
I pasted the tag on to the surface of a box lid. | I pasted the tag on to the surface of a box lid. | ||
- | <br> | ||
- | [[image:imagetag.jpg|200px|ar_recog]] | + | {{dylanw:imagetag.jpg}}\\ |
- | <br> | ||
When you test with the image tag you should see a green line outlining the image tag. | When you test with the image tag you should see a green line outlining the image tag. | ||
- | + | {{dylanw:image1.png}}\\ | |
- | [[image:image1.png|200px|ar_recog]] | + | |
+ | {{dylanw:image2.png}}\\ | ||
- | [[image:image2.png|200px|ar_recog]] | + | ===== Getting the coordinates ===== |
- | =Getting the coordinates= | ||
To have a deeper insight of the image tag being recognized open up a terminal and enter: | To have a deeper insight of the image tag being recognized open up a terminal and enter: | ||
- | <pre> rostopic echo /tags </pre> | + | rostopic echo /tags |
This shows you the movement of image tag along the x,y,z axes. | This shows you the movement of image tag along the x,y,z axes. |