<p><code>HoughCircles</code> is not a strong enough way to detect circle in such complex image like your case.</p>

<p>SO has already had some discussion about this. You could refer these post with quality accepted answers</p>

<p><strong>Standard way:</strong></p>

<p><a href="https://stackoverflow.com/questions/21612258/filled-circle-detection-using-cv2-in-python">Filled circle detection using CV2 in Python?</a></p>

<p><a href="https://stackoverflow.com/questions/15878325/what-are-the-possible-fast-ways-to-detect-circle-in-an-image">What are the possible fast ways to detect circle in an image?</a></p>

<p><strong>Noise image:</strong></p>

<p><a href="https://dsp.stackexchange.com/questions/5930/find-circle-in-noisy-data">https://dsp.stackexchange.com/questions/5930/find-circle-in-noisy-data</a></p>

<p><strong>Another method:</strong>    </p>

<p><a href="http://staff.itee.uq.edu.au/lovell/aprs/dicta2003/pdf/0879.pdf" rel="noreferrer">Gradient Pair Vectors</a></p>

<p><a href="http://arxiv.org/ftp/arxiv/papers/1405/1405.5531.pdf" rel="noreferrer"> Learning Automata</a></p>
Detect circle like shapes opencv
<p>everyone i'm fairly new to OpenCV and computer vision and i'm stuck at this problem , which might seem like a fairly trivial but forgive my noobness :)</p>

<p>I'm trying to detect Rebars from a cross-sectional image.</p>

<p><a href="https://i.stack.imgur.com/HAssA.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/HAssA.jpg" alt="Original Color Image"></a></p>

<p>i'm using this code :</p>

<pre><code>import cv2
import cv2.cv as cv
import numpy as np

img = cv2.imread('test/t2.jpg',0)
img = cv2.equalizeHist(img)
cimg = cv2.cvtColor(img,cv2.COLOR_GRAY2BGR)

circles = cv2.HoughCircles(img,cv.CV_HOUGH_GRADIENT,1,10,param1=50,param2=30,minRadius=0,maxRadius=25)

circles = np.uint16(np.around(circles))
for i in circles[0,:]:
    # draw the outer circle
    cv2.circle(cimg,(i[0],i[1]),i[2],(0,255,0),2)

cv2.imshow('detected circles',cimg)
cv2.waitKey(0)
cv2.destroyAllWindows()
</code></pre>

<p>This is the result i'm getting currently, which is not good :
<a href="https://i.stack.imgur.com/rDmq2.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/rDmq2.jpg" alt="Result"></a></p>

<p>I'm looking for pointers on how to proceed with this problem and how to learn more about CV as i'm really interested!</p>

<p>Thanks a ton!</p>