Qengineering / Face-Recognition-Jetson-Nano

Recognize 2000+ faces on your Jetson Nano with database auto-fill and anti-spoofing
https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
BSD 3-Clause "New" or "Revised" License
108 stars 31 forks source link

Need to save recognized face bounding box #13

Closed rsingh2083 closed 2 years ago

rsingh2083 commented 2 years ago

Hi Sir,

I need to save the bounding box of the person who is recognized (in the same way you are populating the database by imwrite). Right now Ive added this code just after line 131 of main.cpp

cv::rectangle(frame, cv::Rect(cv::Point(x, y), cv::Size(label_size.width, label_size.height + baseLine)), color, -1);
cv::putText(frame, Str, cv::Point(x, y + label_size.height + 2), cv::FONT_HERSHEY_SIMPLEX, 0.6, cv::Scalar(0, 0, 0));

//convert recognized face bounding box to base64
string ImgB64;
ImagemConverter m2b;
cv::Mat subFrame;
frame(cv::Rect(x, y, label_size.width, label_size.height + baseLine)).copyTo(subFrame); //THIS IS WHERE IM WRONG
ImgB64 = m2b.mat2str(subFrame);

But ImgB64 is holding "Person id" from the image frame. How to get the bounding box of person face ?