Closed hmaarrfk closed 6 years ago
@tomhughes, Interesting, can you send me a screenshot of the image that you get?
I think message 0x01 returns the serial number or something. I probably shouldn't assert that it is the same as mine.
Message 6 is a little stranger. I don't know what the difference would be between 0x0b and 0x0c. (11 and 12).
I'm about 90% sure that there are some timing issues and that the sensor needs time to boot up.
I would run the code in Spyder, section by section and that would add a significant amount of delay between sections.
To check that you get meaningful data, can you try to plotting the full image including the control lines
by not removing them on line 120 in prototype.py
Message 6 might be firmware version.
I agree that there might be timing issues - one thing I see is that the "expect zeros" at line 79 sometimes fails but rerunning will get past it.
As to the image well the imshow
doesn't actually seem to do anything for me but I'm not sure why exactly. I tried adding in a savefig
to save it as PNG but just got an all white image.
I'll try and play some more tonight...
Actually it is producing an image I just didn't understand the matplotlib interface well enough so I had the savefig in the wrong place.
I think it's an image of my finger, but it seems quite noisy and indistinct.
I don't really need the raw data.
Remove [:, 8:]
from Line 120 and see what you get. There should be a repeating bars that seem like all black or all white points.
It might be that your image sensor returns a different size image.
If I remove that then I get an error:
Data ready
Traceback (most recent call last):
File "prototype.py", line 131, in <module>
plt.imshow(img, vmin=0, vmax=255)
File "/usr/lib64/python3.6/site-packages/matplotlib/pyplot.py", line 3158, in imshow
**kwargs)
File "/usr/lib64/python3.6/site-packages/matplotlib/__init__.py", line 1895, in inner
return func(ax, *args, **kwargs)
File "/usr/lib64/python3.6/site-packages/matplotlib/axes/_axes.py", line 5118, in imshow
im.set_data(X)
File "/usr/lib64/python3.6/site-packages/matplotlib/image.py", line 549, in set_data
raise TypeError("Invalid dimensions for image data")
TypeError: Invalid dimensions for image data
what is the output of
print(img)
print(img.shape)
[ 1 254 1 ..., 142 147 142]
(13440,)
Try changing the line:
img = img.reshape(-1, 120)[:, 8:]
to
img = img.reshape(-1, 120)
(but do not remove it completely)
You should be left with a 112x120 image. The first 8 columns should be something like reference lines (This is my knuckle)
That works - image of a finger tip (rather than the actual print):
Can you try adding the [:, 8:]
again?
It really should just remove those 8 control lines on the edge and return a square image.
You can even add it in the displaying code.
What version of python are you using?
It does yes:
Sorry I think we might have been talking at cross purposes here...
Thats great. Can you verbally confirm that you do get a fingerprint when you put your actual finger on?
Are you able to get the second fingerprint too?
Yes I do seem to get a fingerprint. Not sure what you mean by a second print though?
Incidentally the whole "wait for finger" bit doesn't seem to work - it just goes straight through without waiting so I have to hold the finger on before I run it.
Can you try updating your local code? I updated the code last night or something so that you should have to press "enter" on the prompt to make it go to the second finger.
I need to capture USB data from windows to understand how to detect when a finger is removed.
Yes that seems to work and I am able to capture two different fingers.
Alright. That is awesome!
I'm going to close this issue then.
I'm going to try and provide data dumps of my knuckle so that I can document messages and refer to specific data dumps.
I ended up finding that the two commands you mentioned are actually optional for me.
I'm probably not even going to include them in the final driver.
As I've documented your differences, I'm going to close this issue.
@tomhughes reported a few response differences in #1.
messages 1 and 6 seem to have slight differences.
I have a feeling that message 1 is a serial number. Message 6 might be different. Don't really know.