1

hello guys i'm developing a face recognition program in c# using eigenface algorithm.

My program does save the live image to sql and if i want to retreive the image the program should compare to the sql if image in live capture and in sql database is equal then the image will retreive.

ASK:
is it possible if the image will be the primary key? because im currently using the label that is attach to the face for comparing

TheGameiswar
  • 27,855
  • 8
  • 56
  • 94
andrew faz
  • 35
  • 4
  • Images are big, I don't think it's possible to make them primary key. Why do you want them to be primary key to get fast access or to ensure uniqueness? It is also something that depends on your database engine. – jorgonor Oct 10 '16 at 09:09
  • 5
    Why should you do this? You can create a key for every file based on a hash or similar and use this instead. – MakePeaceGreatAgain Oct 10 '16 at 09:10
  • to ensure the uniqueness – andrew faz Oct 10 '16 at 09:27
  • Why not just GUID, auto-increment index or whatever sane type for primary key? You still get the uniqueness, and you don't compare the image inside SQL anyway, you retrieve them and run it through your algorithm, those kind of columns doesn't belong in primary – Martheen Oct 10 '16 at 09:34

1 Answers1

0

You could make a encoded picture out of it. For example converting it to Base64 Converting Image to Base64 and then comparing the strings. Or a Hash of the picture. hash of a picture

I don't know what database you are using and if you can use blobs or something like that, but generally I wouldn't really suggest making an image a primary key on the first thought.

Community
  • 1
  • 1
Nico
  • 1,727
  • 1
  • 24
  • 42