更新 YOLOPv2.h

This commit is contained in:
TY 2025-06-25 13:19:11 +08:00
parent bfe08d2a4e
commit bf914054da

View File

@ -7,6 +7,11 @@
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <onnxruntime_cxx_api.h>
#include "tcp_utility.hpp"
#include <vector>
#include <map>
#include <string>
#include <cstring>
using namespace cv;
using namespace Ort;
@ -34,7 +39,9 @@ class YOLOPv2
public:
YOLOPv2(Net_config config);
Mat detect(Mat& frame);
std::vector<unsigned char> mapToByteArray(const std::map<std::string, double>& param);
private:
tcp::TcpClient tcp_client;
int inpWidth;
int inpHeight;
int nout;
@ -52,7 +59,7 @@ private:
const static int N = 6; //采样点数量
const float dis[N] = {1000, 2000, 3000, 4000, 5000, 6000}; //偏移量采样点实际距离(mm)
const int ypos[N] = {928, 839, 778, 735, 707, 686}; //偏移量采样点y轴坐标
const int center = 1048; //车体中心x轴坐标
const int center = 977;//1048; //车体中心x轴坐标
const float rate[N] = {6.37, 8.26, 10.53, 12.98, 15.87, 19.23}; //图像像素到实际偏移(mm)转换率