2

i am working on detecting iris from eyes image but i am getting unsatisfactory result. How to detect the exact circle? I have search a lot but unable to find any result.

enter image description here

import cv2
from matplotlib import pyplot as plt
img=cv2.imread(r" 

path",cv2.IMREAD_COLOR)

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

# Blur using 3 * 3 kernel.
gray_blurred = cv2.blur(gray, (3, 3))

detected_circles = cv2.HoughCircles(gray_blurred,
                                cv2.HOUGH_GRADIENT, 1, 200, param1=400,
                                param2=6.787, minRadius=300, maxRadius=400)
if detected_circles is not None:

# Convert the circle parameters a, b and r to integers.
detected_circles = np.uint16(np.around(detected_circles))

for pt in detected_circles[0, :]:
    a, b, r = pt[0], pt[1], pt[2]

    # Draw the circumference of the circle.
    cv2.circle(img, (a, b), r, (0, 255, 0), 20)

    # Draw a small circle (of radius 1) to show the center.
    cv2.circle(img, (a, b), 10, (0, 0, 255), 3)
    imS = cv2.resize(img, (640, 480))
    cv2.imshow("Detected Circle", imS)
    cv2.waitKey(0)
Azmat
  • 21
  • 4
  • You should define the proper houghcircle parameters. You can check [here](https://stackoverflow.com/questions/62040216/detect-overlapping-noisy-circles-in-image/62041309#62041309) Also if you share the source image, we can try too – Yunus Temurlenk Jul 08 '20 at 05:46
  • Well to be honest i have large data set of images. I am not looking for single static image result. I have visit the provide link and used the code but same problem there exist also circle is detecting far away from iris circle. – Azmat Jul 08 '20 at 06:39

0 Answers0