[ADD] detecting if hand is in square

This commit is contained in:
Sem van der Hoeven
2021-06-04 13:10:11 +02:00
parent f5926fffcb
commit 81dec3b9f4
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#include "HandPresentChecker.h"
#include <opencv2/imgproc.hpp>
#include <iostream>
namespace computervision
{
bool check_if_hand_present(cv::Mat inputImage)
{
std::vector<std::vector<cv::Point>> points;
cv::Mat imgCont;
cv::findContours(inputImage, points, cv::RetrievalModes::RETR_LIST, cv::ContourApproximationModes::CHAIN_APPROX_SIMPLE);
bool hand_present = points.size() > 0;
std::cout << (hand_present ? "hey a hand!" : "damn no hand") << std::endl;
return hand_present;
}
}

View File

@@ -0,0 +1,7 @@
#pragma once
#include <opencv2/core.hpp>
namespace computervision
{
bool check_if_hand_present(cv::Mat inputImage);
}