Hough Circle for Multiplicity Semi Circle - opencv

I have lots of curve But curves should completed to circle How can I do this process with hough circle I tried this method but I cant get a result
Detect semi-circle in opencv
My image is here:

Hough circles is the only way to do this.
The image is noisy but I suspect the problem is that there are very few points and you are trying a wide range of radii. This means that the Hough probability for each circle is very low.
Do you know what the radii should be? If you do try a reduced radius range.
If not I would run the image with a set of small radii ranges and see which produce any result

Related

OpenCV Hough Detection finding inner circle

I'm trying to use Hough circle detection method to find all the circle as shown in the image(shown in image 1 and 2). Initially, I used canny and findContour method (shown in image 3). I'm still unsure which method will be more suitable.The problem with the canny and findContour method was that it didn't find all the circles as well as getting lot of noise. But when using the Hough circle detection, the circle is sometimes catching the outer perimeter instead of the inner as shown in image 2.
The canny+findcontour methods finds the circle contour well but has a lot of noise whereas Hough circle works well but the circles sometimes blends with the outer circle.
Hough circle
Hough circle-zoomed in
canny + findcontour method
I think you can get better results if you pre-process the image. First apply Otsu thresholding, if that doesn't work well use a manual value for threshold. After that use the cv.erode() function to get a crisp boundary. Then try to apply the Hough circle transform.
If performance is not an issue, another interesting thing would be to to look at Holistically Nested Edge Detection and then apply Hough circle transform.
Also have a look at the following:
https://www.learnopencv.com/filling-holes-in-an-image-using-opencv-python-c/
https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_watershed/py_watershed.html

Difference Between Hough Circle and minEnclosed Circle in OpenCV to detect circles?

I just want to know what will the difference be if instead of using hough circle to detect a circle, I find a contour and using minEnclosed circle find the circle? Which one will be more accurate? As far as I can understand both of them should give me the same thing. Can anyone help clarify
minEnclosed circle will enclose all outlier points in your connected component (blob or edge) while Hough circle searches for the best fit using voting algorithm.
So for searching circles; Hough circle is more accurate.
Edit :

Detecting incomplete rectangles (missing corners/ short endges) in OpenCV

I've been working off a variant of the opencv squares sample to detect rectangles. It's working fine for closed rectangles, but I was wondering what approaches I could take to detect rectangles that have openings ie missing corners, lines that are too short.
I perform some dilation, which closes small gaps but not these larger ones.
I considered using a convex hull or bounding rect to generate a contour for comparison but since the edges of the rectangle are disconnected, each would read as a separate contour.
I think the first step is to detect which lines are candidates for forming a complete rectangle, and then perform some sort of line extrapolation. This seems promising, but my rectangle edges won't lie perfectly horizontally or vertically.
I'm trying to detect the three leftmost rectangles in this image:
Perhaps this paper is of interest? Rectangle Detection based on a Windowed Hough Transform
Basically, take the hough line transform of the image. You will get maximums at the locations in (theta, rho) space which relate to the places where there are lines. The larger the value, the longer/straighter the line. Maybe do a threshold to only get the best lines. Then, we are trying to look for pairs of lines which are
1) parallel: the maximums occur at similar theta values
2) similar length: the values of the maximums are similar
3) orthogonal to another pair of lines: theta values are 90 degrees away from other pairs' theta values
There are some more details in the paper, such as doing the transform in a sliding window, and then using an error metric to consolidate multiple matches.

Concentric Circle Detection in image using Hough Transform in AForge.NET

I'm trying to detect concentric circles in an image of a paper target using AForge.NET.
I can clean up the image using Threshold(88) or Edges, but can't work out how to detect the circles.
Original image size = 450 x 479 px
Steps so far:
convert image to greyscale
use Edge to find circles (Threshold(88) also works)
Run HoughTransform with radius of = 100, output using 'ToBitmap'
Count the circles found (I get 69750 circles detected)
Draw the 20 most intensive circles
I don't have a background in image processing; any guidance very much appreciated.
The Solution, in this case, was not to use a Hough Transform at all.
I used a threshold and blob detection to find the outer circle which gave me the centre.
Then an horizontal-intensity histogram to find the peaks that correlate with each ring
Then compare this against the peaks from a vertical-intensity histogram, to get the radius of each ring
Then some sanity checking.
I haven't got the peak detection working yet, but it's in progress and it all looks like working.

Segmenting circle-like shapes out of Binary Image

I have several binary images and my task is to segment circle-like shape. The circles are not perfect rounded circle, but all of them will look like circle. Here are some example images and what I need:
As you can see from above, the left images are original images, and the right images are what I need to do. The circles intersect with other shapes, but I only want the circle, as indicated in red. The imaginary lines to close the circle will be required. What can I do in this case in Image Processing?
EDIT: in case, the image above is broken, here: http://imageshack.us/photo/my-images/835/circleonly.jpg/
Do you know the radii of the disks you are looking for?
If yes, morphological openings (erosion then dilation) would be straightforward, and very fast. The result using Mathematica:
Opening[img, DiskMatrix[15]]
If not, as other proposed, computing the contour image and then using the Hough transform would be a method worth pursuing. The image just above shows the contour image.
You can use hough transform, first you need is the edge image then you use a hough transform like you can see in this papers
http://www.cis.rit.edu/class/simg782/lectures/lecture_10/lec782_05_10.pdf
http://www.sci.utah.edu/~gerig/CS6640-F2010/FINALPROJECT/Ballard-GHT-1981.pdf
http://www.sciencedirect.com/science/article/pii/003132039290064P
http://www.markschulze.net/java/hough/

Resources