Hough transform for line detection

Hough transform for line detection helps to find lines in an image even if the points are not connected and the lines are not perfectly straight. It works with a voting procedure where each point in the image votes for all the possible lines that pass through it. The line with more votes corresponds to the most likely one.

In the following applet you can draw anything on the left and see the transformed image on the right. Each point in the original image contributes to many points (a curve) in the transformed image, and each point in the transformed image represents a straight line in the original image (you can move the mouse there to see it). The brightest points in the transformed image are likely to be caused by a straight line in the original image.

This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

Usage:

  • Press keys 'i' and 'u' to change the image
  • Press keys 'r' to reset to a black image
  • Press 'Esc' to stop the applet (reload the page to start again)

If you don't have the Java plug-in you can watch a video of it

If you draw a line, it corresponds to the brightest point of the Hough transform:

Hough transform of a line

In fact, for each line two points are detected, this is because we are plotting degrees from 0 to 360, but plotting from 0 to 180 would be enough. In other words, you can ignore half of the transformed image.

In this transform the horizontal axis corresponds to the angle of the line and the vertical axis corresponds to its distance from the center of the image.

Several parallel lines are transformed to points in the same horizontal coordinate:

Hough transform of parallel lines

Even with just a few points, a line can be detected:

Hough transform of some aligned points

Short lines can be detected as well:

Hough transform of short lines

and sometimes other lines emerge:

Hough transform of short lines

The Hough transform for line detection applied to circles, detects tangent lines:

Hough transform of two circles

If you want to apply it to real images, you have to detect the edges first. In the case of the cameraman test image, it detects the tripod:

Hough transform of a cameraman

In noisy images, like this baboon, the noise may hide the real lines of the image:

Hough transform of a baboon

Hough transform of a baboon

In a random noise image, the diagonals will be detected, because the diagonals are the longest lines inside the square:

Hough transform of random noise

There are many variations of the Hough transform, that are used for circle detection or generic shape detection, but they are more complex and the transformed image (the “parameter space”) has more than two dimensions and it would be difficult to visualize it here.

In OpenCV, the function cvHoughLines2() with the CV_HOUGH_STANDARD mode implements the same line detection that we have been talking about, except that it returns the detected lines and not the transformed image. It can find line segments as well using the CV_HOUGH_PROBABILISTIC mode. The function cvHoughCircles() finds circles of any radius in an image.

Comments

medo, 2012/11/03 16:02

thanks for your post

can you help me for Hough transform for circle detection

any post or link can help me

i use opencv for cvhougthcircle but i cant know how it work exactly

thanks

Octavi Estapé, 2012/11/05 04:08

You can read the book “Learning OpenCV”. It explains Hough Transform for lines and circles. In the book you can find a small example very similar to that one:

http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.html

the book uses the C style (cvHoughCircles), and the documentation in the website uses the C++ style (HoughCircles), but the meaning of the parameters is the same.

You wont know, 2013/10/05 08:32

Hey,

thank you for this exellent examples for Hough transformation. You inspired me a lot.

www.sportshoesonsale.com, 2019/12/04 02:40

https://www.canadagoosebigdeals.com/ Canada Goose Sale ,

https://www.newgoldengoosesneakers.com/golden-goose-slide-c-5/ Golden Goose Slide ,

https://www.sportshoesonsale.com/puma-shoes-c-51/ puma shoes ,

https://www.mercedeslewishamiltonhat.com/lewis-hamilton-hats-c-1/ lewis hamilton hat ,

https://www.philippemodelsale.com/philippe-moldel-man-c-1/ Philippe Model Man ,

https://www.monclerbigdeals.com/moncler-women-vests-c-6/ Moncler Women Vests ,

https://www.mrgoldengoose.com/golden-goose-slide-c-5/ golden goose slide ,

https://www.newgoldengoosesneakers.com/golden-goose-francy-c-2/ Golden Goose Francy ,

https://www.mercedeslewishamiltonhat.com/ Mercedes Lewis Hamilton Hat ,

https://www.moncleroutletsales.com/women-jackets-c-9/ moncler women jackets ,

https://www.sportshoesonsale.com/converse-shoes-c-49/ converse shoes ,

https://www.moncleroutletsales.com/ Moncler Outlet Online ,

https://www.lewishamiltoncaps.com/ Lewis Hamilton Cap 2019 ,

https://www.philippemodelsale.com/ Philippe Model Sneakers ,

https://www.goldengooseshoesit.com/ Golden Goose Sale ,

https://www.moncleroutletsales.com/women-vests-c-10/ moncler women vests ,

https://www.sportshoesonsale.com/nike-shoes-c-53/ nike shoes ,

https://www.goldengooseshoesit.com/ Golden Goose ,

https://www.lewishamiltoncaps.com/ Lewis Hamilton Cap Collection ,

https://www.goldengooseshoesit.com/golden-goose-mid-star-c-4/ Golden Goose Mid Star ,

https://www.mrgoldengoose.com/golden-goose-ball-star-c-1/ golden goose ball star ,

https://www.converse-outlet.com/converse-seasonal-color-c-6/ Converse Seasonal Color ,

https://www.airmax270site.com/ air max 270 ,

https://www.monclerbigdeals.com/moncler-women-jackets-c-5/ Moncler Women Jackets ,

https://www.canadagoosebigdeals.com/ Canada Goose Big Sale ,

https://www.goldengoosebigdeals.com/golden-goose-slide-c-3/ Golden Goose Slide ,

https://www.goldengooseshoesit.com/golden-goose-superstar-c-7/ Golden Goose Superstar ,

https://www.sportshoesonsale.com/new-balance-shoes-c-50/ new balance shoes ,

https://www.lewishamiltoncaps.com/mercedes-lewis-hamilton-caps-c-2/ Mercedes Lewis Hamilton Caps ,

https://www.newgoldengoosesneakers.com/golden-goose-v-star-c-8/ Golden Goose V Star ,

https://www.goldengooser.com/starter-c-7/ golden goose starter ,

https://www.goldengooseshoesit.com/golden-goose-francy-c-2/ Golden Goose Francy ,

https://www.moncleroutletsales.com/men-jackets-c-6/ moncler men jackets ,

https://www.goldengooseshoesit.com/golden-goose-starter-c-6/ Golden Goose Starter ,

https://www.moncleroutletsales.com/ Moncler Outlet Store ,

https://www.monclerbigdeals.com/moncler-men-jackets-c-2/ Moncler Men Jackets ,

https://www.thegoldengoosesale.com/golden-goose-hi-star-c-33/ golden goose hi star ,

https://www.monclerbigdeals.com/moncler-men-vests-c-3/ Moncler Men Vests ,

https://www.goldengooser.com/hi-star-c-8/ golden goose hi star ,

https://www.converse-outlet.com/converse-leather-c-3/ Converse Leather Shoes ,

https://www.goldengooseshoesit.com/golden-goose-hi-star-c-3/ Golden Goose Hi Star ,

https://www.newgoldengoosesneakers.com/golden-goose-hi-star-c-3/ Golden Goose Hi Star ,

https://www.sneakersgoldengoose.it/golden-goose-uomo-c-2/ golden goose uomo ,

https://www.mrgoldengoose.com/ Golden Goose Outlet ,

https://www.mrgoldengoose.com/ Golden Goose ,

https://www.lewishamiltoncaps.com/ Lewis Hamilton Hat ,

http://www.yeezybigdeals.com/ Yeezy Boost Big Sale ,

https://www.thegoldengoosesale.com/ Golden Goose ,

https://www.thegoldengoosesale.com/golden-goose-mid-star-c-36/ golden goose mid star ,

https://www.sportshoesonsale.com/ Sport Shoes Sale ,

https://www.mrgoldengoose.com/ Golden Goose Sale ,

https://www.goldengooseshoesit.com/ Golden Goose Outlet ,

https://www.goldengooseshoesit.com/golden-goose-v-star-c-8/ Golden Goose V Star ,

https://www.sportshoesonsale.com/yeezy-boost-c-7/ yeezy boost ,

https://www.converse-outlet.com/ Converse Shoes ,

https://www.mrgoldengoose.com/golden-goose-mid-star-c-4/ golden goose mid star ,

https://www.goldengoosebigdeals.com/golden-goose-mid-star-c-1/ Golden Goose Mid Star ,

http://www.yeezybigdeals.com/ Yeezy Boost Big Deals ,

https://www.goldengooseshoesit.com/golden-goose-ball-star-c-1/ Golden Goose Ball Star ,

https://www.mercedeslewishamiltonhat.com/mercedes-lewis-hamilton-hats-c-2/ mercedes lewis hamilton hats ,

https://www.converse-outlet.com/ Converse Outlet ,

https://www.converse-outlet.com/converse-1970s-c-1/ Converse 1970s ,

https://www.airmax270site.com/nike-air-max-270-c-1/ air max 270 ,

https://www.thegoldengoosesale.com/golden-goose-francy-c-27/ golden goose francy ,

https://www.sportshoesonsale.com/ Sport Shoes Outlet ,

https://www.goldengoosebigdeals.com/ Golden Goose Big Sale ,

https://www.airjordanbigdeals.com/ Air Jordan Big Deals ,

https://www.thegoldengoosesale.com/golden-goose-v-star-c-48/ golden goose v star ,

https://www.monclerbigdeals.com/moncler-women-coats-c-4/ Moncler Women Coats ,

https://www.sneakersgoldengoose.it/ Golden Goose Saldi ,

https://www.mrgoldengoose.com/ Golden Goose Sneakers ,

https://www.newgoldengoosesneakers.com/golden-goose-starter-c-6/ Golden Goose Starter ,

https://www.philippemodelsale.com/philippe-moldel-woman-c-2/ Philippe Model Woman ,

https://www.goldengooser.com/slide-c-5/ golden goose slide ,

https://www.goldengooser.com/mid-star-c-6/ golden goose mid star ,

https://www.monclerbigdeals.com/moncler-men-coats-c-1/ Moncler Men Coats ,

https://www.mrgoldengoose.com/golden-goose-starter-c-6/ golden goose starter ,

https://www.sportshoesonsale.com/air-jordan-shoes-c-8/ air jordan shoes ,

https://www.thegoldengoosesale.com/ Golden Goose Sale ,

https://www.philippemodelsale.com/ Philippe Model Shoes ,

https://www.monclerbigdeals.com/ Moncler Sale ,

https://www.converse-outlet.com/ Converse Outlet ,

https://www.goldengoosebigdeals.com/golden-goose-superstar-c-2/ Golden Goose Superstar ,

https://www.goldengooser.com/ Golden Goose Sale ,

https://www.philippemodelsale.com/ Philippe Model Sale ,

https://www.mrgoldengoose.com/golden-goose-superstar-c-7/ golden goose superstar ,

https://www.thegoldengoosesale.com/golden-goose-slide-c-39/ golden goose slide ,

https://www.lewishamiltoncaps.com/ Lewis Hamilton Cap ,

https://www.newgoldengoosesneakers.com/ Golden Goose Sneakers Outlet ,

https://www.moncleroutletsales.com/men-coats-c-5/ moncler men coats ,

https://www.goldengooseshoesit.com/ Golden Goose Sneakers ,

https://www.mrgoldengoose.com/golden-goose-francy-c-2/ golden goose francy ,

https://www.goldengoosebigdeals.com/ Golden Goose Sale ,

https://www.mercedeslewishamiltonhat.com/ Mercedes Lewis Hamilton ,

https://www.sportshoesonsale.com/ Sport Shoes On Sale ,

https://www.moncleroutletsales.com/ Moncler Big Deals ,

https://www.goldengoosebigdeals.com/ Golden Goose Outlet ,

https://www.thegoldengoosesale.com/golden-goose-starter-c-42/ golden goose starter ,

https://www.airjordanbigdeals.com/ Jordan Shoes Sale ,

https://www.mercedeslewishamiltonhat.com/mercedes-f1-hats-c-3/ mercedes f1 hat ,

https://www.philippemodelsale.com/ Philippe Model ,

https://www.goldengoosebigdeals.com/golden-goose-hanami-c-7/ Golden Goose Hanami ,

https://www.moncleroutletsales.com/accessories-c-1/ moncler accessories ,

https://www.mercedeslewishamiltonhat.com/ Mercedes Lewis Hamilton Cap ,

https://www.airmax270site.com/ air max 270 sale ,

https://www.airmax270site.com/ cheap air max 270 ,

https://www.goldengooser.com/ Golden Goose ,

https://www.newgoldengoosesneakers.com/ Golden Goose Sneakers Sale ,

https://www.thegoldengoosesale.com/ Golden Goose Outlet ,

https://www.canadagoosebigdeals.com/ Canada Goose Big Deals ,

https://www.canadagoosebigdeals.com/ Canada Goose Outlet ,

https://www.sportshoesonsale.com/vans-shoes-c-52/ vans shoes ,

https://www.goldengooser.com/ Golden Goose Sneakers ,

https://www.converse-outlet.com/converse-high-top-c-2/ Converse High Top ,

https://www.converse-outlet.com/ Converse Store ,

https://www.goldengoosebigdeals.com/golden-goose-starter-c-5/ Golden Goose Starter ,

https://www.goldengooser.com/superstar-c-4/ golden goose superstar ,

https://www.thegoldengoosesale.com/golden-goose-superstar-c-45/ golden goose superstar ,

https://www.goldengoosebigdeals.com/golden-goose-hi-star-c-8/ Golden Goose Hi Star ,

https://www.goldengooseshoesit.com/golden-goose-slide-c-5/ Golden Goose Slide ,

https://www.sneakersgoldengoose.it/ Golden Goose ,

https://www.sportshoesonsale.com/adidas-shoes-c-6/ adidas shoes ,

https://www.newgoldengoosesneakers.com/ Golden Goose Sneakers ,

https://www.airjordanbigdeals.com/ Cheap Jordan Shoes ,

https://www.airmax270site.com/ air max 270 outlet ,

https://www.converse-outlet.com/converse-monochrome-c-5/ Converse Monochrome ,

https://www.goldengoosebigdeals.com/golden-goose-francy-c-4/ Golden Goose Francy ,

https://www.sportshoesonsale.com/ Sport Shoes ,

https://www.sneakersgoldengoose.it/ Golden Goose Scarpe ,

https://www.monclerbigdeals.com/ Moncler Big Sale ,

https://www.converse-outlet.com/converse-low-top-c-4/ Converse Low Top ,

http://www.yeezybigdeals.com/ Yeezy Boost Sale ,

https://www.goldengooser.com/ball-star-c-1/ golden goose ball star ,

https://www.newgoldengoosesneakers.com/ Golden Goose ,

http://www.yeezybigdeals.com/yeezy-boost-c-1/ Yeezy Boost ,

https://www.mrgoldengoose.com/golden-goose-v-star-c-8/ golden goose v star ,

https://www.airmax270site.com/ nike air max 270 ,

https://www.mrgoldengoose.com/golden-goose-hi-star-c-3/ golden goose hi star ,

https://www.thegoldengoosesale.com/golden-goose-hanami-c-30/ golden goose hanami ,

https://www.moncleroutletsales.com/women-coats-c-8/ moncler women coats ,

https://www.goldengooser.com/v-star-c-3/ golden goose v star ,

https://www.airjordanbigdeals.com/ Air Jordan Big Sale ,

https://www.moncleroutletsales.com/men-vests-c-7/ moncler men vests ,

https://www.monclerbigdeals.com/ Moncler Outlet ,

https://www.newgoldengoosesneakers.com/golden-goose-ball-star-c-1/ Golden Goose Ball Star ,

https://www.monclerbigdeals.com/ Moncler Big Deals ,

https://www.thegoldengoosesale.com/ Golden Goose Sneakers ,

https://www.goldengooser.com/francy-c-2/ golden goose francy ,

https://www.goldengooseshoesit.com/ Golden Goose Shoes ,

https://www.moncleroutletsales.com/ Moncler Outlet ,

https://www.sneakersgoldengoose.it/ Golden Goose Sneakers ,

https://www.goldengooser.com/ Golden Goose Outlet ,

https://www.lewishamiltoncaps.com/mercedes-f1-caps-c-3/ Mercedes F1 Cap ,

http://www.yeezybigdeals.com/ adidas Yeezy Boost ,

https://www.newgoldengoosesneakers.com/golden-goose-superstar-c-7/ Golden Goose Superstar ,

https://www.newgoldengoosesneakers.com/golden-goose-mid-star-c-4/ Golden Goose Mid Star ,

https://www.lewishamiltoncaps.com/lewis-hamilton-caps-c-1/ Lewis Hamilton Caps ,

https://www.sneakersgoldengoose.it/golden-goose-donna-c-1/ golden goose donna ,

https://www.goldengoosebigdeals.com/ Golden Goose Big Deals ,

Enter your comment
SEGNO
 
 
Back to top
hough_transform.txt · Last modified: 2011/12/11 08:27 by oestape
 
 
CC Attribution-Noncommercial-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0