31 lines
657 B
C++
31 lines
657 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;
|
|
|
|
//击打板点类
|
|
class armorPoint {
|
|
public:
|
|
cv::Point2f p;
|
|
double distance;
|
|
};
|
|
|
|
//上一帧的信息类
|
|
class PreviousFrameInfo {
|
|
public:
|
|
vector<cv::Point2f> previousFramePoints;
|
|
std::chrono::duration<double> elapsedTime;
|
|
bool firstFrame = true;
|
|
};
|
|
|
|
|
|
void drawRotatedRect(cv::Mat image, const cv::RotatedRect& rect, const cv::Scalar& color, int thickness);
|
|
|
|
double distance(cv::Point a, cv::Point b);
|
|
|
|
vector<cv::Point2f> findTarget(cv::Mat rawImages, PreviousFrameInfo & previousFrameInfo, cv::Mat mask);
|