Questions tagged [houghlinesp]

This tag should be used only for concerns related to finding lines using Probabilistic Hough Transform. Not to be used for queries regarding Hough Transform alone

In comparison to Hough Transform, the Probabilistic Hough Transform is rather simple and less computation intensive. Hough Transform takes all the points into consideration while finding lines. On the other hand, Probabilistic Hough Transform takes only a random subset of points that is sufficient for line detection

For detailed information, read [THE OPENCV DOC]

64 questions
36
votes
4 answers

OpenCV houghLinesP parameters

I am having difficulty finding the lines on a chessboard in this image using HoughLinesP with OpenCV in Python. In an attempt to understand the parameters of HoughLinesP, I have come up with the following code: import numpy as np import cv2 from…
Jane Courtney
  • 1,400
  • 1
  • 9
  • 10
8
votes
1 answer

rectangle document detection using hough transform opencv android

I am trying to detect rectangle document using opencv 4 android sdk . First i tried to detect it by finding contours but it is not working with multi color documents.You can check this link to get better idea : detecting multi color document with…
ImLearning
  • 357
  • 1
  • 3
  • 16
7
votes
1 answer

OpenCV Probabilistic Hough Line Transform giving different results with C++ and Python?

I was working on a project using OpenCV, Python that uses Probabilistic Hough Line Transform function "HoughLinesP" in some part of the project. My code worked just fine and there was no problem. Then I thought of converting the same code to…
Rahul Kedia
  • 1,400
  • 6
  • 18
5
votes
3 answers

Opencv python HoughLinesP strange results

I'm trying to get the same result they got in this tutorial for HoughLinesP filter. I took same images and same threshold values like this : import cv2 from line import Line import numpy as np img = cv2.imread('building.jpg',1) cannied =…
Anton
  • 1,001
  • 9
  • 23
4
votes
2 answers

Detect thick black lines in image with OpenCV

I have the following image of a lego board with some bricks on it Now I am trying to detect the thick black lines (connecting the white squares) with OpenCV. I have already experimented a lot with HoughLinesP, converted the image to gray or b/w…
bpauwels
  • 83
  • 1
  • 6
3
votes
2 answers

How can I remove lines (detected by HoughLines) from the image?

I followed (and modified) the method from the best-rated answer of this post. My image is a little bit different. I used HoughLinesP and managed to detect the majority of red lines. I was wondering is there a way to remove detected lines from the…
3
votes
0 answers

How to find intersection of straight lines with Hough Peaks?

I am developing a method to localise license plate and ultimately apply perspective transform to straighten the plate horizontally. Currently, my image processing pipeline is able to roughly locate the plate but I'd like to narrow it further. I have…
Moore Tech
  • 199
  • 1
  • 17
3
votes
1 answer

Merge HoughLines

I stuck at one point in my code. Firstly a short clarification what I'm doing: As an input there's a image of a floor. With the Canny and HoughLinesP algorithm I want to segment the whole wall in many "small" parts, as you could see here, which is…
Viktoria
  • 533
  • 2
  • 7
  • 24
3
votes
1 answer

Python OpenCV HoughLinesP Fails to Detect Lines

I am using OpenCV HoughlinesP to find horizontal and vertical lines. It is not finding any lines most of the time. Even when it finds a lines it is not even close to actual image. import cv2 import numpy as np img =…
user914425
  • 16,303
  • 4
  • 30
  • 41
2
votes
1 answer

how to find distance between hough lines in openCV?

I am new to opencv-python. I have found the lines in image through houghtransformP. The lines drawn from hough transform are discontinued and are giving multiple lines. I need to draw only one line for the edges and find the 'distance' between lines…
user11737855
2
votes
2 answers

Python OpenCV HoughLinesP Inaccurate Line Detection

Consider three points A, B, C in an image. Below are their coordinates in the image of size 300x300. I am trying to detect and draw a line connecting through these three points using below HoughLinesP code. import cv2 import numpy as np img =…
GreenHeart
  • 73
  • 1
  • 6
2
votes
1 answer

Detecting boxes via Hough Transform

Using HoughTransform I am trying to detect boxes and provide for a distinct color. So far my understanding is a box is horizontal and vertical line . my code is lines = cv2.HoughLines(edges,1,np.pi/180, 50) # The below for loop runs till r and…
2
votes
0 answers

What preprocessing step to take before HoughLines

I have written a program to Combined Edge information and colour information to form the image I would need to detect straight line from Then I use findContour and drawContour to redraw the evidence map after which I use some thinning algorithm…
user1538798
  • 1,075
  • 3
  • 17
  • 42
2
votes
1 answer

OpenCV - Extracting lines on a graph

I would like to create a program that is able to extract lines from a graph. For example, if a graph like this is inputted, I would just want the red line to be outputted. Below I have tried to do this using a hough line transformation, however, I…
2
votes
2 answers

Improve HoughLines for horizontal lines detect (Python, OpenCV)

I have this source image: My goal is to remove the bottom line while keep the letters/numbers untouched. This is the code I use: import cv2 import numpy as np img = cv2.imread('src.png') gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) edges =…
lucians
  • 2,239
  • 5
  • 36
  • 64
1
2 3 4 5