我正在做一个毕业设计的虹膜识别项目。在
计划是这样的:
1-获取虹膜图像(找到CASIA数据库) 2-检测虹膜(部分完成) 3-切除虹膜区域(完成) 4-插值图像(卡住) 5-应用gabor滤波器(完成) 6-应用canny(完成) 7-计算汉明距离(完成)
import numpy
import cv2
import numpy as np
import os
import math
import scipy
import os
directory = os.listdir("C:/Users/ROOT\Documents/CASIA_IrisDatabase/005/1")
numero_file = len(directory)
print (numero_file)
for file in directory:
print(file)
#file_iride = raw_input("File(riportare anche estensione): ")
for file in directory:
path = "C:/Users/ROOT\Documents/CASIA_IrisDatabase/005/1/%s" % (file)
image_iride = cv2.imread(path)
output = image_iride.copy()
image_test = cv2.imread(path)
image_test = cv2.Canny(image_test, 25, 50, apertureSize=5)
cv2.imshow("Image test", image_test)
image_test = cv2.GaussianBlur(image_test, (7, 7), 3)
#cerchi = cv2.HoughCircles(image_test, cv2.HOUGH_GRADIENT,50, 100.0, 30, 100,100,70)
#cerchi = cv2.HoughCircles(image_test, cv2.HOUGH_GRADIENT, 2, 400, 50, 100, 100, 100)
cerchi = cv2.HoughCircles(image_test, cv2.HOUGH_GRADIENT, 1.3, 800)
if cerchi is not None:
cerchi = np.round(cerchi[0, :]).astype("int")
for (x, y, raggio) in cerchi:
cv2.circle(output, (x, y), 108, (255, 0, 0), 4)
cv2.imshow("Image test", np.hstack([image_iride, output]))
print (raggio)
cv2.waitKey()
x1 = x - 108
x2 = x + 108
y1 = y - 108
y2 = y + 108
#img2 = image_iride[y:y2,x1:x2]
#cv2.imshow("Image test", img2)
#cv2.waitKey()
img2 = image_iride[y1:y2,x1:x2]
cv2.imshow("Image test", img2)
cv2.waitKey()
img2 = cv2.linearPolar(img2, (108, 108), 108, cv2.WARP_FILL_OUTLIERS )
cv2.imshow("Image test", img2)
cv2.waitKey()
但是当我做线性极变换时,图像是这样的,而不是一条直线。 look here
我怎么才能走直线?在
任何帮助都将不胜感激。在
目前没有回答
相关问题 更多 >
编程相关推荐