Questions tagged [straight-line-detection]

67 questions
1
vote
2 answers

Detecting almost straight lines using OpenCv in Python

I am detecting straight lines in an image using OpenCv. Below is the code: import cv2 import numpy as np img = cv2.imread('Image.jpg') img = img[:, 10:img.shape[1]-10] gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) edges = cv2.Canny(gray, 50, 150,…
Aadit
  • 199
  • 1
  • 6
  • 17
1
vote
0 answers

image line detection for a grayscale image .. not working

Input image This is a 3000x3000 greyscale image, and I would like to get the coordinates of the diagonal components in the image. I tried Hough transform and pylsd (line segment detection), but both of them don't work as I hoped. Here are some…
JW O
  • 73
  • 3
0
votes
0 answers

How to find straight segments within an irregular curved line using R or QGIS

I have a shapefile (EPSG:4326 - WGS 84) containing many features with linestring geometries and I would really like to divide each line (like that one shown in the uploaded picture,example of linestring geometry to work with) into several segments,…
0
votes
0 answers

Detecting line inside a rectangle using OpenCV and Python

I have this image.Rectangles with lines. I have to assign the number (1 to 4) below the image of the rectangle with respect to its length inside the rectangle. The shorter the line lower the number. I am using OpenCV and Jupyter Notebook. How can I…
0
votes
0 answers

"Attempt to extract field 'point1' from 'mxArray'." error while trying to use "houghlines" command in MATLAB

I am using a matlab function block in simulink. Im trying to detect lines in a simulation. When I tried to use "houghlines" directly, it said that I need to use dynamic memory allocation. So I added coder.extrinsic command. Now I can see lines…
0
votes
0 answers

How to Remove non-straight diagonal lines from text image OpenCV using Hough Transform and Median Filtering?

I am trying to remove 5 lines from my image. I tried using the Hough's Transform but none of the results focuses on the lines its always cleaning something on the image. I am quite a novice at image processing. So you could point me to the right…
0
votes
0 answers

How can I separate lines in this text for OCR?

I want to use OCR on this block of text: It works well on some lines, but on other lines it doesn't detect anything / gibberish. I'm pretty sure it's because of how the text is skewed, since if I alter the angle of the block just slightly, I get…
0
votes
0 answers

Is there a good term for reconstructing partially-occluded 3D objects in Computer Vision by extrapolating edges?

What I have in mind is something like techniques where visible edges, maybe along with estimated tangent vectors relative to an estimated view-angle, are used to extrapolate likely positions for invisible edges. E.g. if an object appears to be a…
0
votes
1 answer

How can I extract the thick line in this isometric view

I have a 2d drawing of a element (isometric view) as follow: I would like to extract only the thick, longest black line (element with arrows embedded in it not dimensions) from it. How to achieve that ? For now my code goes as follow import…
0
votes
0 answers

merging or removing duplicated lines on the border of an edge map

I'm trying to draw exactly one line on all the edges of an image. I was able to draw the lines but some of the lines are repeated and I'm stuck on it for days, any help would be appreciated. I tried using the KMeans algorithm from sklearn but still…
0
votes
1 answer

How to find the cordinates of the lines in this image?

I am new to OpenCV and I would like to know how to find the coordinates of vertical lines in an image. I do have a sample image image (This image is a row of a table. Since the data is sensitive i cannot display the info inside these cells.) There…
0
votes
0 answers

I've been trying to apply Hough transformation for line detection on an image of rails. But I'm facing problems

'apply canny' edges = cv2.Canny(gray, 200, 200) plt.rcParams["figure.figsize"] = (100, 100) plt.imshow(edges) result = img.copy() lines= cv2.HoughLines(edges, 1, math.pi/180.0, 170, np.array([]), 0, 0) a,b,c = lines.shape for i in range(0, (a)): …
0
votes
0 answers

Find Specific straight lines in image with Python and CV2

I Have a specific image: In this picture I try to detect the following lines reliable: I tired to detect them with the following code: def find_and_draw_lines(img): # convert to grayscale img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #…
0
votes
0 answers

Line Detection within Scatter Plots

I want to detect lines within Scatter Plots, using python. Specifically, my data set is of the Cartesian coordinates of points. (This data was gathered using four ultrasound sensors on servos). Here are some data sets , And here are the lines I'd…
Gio
  • 13
  • 3
0
votes
1 answer

find if an device is in perpendicular to the current location from ariel view / map view

A device is traveling from source to destination and has support for GPS, we are able to locate the nearest signal using (current loc - static fixed traffic signals array) here D1 is nearest, but we want to select D2 as it is facing our…