With Hough circle function of openCV I can detect circular patterns in an image. In particular this is my algorithm (in python)
import cv2
img = cv2.imread(in_imagefile)
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
gray_img = cv2.GaussianBlur(gray_img,(9,9),0)
circles = cv2.HoughCircles(gray_img, cv2.cv.CV_HOUGH_GRADIENT, dp, minDist, minRadius=minR, maxRadius=maxR)
This code is excellent in order to detect circular objects in images. (Here an example of my results:
But when object to detect are ellipse (for example because the photo has a little of perspective) the algorithm fails. Try for example with this image:
Is there a way to detect elliptical patterns in images? Something like HoughCircles function of openCV for ellipse, or another algorithm?
Any advice is welcome!