How to match the photo in the list of photo database

Is it possible to robot match the pic in the database? Suppose I have a pic and I have a database where all the photos are there. If I capture an image or scan it match that photo in the database and give the resulting photo found.