# Tag Info

14

The best ideas that exactly tries to solve this problem is Hough Transform . Basically, the signal in hough space will be r, x, y co-ordinates. Here r stands for radius and x,y stands for center. Every points may belong to one or many circles. So in the Hough plane go through all possible circles where this point could belong to and just do a +1. This is ...

13

Canny Edge Detection is considered to be a better (In False Alarm sense) edge detection than those you mentioned. This is, mainly, due to 2 steps: Non Maximum Suppression - Edges candidates which are not dominant in their neighborhood aren't considered to be edges. Hysteresis Process - While moving along the candidates, given a candidate which is in the ...

11

Firstly, Matlab has a Built in Hough Transform: no need to reinvent the wheel. [H,T,R] = hough(BW,'RhoResolution',0.5,'Theta',-90:0.5:89.5); Although your image doesn't necessarily require edge detection you could improve the processing time and effectiveness of the algorithm my using it. Your triangle has fat regions of white and black. Ideally, the ...

11

An alternative to the Hough Transform would be the Radon Transform (1, 2). A rough description of an algorithm to detect a grid-like structure could look like this: 1. Perform Radon Transform from 0 to 180 degrees. 2. Find the two highest maxima in the angle bins. 3. For the two angles with maximal amplitude find the local maxima within the bin. 4. You can ...

10

The Hough Transform would indeed help in picking up the Grid in this case. To "thin" the lines, you might want to consider the operation of Skeletonization That would produce an image like this one: Due to the way that skeletonization works, it will still produce some lines that will seem irrelevant to the grid but these lines towards "erroneous" ...

9

You are finding the coordinates of the peaks and then uses the axis to scale those into [θ,ρ] coordinates. Depending on how noisy the data, how many false peaks you expect and how much time you have, there are a few ways of doing it. Easiest is to pick some level that is a a real peak, cut of all data below that and then do a center of gravity on each ...

9

Here is what I experimented with: Use ELSD to generate elliptic contours. You could basically use any edge detector, but since in the following stages I will benefit from circle detectors, it is good to already have some geometrical edges. Here is what the output looks like:               &...

6

Your statement that the Hough transform (HT) needs to be applied on a binary image is not true. The original HT indeed was formulated that way, though in the meanwhile different authors extended the HT in numerous ways -- for example to consider the gray scale values of each image pixel. As a consequence, the step of edge detection can be omitted. Citations ...

6

Parallel lines in the image do intersect at a vanishing point. Therefore simply hypothesizing lines (a gradient direction at a point suffices to describe it) and voting (see Hough voting) would suffice to identify this point. One could then record all the lines that casted votes to this very point and identify them. Care must be taken as it is difficult to ...

5

1) Normalize your image to range $[0,255]$. 2) Select a threshold and threshold the image. For your image, what worked is: $\tau=[140-150]$. 3) Compute a Euclidean distance transform. 4) Apply watersheds segmentation. If I apply this procedure, here is what I get: Not perfect, but maybe a good start. The result looks similar to performing a Voronoi ...

4

Intuition for parameters of HoughCircles: image: 8-bit, single channel image. If working with a color image, convert to grayscale first. method: Defines the method to detect circles in images. Currently, the only implemented method is cv2.HOUGH_GRADIENT, which corresponds to the Yuen et al. paper. dp: Resolution of the accumulator array. Votes cast are ...

3

if image(xi, yj) == 1 needs to be changed to if image(yj, xi) == 1 for the lines to work out in the dehough

3

The biggest issue is that the pixels for each line are too few (I will explain with more details below). I would consider to stretch, and then dilate your raw image a little bit: file='http://i.stack.imgur.com/LmIJJ.png'; I=imread(file); I=imcrop(I,[1 206 size(I,2) size(I,1)]); I=imresize(I,[size(I,1) 256]); I=imdilate(I,strel('line',1,0)); I assume you ...

3

Well, it really depends on what you expect to find in the image. The matlab function uses an example threshold of half the largest peak. What sort of images are you using this on? So, based on just finding vertical lines in your image, let's make some assumptions. Your rectangle's minimum vertical side length is $L_{\rm min}$ pixels. Your edge detection ...

3

The Hough Transform is "right". Because it searches for the most consistent "shape" given the accumulated values. If all you would like to do is to find the center of the spot, there are other techniques (from simple to...less simple) that you could use. The Hough Transform produces another image that is composed of the accumulated "projections" of the ...

3

What you are essentially doing is a matched filter. However, thanks to Hough transform, your filter (line) is oriented and therefore I would call it an oriented matched filter. For generating the Bresenham line and sampling the pixels you might want the use the OpenCV line iterator. The simple usage would be similar to: cv::LineIterator it(image, pt1, pt2, ...

2

You can locate the local maxima for a given radius. For example, you scan the Hough image taking peaks as maxima only when they are maximal in a $3\times 3$ window. The second step could be refining the peak position to sub-pixel accuracy. This can be done by parabola fitting. Suppose the value in Hough image is $f(x)$ where $x$ is the 2D position. Now you ...

2

This code on the File Exchange will help you find all the local maxima. http://www.mathworks.com/matlabcentral/fileexchange/14498-local-maxima-minima If you have some knowledge about how many lines you want to find (in this case five), you simply select the five local maxima with the highest Hough scores.

2

Assuming you are using discrete inputs and that s(0..n-1) (or s(1...n) in Matlab) is an array of x,y points along the boundary of a 2d shape ... Gradient(i) = (s(i).x, s(i).y) - (s(i-1).x, s(i-1).y) Amplitude(i) = sqrt(Gradient(i).x^2 + Gradient(i).y^2) Angle(i) = atan(Gradient(i).y / Gradient(i).x) To make you calculations relative to (Xc,Yc) substract (...

2

It's a little mis-leading and confusing. The usual way to describe an ellipse is using cartesian ($x,y$) coordinates. Another way to represent an ellipse is using polar coordinates ($r,\theta$) (where $r$ is the distance (radius) from the origin, and $\theta$ is the angle. What the equation is saying is that the cartesian coordinates of the ellipse are ...

2

You should play around with the many parameters of the Canny() and HoughLinesP() functions before resorting to changing the image size. The prototype for Canny() is: void Canny(InputArray image, OutputArray edges, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false ) You should play with the threshold1, ...

2

Another answer from my comments (I would prefer to re-answer rather than edit the solution 1): imrotate(I, theta,'loose'); % theta ranges from 0 to 180 then use imfilter(I,f); where you may have 4 choice for f: f=[-1 -1 -1; 2 2 2;-1 -1 -1]; % horizontal line f=[-1 2 -1;-1 2 -1;-1 2 -1]; % vertical f=[-1 -1 2;-1 2 -1;2 -1 -1]; % 45 degree f=[2 -1 -1;-1 2 -...

2

Determine the accuracy you will need for each of your six DOF. Don't use larger accuracy than you actually need, since it will get you in trouble later, when you have to find maxima in the Hough Space. Determine the range of possible transformation parameters for you six DOF. Now create a six dimensional array A (one dimension for each DOF) where each ...

2

If you have an idea what size circles you are looking for, then it would be best to set min_radius and max_radius accordingly. Otherwise, it will return anything circular of any size. Parameters 1 and 2 don't affect accuracy as such, more reliability. Param 1 will set the sensitivity; how strong the edges of the circles need to be. Too high and it won't ...

2

this is John BG jgb2012@sky.com 1.- Avoid doubling segments If you carry on with the code you have used in your approach: img=imread('001.jpg'); imshow(img); img = rgb2gray(img); img = medfilt2(img); v = edge(img,'sobel','vertical'); v = bwlabel(v); stats = regionprops(v, 'Area','BoundingBox','Image'); ids = find([stats.Area] > 30 & [stats.Area] &...

2

You mentioned the Hough transform, but your code doesn't use it. However, it can help you to find out the orientations of lines. The maximum values of the Hough transform correspond to probable lines. These maxima are defined by their coordinates $(\rho, \theta)$, where $\rho$ is the distance from the origin to the closest point on the straight line, and $\... 2 No this won't work. Simply because we do not know the center of the circle in advance (no oracle telling us) and therefore we cannot find a voting space parameterization where$r$is fixed and only$\theta$changes. For each point both quantities will change and this will still generate a curve in the Hough space. Having said that, I think below there is ... 2 do a distance transform. you'll see why that's a good idea: for every pixel you get the shortest distance to a border. that's exactly the radius of an inscribed circle. from this, just find the pixel with the largest value. if you're curious, throw a "non-maximum suppression" on it. that is a kind of "morphological" kernel operation where you set a pixel ... 2 If the shape is rotated by$\theta$, then the gradient orientation ($\phi$) for a given edge point changes. So, shouldn't we do either one of the following: Rotate all the ϕ values in R table by θ? OR Rotate gradient vector by ($-\theta$) and then calculate$\phi\$ for the edge point? The generalised Hough transform does #1 ...

2

Segmentation is generally a process that is very susceptible to noise. I would better use a detector, especially for geometric shapes like coins. Remember, if you have a good detection, you also ease the segmentation problem dramatically. For the example of coins, a good model would be to use an ellipse: every circle/ellipse appears to be an ellipse under ...

Only top voted, non community-wiki answers of a minimum length are eligible