[EDIT] added evrything to namespace, also fixed includes

This commit is contained in:
Jasper
2021-05-21 12:12:42 +02:00
parent e39cb1a761
commit 27a09aeca4
12 changed files with 493 additions and 454 deletions

View File

@@ -1,32 +1,36 @@
#pragma once
#include "opencv/cv.h"
#include "opencv2/core.hpp"
#include <opencv2/imgproc/types_c.h>
/*
Author: Nicol<6F> Castellazzi https://github.com/nicast
*/
using namespace cv;
using namespace std;
namespace computervision
{
using namespace cv;
using namespace std;
class FingerCount {
public:
FingerCount(void);
Mat findFingersCount(Mat input_image, Mat frame);
class FingerCount {
public:
FingerCount(void);
Mat findFingersCount(Mat input_image, Mat frame);
private:
Scalar color_blue;
Scalar color_green;
Scalar color_red;
Scalar color_black;
Scalar color_white;
Scalar color_yellow;
Scalar color_purple;
double findPointsDistance(Point a, Point b);
vector<Point> compactOnNeighborhoodMedian(vector<Point> points, double max_neighbor_distance);
double findAngle(Point a, Point b, Point c);
bool isFinger(Point a, Point b, Point c, double limit_angle_inf, double limit_angle_sup, cv::Point palm_center, double distance_from_palm_tollerance);
vector<Point> findClosestOnX(vector<Point> points, Point pivot);
double findPointsDistanceOnX(Point a, Point b);
void drawVectorPoints(Mat image, vector<Point> points, Scalar color, bool with_numbers);
};
private:
Scalar color_blue;
Scalar color_green;
Scalar color_red;
Scalar color_black;
Scalar color_white;
Scalar color_yellow;
Scalar color_purple;
double findPointsDistance(Point a, Point b);
vector<Point> compactOnNeighborhoodMedian(vector<Point> points, double max_neighbor_distance);
double findAngle(Point a, Point b, Point c);
bool isFinger(Point a, Point b, Point c, double limit_angle_inf, double limit_angle_sup, cv::Point palm_center, double distance_from_palm_tollerance);
vector<Point> findClosestOnX(vector<Point> points, Point pivot);
double findPointsDistanceOnX(Point a, Point b);
void drawVectorPoints(Mat image, vector<Point> points, Scalar color, bool with_numbers);
};
}