hough-transform

OpenCV 3.2.0 HoughLinesP returns out of bounds lines (C++)

*爱你&永不变心* 提交于 2019-12-12 03:53:44
问题 I've been trying to detect some lines (on edges) in live webcam images, so I tried to do canny edge detection followed by hough transform using C++ version of OpenCV 3.2.0. There shouldn't be any issues since using HoughLinesP looks straightforward, but it seems that I can't make it work. The problem is that the vector output that is supposed to contain detected lines, is filled with a couple million of garbage results ! This is how I call HoughLinesP: vector<Vec4i> lines; HoughLinesP(cannyd,

How to detect hand drawn lines using hough transform in matlab?

空扰寡人 提交于 2019-12-12 02:53:50
问题 I'm working on a matlab image processing project which basically extracts components and connections from an image of hand-drawn circuit diagram. After preproccessing and obtaining skeleton image, I tried to use Hough transform to detect the lines so that i can identify corners and connection paths. Here is the code: [H,T,R] = hough(im); peaks = houghpeaks(H,50,'Threshold',ceil(0.3*max(H(:)))); lines = houghlines(im, T,R,peaks, 'Fillgap', 20, 'MinLength', 20); figure; imshow(im); title('Lines

Parallel Line detection using Hough Transform, OpenCV and python

前提是你 提交于 2019-12-11 07:15:36
问题 I need help on an algorithm I've been working. I'm trying to detect all the lines in a thresholded image, detect all the lines and then output only those that are parallel. The thresholded image outputs the object of my interest, and then I filter this image through a canny edge detector. This edge image is then passed through the Probabilistic Hough Transform. Now, I want the algorithm to be capable of detecting parallel lines in any image. I had in mind to do this by trying to detect the

Hough Transform C# code [closed]

旧时模样 提交于 2019-12-11 06:37:27
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . Let us take a look at this C# implementation, ... ... // get source image size int width = image.Width; int height = image.Height; int halfWidth = width / 2; int halfHeight = height / 2; // make sure the specified rectangle recides with the source image rect.Intersect( new Rectangle

hough transform error in matlab and openCV?

别来无恙 提交于 2019-12-11 03:35:51
问题 I have been using the Hough transform in my application both using Matlab and OpenCV/labview and found that for some images, the hough transform gave an obviously wrong line fit (consistently) Here are the test and overlayed images. The angle seem right, but the rho is off. On the image below, you will see the top image tries to fit a line to the left side of the original image and the bottom image fits a line to the right side of the image. In Matlab, I call the Hough function through [H1D

Python OpenCV Hough Circles returns None

你说的曾经没有我的故事 提交于 2019-12-11 03:03:16
问题 I'm trying to figure out Hough Circles before I incorporate it into my main code for a tracking program I'm trying to write, but I can't seem to get anything but None out from the circles. I'm using the Bengali flag as my image, since it's simple and will be easy to detect. Here's my code: import numpy as np import cv2 img = cv2.imread('Capture.PNG') grayput = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) circles = cv2.HoughCircles(grayput, cv2.cv.CV_HOUGH_GRADIENT, 1, 20, param1 =50, param2 =10,

Hough transform in Java extract rectangles

自闭症网瘾萝莉.ら 提交于 2019-12-11 01:36:55
问题 I tried this example Hough Transform. But I didn't get any results after making an example with original image. I'm currently wanting to make it work for my application where I'm trying to extract the boxes out and use OCR and get the numbers of this. Please refer to this question for more information. So, I could then add them all up. It's from a paper.png , whose the right side is cropped. 来源: https://stackoverflow.com/questions/29776316/hough-transform-in-java-extract-rectangles

OpenCV: Error in cvHoughCircles usage

守給你的承諾、 提交于 2019-12-11 01:01:04
问题 I am using cvHoughCircles to find the two white ovals in the following image: I first used thresholding for locating the white regions and then used Hough Transforms. But the output is not coming correct as shown below: I am not able to understand what is happening? Why it is detecting 3 circles and why only one is being detected correctly? Any suggestions? Below is my code: #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h>

Calculating center of an object in an image

徘徊边缘 提交于 2019-12-11 00:37:07
问题 I was reading this post to calculate the center of an image using OpenCV which uses Moments . But I am trying to calculate the center of an object I detected using HoughLinesP. Is there a way with OpenCV I could do this? Here is the image for which I am trying to calculate the centers. The line segments were found and the output image looks like: import cv2 import numpy as np import math img = cv2.imread("./images/octa.jpg") b,g,r = cv2.split(img) smoothed = cv2.GaussianBlur(g, (3,3), 0)

Hough transform in MATLAB

爷,独闯天下 提交于 2019-12-10 19:38:41
问题 Does anyone know how to use the Hough transform to detect the strongest lines in the binary image: A = zeros(7,7); A([6 10 18 24 36 38 41]) = 1; Using the (rho; theta) format with theta in steps of 45° from -45° to 90°. And how do I show the accumulator array in MATLAB as well. Any help or hints please? Thank you! 回答1: If you have access to the Image Processing Toolbox, you can use the functions HOUGH, HOUGHPEAKS, and HOUGHLINES: %# your binary image BW = false(7,7); BW([6 10 18 24 36 38 41])