# Tag Info

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 ...

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

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 ...

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 ...

5

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 ...

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 ...

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

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

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, ...

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 are ...

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

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

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

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 ... 2 You could represent the grid with 5 parameters: (x0, y0) to represent the offset from your image origin to the grid origin (xs, ys) to represent a multiplication factor from your image plane to your grid plane. If your grid is spaced apart every 100 pixels on your image plane, these values might be 100,100 theta to represent the rotation of the grid You ... 1 The performance of line detectors are image and application dependent in generally. Typically, people tune the parameters of the detectors to get the best possible result. When such a result cannot be obtained, it is often because of the insufficient performance of the detector for the current problem. One approach would be to change the algorithm. For ... 1 There is a big difference: The Hough Transform maps the input space to a parameter space, where the search takes place. This way, the run-time of the algorithm is independent of the degree of the spatial search space. Correlation based methods are rather more brute force in that sense as they search explicitly for all transformations. Of course, there are ... 1 Fit a line through the end points using standard line model$ax+by+c=0$. Then draw them on the image from -10000, 10000. The points remaining on the image will give you what you are asking for. 1 I'll start with the Hough line transform. The hough transform works by creating a buffer (2 dimensional in our case) which represents all the possible lines in the image. Any possible line can be represented with those 2 numbers$(\rho, \theta)$From wikipedia Note this uses polar coordinates to avoid division by zero issues rather than your typical$y =...

1

Check this out. It is an easy to follow implementation. You can compare your implementation against this. Here is a no loop version. Another advice is to add comments in the code above so that it could be understood better.

1

OpenCV now has a text detection module included. You might want to take a look at it: Detector: http://docs.opencv.org/master/modules/objdetect/doc/erfilter.html Recognizer: http://docs.opencv.org/trunk/modules/text/doc/ocr.html

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