View previous topic :: View next topic |
Author |
Message |
Zek_De
Joined: 13 Aug 2016 Posts: 100
|
FingerPrint Transferring 4 bit |
Posted: Wed Nov 13, 2019 11:34 pm |
|
|
Hi guys, I am going to use fingerprint sensor and the values that I have got are about 34000 and datasheet tell me:
Quote: |
ImageBuffer serves for image storage and the image format is 256*288 pixels.
When transferring through UART, to quicken speed, only the upper 4 bits of the pixel is transferred (that is 16 grey degrees). And two adjacent pixels of the same row will form a byte before the transferring. When uploaded to PC, the 16-grey-degree image will be extended to 256-grey-degree format. That ¡s 8-bit BMP format.
|
I don't know what does it mean exactly. My information about pictures is not good sufficiently. If I put these array in C#, the program gives error. So how can I get arrays in right way, or any person did it? Any simple code or an nice information please. Thank you. |
|
|
benedictkim
Joined: 14 Nov 2019 Posts: 11
|
Re: FingerPrint Transferring 4 bit |
Posted: Thu Nov 14, 2019 2:02 am |
|
|
1pixel = 1bit
ImageBuffer size = 256(Horizontal)*288(Vertical) = 73,228
2^4 = 16
8bit BMP format = 2^8 = 256 |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Thu Nov 14, 2019 5:35 am |
|
|
You should post a 'link' to the sensor datasheet ! Perhaps someone has already written code for it.
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19540
|
|
Posted: Thu Nov 14, 2019 6:48 am |
|
|
The key point is that the sensor is returning 16 grey levels for
each point, but instead of returning these as bytes is combining the values
from two successive pixels into each byte sent.
Now I have to comment that I hope the poster is using something like
a DSPIC?. There is no way that this is a suitable device to be attached to
anything but a very large PIC. Each image is going to involve 36864bytes
of data. (256*288/2), and large data sets are the thing that PIC's are
least suited to working with. I honestly have to say this is the sort of
device much more suited to something like an Arduino, with a lot of RAM.... |
|
|
Zek_De
Joined: 13 Aug 2016 Posts: 100
|
|
Posted: Fri Nov 15, 2019 2:49 am |
|
|
Probably I should read about bmp file to understand details actually me and my friends working together and I am gonna say him about dspic to search suitable device.Thank you again friends. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Fri Nov 15, 2019 9:21 am |
|
|
You need to tell us more about the project.
option #1
IF you want to have the PIC read the sensor and send to PC, then almost any PIC will do the task, but I'd choose one with 2 hardware UARTs. However at 9600 baud it will take about 38 seconds to transfer the data from sensor to PC. If you can set baudrate to 115K200, then a transfer is about 4 seconds.
In this case, main() is a simple loop. Read sensor data, send to PC, loop 36,864 times.
option #2
IF you want to STORE all the sensor data with the PIC, then you'll need some SRAM or FRAM connected to the PIC. Here the PIC reads and saves all 36,864 bytes of sensor data, then transmits the stored data to the PC.
This is slighlty more complicated as Main() here has 2 parts. 1 -capture the sensor data, 2- transmit to PC.
If you want/need the PIC to do anything with the sensor data BEFORE sending to the PC, then you'll need to choose option #2.
Jay |
|
|
Zek_De
Joined: 13 Aug 2016 Posts: 100
|
|
Posted: Sat Nov 16, 2019 2:09 am |
|
|
We will use option #1, any PIC to send data to PC as in control. Heavy work will be done in PC that will register all data and compare persons. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19540
|
|
Posted: Sat Nov 16, 2019 2:31 am |
|
|
OK. In which case, look at:
<https://en.wikipedia.org/wiki/BMP_file_format>
and search in this for:
"4-bit per pixel (4bpp) format"
This is what is being used by the device. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Sat Nov 16, 2019 6:24 am |
|
|
Be sure to choose a PIC with 2 hardware UARTS ! You need very reliable communications. |
|
|
Zek_De
Joined: 13 Aug 2016 Posts: 100
|
|
Posted: Sat Nov 16, 2019 1:08 pm |
|
|
Okay thank you guys for information. |
|
|
|