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

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

sheikha gravatar image

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 close merge delete

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 -0500 )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 -0500 )edit