-5

I need to develop and application for opening/closing of main gate of my office. That application will recognize human eye retina and then open the gate if it is valid. The image of retina is to be stored in database where it matches the upcoming image with the stored images of retina in db. Also when i want to delete the data of retina of specific person from database, it should be deleted. In my criteria, memory usage is to be less and very fast response of time

Which data structure should I use for this scenario?

Samina Jabeen
  • 33
  • 1
  • 6
  • You will have to use a tree like structure because tree ADTs support fast searching. – Zeshan Sajid Aug 09 '16 at 18:18
  • but deletion is miserable in trees. – Samina Jabeen Aug 09 '16 at 18:27
  • Is deletion a time-sensitive operation, though? You probably won't do it multiple times per second. – Don Reba Aug 09 '16 at 18:46
  • Is the retina used as a authorization or identification? – Sylwester Aug 09 '16 at 18:47
  • retina will be used for identification. when a person reaches the gate. sensor captures its retina and forwards to the system where lot of retinas are stored, matches with them, if found then gate opens. – Samina Jabeen Aug 09 '16 at 18:58
  • "*the image of retina is to be stored in database*" - so why do you need a data structure for storage at all? The database handles that already. All you need is to transfer a binary blob. – Bergi Aug 09 '16 at 19:37
  • What other data is passed on by the user? If not it seems the retia scan is used as both identification and authorisation. Like if i had a secret string that pass for both username and password. – Sylwester Aug 09 '16 at 21:28

1 Answers1

1

Storing

Assuming you can get the retinal image using your tech:

  1. Get the byte array of the retinal image.
  2. Compute the hash of that byte array.
  3. Store this hash in your database.

Authenticating

  1. Get the retinal image of the person looking for authentication.
  2. Compute his/her retinal image's hash.
  3. Search the database if there is an existing hash.

The catch

I'm not sure how retinal image is generated. If the image will be even 1 byte different from the image originally taken to compute the hash, the two hashes will absolutely won't match and there is no way to find the relative similarity of two images.

As @DonReba mentioned in the comment below, there are hashes generated specifically for this purpose. Hence, the catch can be overcome by using the correct hashing.


Some Numbers

  1. The deletion of image's hash from the database is O(1)
  2. Searching is O(n) or O(Log n) if you sort the hashes
  3. Memory usage is O(1) per person (depends on the hashing algorithm used - can be 128 bytes, 256 bytes etc).
displayName
  • 13,888
  • 8
  • 60
  • 75
  • This is the right idea. There are hashes designed specifically for this kind of application. – Don Reba Aug 09 '16 at 19:39
  • @DonReba: Didn't know that. I wrote the answer intuitively. – displayName Aug 09 '16 at 19:47
  • A match would not be O(1) since the hash would be [2048 bits and a match is when more than 1515 bits match in place](https://en.wikipedia.org/wiki/Iris_recognition#Operating_principle). Sound like a table scan if the error bits are randomly distributed. – Sylwester Aug 09 '16 at 22:08
  • @Sylwester: I have mentioned the search (which is same match I guess) as O(n) and O(Log n) only. Did I misread you? – displayName Aug 09 '16 at 22:16
  • Delete is based on a different key than retina? O(n) is guaranteed for search. I found a paper about searching such fuzzy stuff that might be relevant: [Large scale Hamming distance query processing](https://www.cse.msu.edu/~alexliu/publications/HammingQuery/HammingQuery_ICDE2011.pdf) – Sylwester Aug 09 '16 at 22:28
  • @Sylwester: My hunch was that record would be destroyed using employee id or something, not the retina scan of the employee. – displayName Aug 09 '16 at 22:59