#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
int main(int argc, char *argv[])
{
Mat src = Mat::zeros(Size(1280, 1024), CV_8UC3);
line(src, Point(450, 380), Point(440, 470), Scalar(0, 0, 255), 18);
line(src, Point(650, 400), Point(640, 490), Scalar(0, 0, 255), 18);
line(src, Point(850, 370), Point(870, 460), Scalar(0, 0, 255), 18);
detect_ptr detector = ArmorDetector::make_detector();
vector<group_ptr> groups;
detector->detect(groups, src,
RED, GyroData(), getTickCount());
auto p_combos = detector.combos;
INFO_(
"size of armors = %ld", p_combos.size());
for (auto &p_combo : p_combos)
{
auto corners = p_combo->getCorners();
line(src, corners[0], corners[2], Scalar(0, 255, 0), 2);
line(src, corners[1], corners[3], Scalar(0, 255, 0), 2);
}
namedWindow("rmvl_deploy_test: src", WINDOW_NORMAL);
resizeWindow("rmvl_deploy_test: src", Size(640, 512));
imshow("rmvl_deploy_test: src", src);
HIGHLIGHT_(
"RMVL build Successfully!\n\n\t\t-------- "
"press any key to exit this program. --------\n");
waitKey(0);
return 0;
}
#define HIGHLIGHT_(msg...)
Definition: util.hpp:28
#define INFO_(msg...)
Definition: util.hpp:56
std::unique_ptr< detector > detect_ptr
Definition: detector.h:69
@ RED
红色通道
Definition: pretreat.h:27
Definition: uty_math.hpp:63