hough-transform

HoughCircles Parameters to recognise balls

南笙酒味 提交于 2019-12-17 19:01:45
问题 After processing an image by converting it to grey scale and then blurring it, I'm trying to apply a Hough Circle Transformation with these parameters: CV_HOUGH_GRADIENT dp = 1 min_dist = 1 param_1 = 70 param_2 = 100 min_radius = 0 max_radius = 0 Here is one of the many images I've tried: http://i.stack.imgur.com/JGRiM.jpg But the algorithm fails to recognise the ball even with relaxed parameters. (When I try it with an image of a circle created in GIMP it works fine) 回答1: I agree with krzych

Fine Tuning Hough Line function parameters OpenCV

流过昼夜 提交于 2019-12-17 10:58:29
问题 I've been trying to get 4 lines around the square so that I can obtain the vertices of the square. I'm going with this approach rather than finding corners directly using Harris or contours method due to accuracy. Using houghlines in built function in opencv I'm unable to get full length lines to get intersection points and I'm also getting too many irrelevant lines. I'd like to know if the parameters can be fine tuned to obtain my requirements? If yes how do I go about it? My question is

Horizontal Line detection with OpenCV

烈酒焚心 提交于 2019-12-17 07:07:28
问题 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 for the job. The Hough transform implementation in OpenCV seemed useful for the job, but I could not find any combination of parameters that would allow it to cleanly find the vertical and horizontal lines. I tried with and without edge detection.

logic behind the code

☆樱花仙子☆ 提交于 2019-12-14 03:21:38
问题 could any one explain me logic behind this code?? pt1.x = cvRound(x0 + 1000*(-b)); pt1.y = cvRound(y0 + 1000*(a)); pt2.x = cvRound(x0 - 1000*(-b)); pt2.y = cvRound(y0 - 1000*(a)); 回答1: You have a point defined by x0, y0 . You're now creating two other point objects, one at (-b*1000, a*1000) and one at (b*1000, -a*1000) relative to the original point. Presumably the 1000 is to fix problems of scale, as the values a and b are on a different scale than the points x0, y0 . 回答2: It looks like a

Hough Line Transform implementation

久未见 提交于 2019-12-13 08:50:01
问题 I am trying to implement Hough Line Transform. Input. I am using the following image as input. This single line is expected to produce only one intersection of sine waves in the output. Desired behavior. my source code is expected to produce the following output as it was generated by the sample application of AForge framework. Here, we can see: the dimension of the output is identical to the input image. the intersection of sine waves are seen at almost at the center. the intersection

Speeding up HoughCircles

雨燕双飞 提交于 2019-12-13 07:17:32
问题 I have problem with the houghcircles function, regarding its processing speed. when i try to run the code with this video file, i uploaded onto Youtube. https://youtu.be/5RGRTPEdHVY The problem is, when the copter is taking off, the code is stucked, and stop moving. At this stage, when the copter is taking off, the param must be set manually at 300 to avoid being stucked. then after taking off, the param must be reduced to about 150 or 130 to detect the circles on the field. Now i do not want

To find minute circles using hough circle function in opencv for iris

≡放荡痞女 提交于 2019-12-13 06:14:54
问题 I need to detect the iris of the eye picture I have using HoughCircle function thats available in opencv2. So , // Read the image src = imread("D:/001R_3.png"); if( !src.data ) { return -1; } /// Convert it to gray cvtColor( src, src_gray, CV_BGR2GRAY ); /// Reduce the noise so we avoid false circle detection GaussianBlur( src_gray, src_gray, Size(9, 9), 2, 2 ); ///////////// /// Generate grad_x and grad_y Mat grad_x, grad_y; Mat abs_grad_x, abs_grad_y; Sobel( src_gray, grad_x, ddepth, 1, 0,

Barcode detection using Hough Transform & Edge Detection

狂风中的少年 提交于 2019-12-13 02:38:34
问题 Matlab code for barcode detection using Hough tranform & edge detection techniques is required. I tried built in matlab functions for this but could not get the result because i know very little about Hough transform, edge detection or barcode detection So, any kind of help is much appreciated. So far i did this .. a=imread('BEAN13.jpg'); b = rgb2gray(a); rotI = imrotate(b,30,'crop'); %figure,imshow(rotI) BW = edge(rotI,'sobel'); [H,T,R] = hough(BW); imshow(H,[],'XData',T,'YData',R,...

How exactly does dp parameter in cv::HoughCircles work?

此生再无相见时 提交于 2019-12-12 10:05:33
问题 I read similar question in Stack Overflow. I tried, but I still can not understand how it works. I read OpenCV document cv::HoughCircles, here are some explanation about dp parameter: Inverse ratio of the accumulator resolution to the image resolution. For example, if dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has half as big width and height. Here are my question. For example, if dp = 1, the size of accumulator is same as image, there is a

Python cv2 HoughLines grid line detection

只愿长相守 提交于 2019-12-12 08:12:37
问题 I have a simple grid in an image, I am trying to determine the grid size, e.g. 6x6, 12x12, etc. Using Python and cv2. I am testing it with the above 3x3 grid, I was planning to determine the grid size by counting how many vertical / horizontal lines there are by detecting them in the image: import cv2 import numpy as np im = cv2.imread('photo2.JPG') gray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY) imgSplit = cv2.split(im) flag,b = cv2.threshold(imgSplit[2],0,255,cv2.THRESH_OTSU) element = cv2