I need to extract invariant features of iris from a normal picture [closed]

asked 2017-02-26 11:15:40 -0600

sheikha gravatar image

updated 2020-09-17 06:00:13 -0600

First with haar-cascade method face and eyes are detected (but eye detection is not applicable to all pictures, its even identifying more than 2 eyes or just 1 eye)

then with cv2.medianBlur(img,5) and cv2.Canny(img, 100, 100), input image is smoothened and edges are detected

next i have to apply hough circles to locate iris position inside eyes but fails.. please help .. here is my code


import numpy as np import cv2 face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier('haarcascade_eye_tree_eyeglasses.xml')

img = cv2.imread('sheikha.jpg',0) '''img = cv2.medianBlur(img,5)''' edges = cv2.Canny(img, 100, 100) faces = face_cascade.detectMultiScale( img, scaleFactor=1.3, minNeighbors=5, minSize=(30, 30)) print "Detected %d faces." % len(faces)

print "Drawing rectangles..." for (x, y, w, h) in faces: cv2.rectangle(img, (x, y), (x + w, y + h), (0,255,0), 2) eyes = eye_cascade.detectMultiScale(img, scaleFactor=1.3, minNeighbors=5,minSize=(10,10)) for (ex,ey,ew,eh) in eyes : cv2.rectangle(edges,(ex,ey),(ex+ew,ey+eh),(255,0,0),2)

        circles = cv2.HoughCircles(edges,cv2.cv.CV_HOUGH_GRADIENT,1,20,param1=50,param2=10,minRadius=2,maxRadius=15) 

        circles = np.uint16(np.around(circles))
        for i in circles[0,:]:
            cv2.circle(edges,(i[0],i[1]),i[2],(0,255,0),2)
            cv2.circle(edges,(i[0],i[1]),2,(0,0,255),3)

print "Drawn Rectangles." cv2.imshow('image',edges) cv2.waitKey(0) cv2.destroyAllWindows()

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-09-17 05:59:54.866368

Comments

As your code says, you detect faces with the minsize(30,30). So, the eyes detector could not accurate detect eyes on such small scales... and if we will go further how much pixels should represent the iris for the invariant description evaluation? It seems, that you are trying to extract iris images from the ordinary web or ip camera images... Do not waste your time it is not possible. The right way for the iris recognition is the stationary and controlled image acquisition setup as ophthalmologists are used.

pi-null-mezon gravatar imagepi-null-mezon ( 2017-02-27 02:08:58 -0600 )edit

am currently trying with hd pictures, please help.. next week is the project submission and i have no other way

sheikha gravatar imagesheikha ( 2017-02-27 09:42:03 -0600 )edit