[ADD] basis for async arm detection

This commit is contained in:
Sem van der Hoeven
2021-05-28 15:31:21 +02:00
parent a68c6a57bf
commit 40529f84b3
9 changed files with 119 additions and 56 deletions

View File

@@ -0,0 +1,43 @@
#include <iostream>
#include "async_arm_detection.h"
#include "../OpenPoseVideo.h"
#include <thread>
namespace computervision
{
AsyncArmDetection::AsyncArmDetection()
{
}
void AsyncArmDetection::run_arm_detection()
{
}
void AsyncArmDetection::start(std::function<void(std::vector<Point>)> points_ready_func, cv::VideoCapture cap, OpenPoseVideo op)
{
auto lambda = [](std::function<void(std::vector<Point>)> f, cv::VideoCapture c, OpenPoseVideo op) {
std::cout << "STARTING THREAD LAMBDA" << std::endl;
cv::VideoCapture cap(0);
if (!cap.isOpened())
{
std::cout << "error opening video" << std::endl;
return;
}
while (true)
{
Mat img;
cap.read(img);
op.movementSkeleton(img, f);
}
};
std::cout << "starting function" << std::endl;
std::thread async_arm_detect_thread(lambda, points_ready_func, cap, op);
}
}