parent
b7ba593ee9
commit
333f28d634
After Width: | Height: | Size: 132 KiB |
After Width: | Height: | Size: 420 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,29 @@
|
||||
#ifndef ATR_H
|
||||
#define ATR_H
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <QImage>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
#include <cv_bridge/cv_bridge.h>
|
||||
#include <QObject>
|
||||
#include <QThread>
|
||||
#include <QStringListModel>
|
||||
#include <QSettings>
|
||||
|
||||
class ATR : public QThread{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ATR();
|
||||
void runCommand();
|
||||
void getSolvedPic();
|
||||
|
||||
cv::Mat SolvedImg;
|
||||
|
||||
Q_SIGNALS:
|
||||
void show_solvedImage(QImage solvedImage);
|
||||
};
|
||||
|
||||
#endif // ATR_H
|
@ -0,0 +1,29 @@
|
||||
#include "../include/Air_Ground_CEC/atr.h"
|
||||
using namespace std;
|
||||
#include "stdlib.h"
|
||||
char filename[100];
|
||||
|
||||
ATR::ATR()
|
||||
{
|
||||
}
|
||||
|
||||
void ATR::runCommand(){
|
||||
string ws = "cd /home/cyber/Study/Codes/catkin_ws/src/Air_Ground_CEC/src/YOLOv6";
|
||||
string CMD = "python3 ../YOLOv6/tools/infer.py --weights ../YOLOv6/yolov6n.pt --source ../YOLOv6/imgdir/";
|
||||
string Pic = "x.jpg";
|
||||
string Command = ws + "&&" + CMD + Pic;
|
||||
std::cout<<Command<<endl;
|
||||
system(Command.c_str());
|
||||
}
|
||||
|
||||
void ATR::getSolvedPic(){
|
||||
string Path = "/home/cyber/Study/Codes/catkin_ws/src/Air_Ground_CEC/src/YOLOv6/runs/inference/exp/";
|
||||
string SolvedPicPath = Path + "x.jpg";
|
||||
sprintf(filename, SolvedPicPath.c_str());
|
||||
SolvedImg = cv::imread(filename);
|
||||
QImage image = QImage(SolvedImg.data,SolvedImg.cols,SolvedImg.rows,SolvedImg.step[0],QImage::Format_RGB888);
|
||||
std::cout<<"image"<<endl;
|
||||
emit show_solvedImage(image);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue