Questions tagged [hough-transform]

The Hough transform is a technique used to isolate features of a particular shape within an image. It is most commonly used for the detection of regular curves such as lines, circles, ellipses, and so on.

The Hough transform is a feature extraction technique used in image analysis, computer vision, and digital image processing. The purpose of the technique is to find imperfect instances of objects within a certain class of shapes by a voting procedure. This voting procedure is carried out in a parameter space, from which object candidates are obtained as local maxima in a so-called accumulator space that is explicitly constructed by the algorithm for computing the Hough transform.

785 questions
186
votes
10 answers

Peak-finding algorithm for Python/SciPy

I can write something myself by finding zero-crossings of the first derivative or something, but it seems like a common-enough function to be included in standard libraries. Anyone know of one? My particular application is a 2D array, but usually…
endolith
  • 25,479
  • 34
  • 128
  • 192
113
votes
8 answers

Algorithm to detect corners of paper sheet in photo

What is the best way to detect the corners of an invoice/receipt/sheet-of-paper in a photo? This is to be used for subsequent perspective correction, before OCR. My current approach has been: RGB > Gray > Canny Edge Detection with thresholding >…
48
votes
4 answers

Explain Hough Transformation

I am just being adventurous and taking my first baby step toward computer vision. I tried to implement the Hough Transformation on my own but I just don't get the whole picture. I read the wikipedia entry, and even the original "use of the hough…
42
votes
6 answers

find intersection point of two lines drawn using houghlines opencv

How can I get the intersection points of lines down using opencv Hough lines algorithm? Here is my code: import cv2 import numpy as np import imutils im = cv2.imread('../data/test1.jpg') gray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY) edges =…
Nauman Umer
  • 1,006
  • 1
  • 11
  • 21
38
votes
6 answers

Detect semicircle in OpenCV

I am trying to detect full circles and semicircles in an image. I am following the below mentioned procedure: Process image (including Canny edge detection). Find contours and draw them on an empty image, so that I can eliminate unwanted…
harsh
  • 905
  • 1
  • 10
  • 21
36
votes
6 answers

Horizontal Line detection with OpenCV

I am trying to find horizontal and vertical lines from an image which came from a "document". The documents are scanned pages from contracts and so the lines look like what you would see in a table or in a contract block. I have been trying OpenCV…
35
votes
6 answers

Recognize a number from an image

I'm trying to write an application to find the numbers inside an image and add them up. How can I identify the written number in an image? There are many boxes in the image I need to get the numbers in the left side and sum them to give total. How…
Hash
  • 7,726
  • 9
  • 34
  • 53
33
votes
5 answers

A good approach for detecting lines in an image?

I've written some code that uses OpenCV libraries to detect white lines painted on grass. I need someone's opinion on the approach I used (as I'm sure there's a much better way than mine). Also, the results I'm getting are not as good as I expected…
32
votes
4 answers

What's the use of Canny before HoughLines (opencv)?

I'm new to image processing and I'm working on detecting lines in a document image. I read the theory of Hough line transform but I can't see why I must use Canny before calling that function in opencv like being said in many tutorials. What's the…
Risa
  • 419
  • 1
  • 7
  • 12
27
votes
3 answers

Python How to detect vertical and horizontal lines in an image with HoughLines with OpenCV?

I m trying to obtain a threshold of the calibration chessboard. I cant detect directly the chessboard corners as there is some dust as i observe a micro chessboard. I try several methods and HoughLinesP seems to be the easiest approach. But the…
user3601754
  • 3,792
  • 11
  • 43
  • 77
27
votes
4 answers

Rectangle detection with Hough transform

I'm trying to implement rectangle detection using the Hough transform, based on this paper. I programmed it using Matlab, but after the detection of parallel pair lines and orthogonal pairs, I must detect the intersection of these pairs. My…
Esamt
26
votes
2 answers

Detect touching/overlapping circles/ellipses with OpenCV and Python

i want to measure the circularity of circles (difference of the "circles" height and width or ellipse parameters). The circles are given in pictures as shown here: After doing usual stuff like color2gray, thresholding and border detection, I get…
19
votes
5 answers

How to merge lines after HoughLinesP?

My task is to find coordinates of lines (startX, startY, endX, endY) and rectangles (4 lines). Here is input file: I use the next code: img = cv.imread(image_src) gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY) ret, thresh1 =…
Oleg Dats
  • 3,933
  • 9
  • 38
  • 61
18
votes
2 answers

Explanation of rho and theta parameters in HoughLines

Can you give me a quick definition of rho and theta parameters in OpenCV's HoughLines function void cv::HoughLines ( InputArray image, OutputArray lines, double rho, double theta, int threshold, double srn = 0, …
Ghilas BELHADJ
  • 13,412
  • 10
  • 59
  • 99
17
votes
1 answer

Line Segment Detector vs Probabalistic Hough Transform

In OpenCV, there are two methods of detecting lines that give similar results in the form of a vector of endpoints - the Line Segments Detector (LSD) and the Probabilistic Hough Transform. (Discounting the standard Hough transform as the output…
ELRG
  • 590
  • 4
  • 15
1
2 3
52 53