67 lines
1.3 KiB
C
Raw Normal View History

2022-11-10 17:07:39 +01:00
#pragma once
2022-11-14 11:37:38 +01:00
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
class LFRPoint
{
private:
/* data */
public:
double x, y;
LFRPoint(/* args */);
LFRPoint(double x, double y);
~LFRPoint();
LFRPoint operator-(const LFRPoint& pt){return LFRPoint(x-pt.x, y-pt.y);}
LFRPoint operator+(const LFRPoint& pt){return LFRPoint(x+pt.x, y+pt.y);}
};
class LFRVector : public LFRPoint
{
private:
/* data */
public:
LFRVector(/* args */);
LFRVector(double x, double y);
LFRVector(const LFRPoint& pt);
~LFRVector();
};
class LFRLine
{
private:
/* data */
public:
LFRPoint start;
LFRVector dir;
LFRLine(/* args */);
LFRLine(LFRPoint start, LFRVector dir);
LFRLine(LFRPoint start, LFRPoint end);
~LFRLine();
2022-11-14 11:37:38 +01:00
};
2022-12-14 16:14:00 +01:00
class Calcs{
2022-11-14 11:37:38 +01:00
private:
public:
2022-12-14 12:30:54 +01:00
static int calcAngle(int deltaX, int deltaY);
};
class FrameData
{
public:
std::vector<std::vector<cv::Point>> contours;
std::vector<cv::Rect> boundingBoxes;
std::vector<cv::Point> leftEdges;
std::vector<cv::Point> middlePoints;
2022-12-14 16:14:00 +01:00
int angle; //Angle of the contour the robot has to follow to
int index; //Index of the contour the robot has to follow to
FrameData(): contours(), boundingBoxes(), leftEdges(), middlePoints() {}
};