python-fingerprint-recognition icon indicating copy to clipboard operation
python-fingerprint-recognition copied to clipboard

different result in raspberry pi

Open Sandesh4242 opened this issue 5 years ago • 11 comments

I tried to run the code on raspberry pi, the value of score/len(matches) is different there. when i run this code on anaconda3 the value is 46 but i receive 15 in raspberry pi.

PSA: all the python idle, libraries are same

Sandesh4242 avatar Oct 17 '19 17:10 Sandesh4242

Can you do some backtracking and see which values differ?

kjanko avatar Oct 17 '19 17:10 kjanko

can you be more specific?

Sandesh4242 avatar Oct 17 '19 17:10 Sandesh4242

Check the outputs of:

	kp1, des1 = get_descriptors(img1)
	kp2, des2 = get_descriptors(img2)
	matches = sorted(bf.match(des1, des2), key= lambda match:match.distance)

If the descriptors do not match, check these:

	harris_corners = cv2.cornerHarris(img, 3, 3, 0.04)
	harris_normalized = cv2.normalize(harris_corners, 0, 255, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_32FC1)

	keypoints.append(cv2.KeyPoint(y, x, 1))

kjanko avatar Oct 17 '19 18:10 kjanko

The outputs of kp1, des1 = get_descriptors(img1) kp2, des2 = get_descriptors(img2) matches = sorted(bf.match(des1, des2), key= lambda match:match.distance)

is different. i printed out the value of

harris_corners = cv2.cornerHarris(img, 3, 3, 0.04) harris_normalized = cv2.normalize(harris_corners, 0, 255, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_32FC1)

and its same for both cases. i couldn't print keypoints.append.

Sandesh4242 avatar Oct 18 '19 06:10 Sandesh4242

The outputs of kp1, des1 = get_descriptors(img1) kp2, des2 = get_descriptors(img2) matches = sorted(bf.match(des1, des2), key= lambda match:match.distance)

is different. i printed out the value of

harris_corners = cv2.cornerHarris(img, 3, 3, 0.04) harris_normalized = cv2.normalize(harris_corners, 0, 255, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_32FC1)

and its same for both cases. i couldn't print keypoints.append.

Print the keypoints array after the loop that fills it ends. But since you're saying that the harris corners are detected in the same manner, I'm guessing that ORB behaves differently on embedded hardware. You'll most likely need to report this to OpenCV.

kjanko avatar Oct 18 '19 07:10 kjanko

i think the keypoints array are different. i have attached the outputs below. this is obtained in pc pc this is obtained in raspberry pi 3b pi1 pi2

Sandesh4242 avatar Oct 18 '19 07:10 Sandesh4242

Are you sure the harris_normalized matrices are the same?

kjanko avatar Oct 18 '19 07:10 kjanko

sorry the snip were uploaded in different order, i have corrected it. Please do have a look.

PS: This will be issue for the maximum people now since it is not compatible with raspberry pi, we need to figure out the problem as soon as possbile

Sandesh4242 avatar Oct 18 '19 07:10 Sandesh4242

The keypoints are the same. This means that the output of ORB is different on both platforms. I suggest opening an issue @ OpenCV.

kjanko avatar Oct 18 '19 08:10 kjanko

Can you open an issue and tag me too?

Sandesh4242 avatar Oct 18 '19 08:10 Sandesh4242

Can you open an issue and tag me too?

No.

kjanko avatar Oct 18 '19 14:10 kjanko