ardrone_line_transform
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
ardrone_line_transform [2016/11/01 11:04] – dwallace | ardrone_line_transform [2016/11/06 02:33] (current) – dwallace | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Detecting Lines Using Hough Line Transform ====== | ====== Detecting Lines Using Hough Line Transform ====== | ||
- | =Introduction= | + | ===== Introduction ===== |
This tutorial we will learn how to detect lines in an image and also the application of detecting lines in an image. | This tutorial we will learn how to detect lines in an image and also the application of detecting lines in an image. | ||
Line detection is one of the most basic algorithms in computer vision technology. It has variety of applications like pattern recognition, | Line detection is one of the most basic algorithms in computer vision technology. It has variety of applications like pattern recognition, | ||
- | =Types of Line detection= | + | ===== Types of Line detection |
- | OpenCv offers two types of line detection | + | |
- | 1)Progressive Probabilistic hough transform(PPHT) | + | OpenCv offers two types of line detection |
- | 2)Standard hough transform.(SHT) | + | |
- | 3)Multi Scale Hough Transform. | + | 1) Progressive Probabilistic hough transform(PPHT) |
+ | 2) Standard hough transform.(SHT) | ||
+ | 3) Multi Scale Hough Transform. | ||
+ | |||
+ | ===== Hough Line Transform ===== | ||
- | =Hough Line Transform= | ||
The idea involved in this mechanism is that any point in a binary image could be part of some set of possible lines. Each line is parameterized by a slope ' | The idea involved in this mechanism is that any point in a binary image could be part of some set of possible lines. Each line is parameterized by a slope ' | ||
- | ==Probabilistic hough transform== | + | ==== Probabilistic hough transform ==== |
- | This method is a variation of the standard hough transform. It takes in the extent of the lines than just the orientation of the lines. The reason its called Probabilistic is that accumulates only a fraction of the points in the accumulator plane and not all of them.(source: | + | |
- | ===Trying out Probabilistic Hough transform | + | This method is a variation of the standard hough transform. It takes in the extent of the lines than just the orientation of the lines. The reason its called Probabilistic is that accumulates only a fraction of the points in the accumulator plane and not all of them.(source: |
- | 1.Go to folder named " | + | === Trying out Probabilistic Hough transform through |
- | 2.Create a file called " | + | |
- | 3.Paste the following code in it and save the file. | + | |
- | <source lang="C"> | + | 1. Go to folder named "src" |
+ | 2. Create a file called " | ||
+ | 3. Paste the following code in it and save the file. | ||
+ | <code c++ plines.cpp> | ||
#include < | #include < | ||
#include < | #include < | ||
Line 138: | Line 142: | ||
} | } | ||
- | </source> | + | </code> |
+ | |||
+ | === Make changes in the CMakeLists.txt === | ||
- | ===Make changes in the CMakeLists.txt=== | ||
Step 1: Open up the file named " | Step 1: Open up the file named " | ||
Step 2: Open up a terminal and enter the commands one after the other: | Step 2: Open up a terminal and enter the commands one after the other: | ||
- | <pre> | ||
- | roscd roscv | ||
- | cmake . | ||
- | rosmake | ||
- | </ | ||
- | ==Test the Code== | + | roscd roscv |
+ | cmake . | ||
+ | rosmake | ||
+ | |||
+ | ==== Test the Code ==== | ||
1.Make sure you are connected to the ardrone. | 1.Make sure you are connected to the ardrone. | ||
2. Enter the following commands in a separate terminal: | 2. Enter the following commands in a separate terminal: | ||
- | <pre> | ||
- | roscore | ||
- | rosrun ardrone_brown ardrone_driver | ||
- | rosrun roscv roscv | ||
- | </ | ||
- | here is a picture of line detection using probabilistic hough transform.< | ||
+ | roscore | ||
+ | rosrun ardrone_brown ardrone_driver | ||
+ | rosrun roscv roscv | ||
- | [[image:hline.png|700px|Probabilistic hough transform]] | + | here is a picture of line detection using probabilistic hough transform.< |
+ | |||
+ | {{dylanw:hline.png}}\\ | ||
- | =Standard Hough Transform= | + | ===== Standard Hough Transform |
Like wise lets implement the standard hough line transform. | Like wise lets implement the standard hough line transform. | ||
Line 168: | Line 172: | ||
1.Go to folder named " | 1.Go to folder named " | ||
- | <source lang=" | + | <code c++ slines.cpp> |
#include < | #include < | ||
#include < | #include < | ||
Line 288: | Line 292: | ||
return 0; | return 0; | ||
} | } | ||
- | </source> | + | </code> |
- | ==Make changes in the CMakeLists.txt== | + | |
+ | ==== Make changes in the CMakeLists.txt ==== | ||
Step 1: Open up the file named " | Step 1: Open up the file named " | ||
- | ==Test the Code== | + | ==== Test the Code ==== |
1.Make sure you are connected to the ardrone. | 1.Make sure you are connected to the ardrone. | ||
2. Enter the following commands in a separate terminal: | 2. Enter the following commands in a separate terminal: | ||
- | <pre> | + | |
- | roscore | + | roscore |
- | rosrun ardrone_brown ardrone_driver | + | rosrun ardrone_brown ardrone_driver |
- | rosrun roscv roscv | + | rosrun roscv roscv |
- | </ | + | |
here is a picture of line detection using probabilistic hough transform.< | here is a picture of line detection using probabilistic hough transform.< | ||
- | [[image:pline.png|700px|Standard hough transform]] | + | {{dylanw:pline.png}}\\ |
- | =Conclusion= | + | ===== Conclusion |
In this tutorial we wrote the code for standard hough transform as well as probabilistic hough transform. | In this tutorial we wrote the code for standard hough transform as well as probabilistic hough transform. | ||
But one has to know ,how to make use of the lines extracted ,in the next two tutorials I have designed basic navigation algorithm based on probabilistic hough transform and standard hough transform.This shows the application of hough line detection. | But one has to know ,how to make use of the lines extracted ,in the next two tutorials I have designed basic navigation algorithm based on probabilistic hough transform and standard hough transform.This shows the application of hough line detection. |
ardrone_line_transform.txt · Last modified: 2016/11/06 02:33 by dwallace