Add the option to focus on a spcific person
This commit is contained in:
@ -243,12 +243,12 @@ static void reduceSize(cv::Mat& image, const cv::Size& targetSize)
|
||||
if(image.cols > image.rows)
|
||||
{
|
||||
double ratio = static_cast<double>(longTargetSize)/image.cols;
|
||||
cv::resize(image, image, {longTargetSize, static_cast<int>(image.rows*ratio)}, 0, 0, cv::INTER_CUBIC);
|
||||
cv::resize(image, image, {longTargetSize, static_cast<int>(image.rows*ratio)}, 0, 0, ratio < 1 ? cv::INTER_AREA : cv::INTER_CUBIC);
|
||||
}
|
||||
else
|
||||
{
|
||||
double ratio = static_cast<double>(longTargetSize)/image.rows;
|
||||
cv::resize(image, image, {static_cast<int>(image.cols*ratio), longTargetSize}, 0, 0, cv::INTER_CUBIC);
|
||||
cv::resize(image, image, {static_cast<int>(image.cols*ratio), longTargetSize}, 0, 0, ratio < 1 ? cv::INTER_AREA : cv::INTER_CUBIC);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -276,12 +276,13 @@ void pipeline(const std::filesystem::path& path, const Config& config, Yolo& yol
|
||||
{
|
||||
cv::Mat person = image(detection.box);
|
||||
reconizerMutex.lock();
|
||||
std::pair<int, double> match = recognizer->isMatch(person);
|
||||
FaceRecognizer::Detection match = recognizer->isMatch(person);
|
||||
reconizerMutex.unlock();
|
||||
if(match.first >= 0)
|
||||
if(match.person >= 0)
|
||||
{
|
||||
detection.priority += 10;
|
||||
hasmatch = true;
|
||||
detections.push_back({0, "Face", match.confidence, 20, {255, 0, 0}, match.rect});
|
||||
}
|
||||
}
|
||||
Log(Log::DEBUG)<<detection.class_id<<": "<<detection.className<<" at "<<detection.box<<" with prio "<<detection.priority<<(hasmatch ? " has match" : "");
|
||||
|
Reference in New Issue
Block a user