I'm doing iris recognition and I have 2 threshold images of iris. How can I do hamming distance between the 2 images with Python ? thx
Here you have the original image before polar transform:
and the code:
img_crop1 = cv.imread('crop_1.png')
polar_img = cv.warpPolar(
img_crop1, (256, 1024), (self.iris_1[0], self.iris_1[1]), self.iris_1[2] * 2, cv.WARP_POLAR_LINEAR)
# Rotate it sideways to be more visually pleasing
polar_img = cv.rotate(polar_img, cv.ROTATE_90_COUNTERCLOCKWISE)
# crop image
polar_img = polar_img[int(polar_img.shape[0] / 2)
: polar_img.shape[0], 0: polar_img.shape[1]]
polar_img = cv.cvtColor(polar_img, cv.COLOR_BGR2GRAY)
_, threshold = cv.threshold(polar_img, 100, 255, cv.THRESH_BINARY)
cv.imwrite("foreground.png", threshold)


The following should work: sum(im1 xor im2)