40 lines
843 B
C
40 lines
843 B
C
|
#pragma once
|
|||
|
#include <opencv2/opencv.hpp>
|
|||
|
#include <opencv2/highgui/highgui_c.h>
|
|||
|
#include <iostream>
|
|||
|
|
|||
|
using std::cout;
|
|||
|
using std::endl;
|
|||
|
using std::vector;
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
class armorPoint {
|
|||
|
public:
|
|||
|
cv::Point2f p;
|
|||
|
double distance;
|
|||
|
};
|
|||
|
|
|||
|
//<2F><>һ֡<D2BB><D6A1><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>
|
|||
|
class PreviousFrameInfo {
|
|||
|
public:
|
|||
|
vector<cv::Point2f> previousFramePoints;
|
|||
|
std::chrono::duration<double> elapsedTime;
|
|||
|
bool firstFrame = true;
|
|||
|
double dt;
|
|||
|
};
|
|||
|
|
|||
|
class TargetInfo{
|
|||
|
public:
|
|||
|
vector<cv::Point2f> target_points_;
|
|||
|
double target_speed_;
|
|||
|
double radius_;
|
|||
|
cv::Point2f centor_;
|
|||
|
};
|
|||
|
|
|||
|
|
|||
|
void drawRotatedRect(cv::Mat image, const cv::RotatedRect& rect, const cv::Scalar& color, int thickness);
|
|||
|
|
|||
|
double distance(cv::Point a, cv::Point b);
|
|||
|
|
|||
|
TargetInfo findTarget(cv::Mat rawImages, PreviousFrameInfo & previousFrameInfo, cv::Mat mask);
|