OpenCV: How to identify a face in scalable way?
Scenario: i use a sql database for saving the face descriptor and eventually a hash for this descriptor. Database can be huge. I m searching a way gor identify a generic face present in a image(image can be from another panorama) having the face descriptor in database
img is the image variable: DescriptorExtractor descriptor = DescriptorExtractor.create(DescriptorExtractor.SURF);
System.loadLibrary(Core.NATIVE_LIBRARY_NAME); Mat img_1=Imgcodecs.imread(img);
MatOfKeyPoint kp_1 = new MatOfKeyPoint();
FeatureDetector fd = FeatureDetector.create(FeatureDetector.FAST); fd.detect(img_1, kp_1); descriptor.compute(img_1,kp_1,descriptors_1);
If i save the descriptor in db and also its hashcode.
when i want identify a face in a image... i extract the descriptor from that image and i calculate his hashcode. Then i query in database all descrioptors with same hashcode(rarely can be more than 1). Then i compare the descriptor present in db with the descriptor from image.
Can this algorithm work correctly? How to compare Mat classes? How to create a hashcode from Mat class?
"Can this algorithm work correctly?" -- never.
Please suggest me how to do if you think it is wrong. I searched in google ... i found similar ideas about hashing SURF descriptors using spatial hashing. Maybe there is a missing step (the neural training step). Maybe i might save in db also the neural trained net for every face. And check identification for each face resulted by query.
just curious, what does your "hashing" do, exactly ?