Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Contour Initialization
Description: In this tutorial you will learn how to initial the contour of a given object in an image or in a video.Tutorial Level: BEGINNER
Next Tutorial: Segmentation
The ccd application provides three kinds of initialization methods, they are described in the following. In the moment, we just use the ccd_example to demonstrate it. ccd_example needs some run-time parameters:
initialization methods: 0 -> manually, 1- >sift/surf, 2->point cloud
- template image (if exists, this is mandatory of initialization based on SIFT/SURF)]
- input image
- initialization parameters file (e.g. ccd_params.xml)
For an instance, if we want to use the initialization method based on SIFT/SURF, we need run the command:
bin/ccd_example -m 1 -t data/template.jpg -i data/input.jpg ccd_params.xml
In this section, we take a example using a book
Manual Initialization
If choose manual initialization, the corresponding run-time parameter is 0, run the following command:
bin/ccd_example -m 0 -t data/book_alg.jpg -i data/book_alg.jpg ccd_params.xml
Now we can draw the contour (just need to take some sample points near the object):
Then press Esc the ccd will run.
Initialization Based on SIFT/SURF
For initialization based on SIFT/SURF, we have to choose a template image, for the moment, the template image of the books is:
run command:
bin/ccd_example -m 0 -t data/book_tpl.jpg -i data/book_alg.jpg ccd_params.xml
The application will generate a contour in the observed image
If press Esc, the ccd program will start to run.