#pragma once
|
#include <iostream>
|
#include <opencv2/opencv.hpp>
|
#include <ctime>
|
#include <thread>
|
#include <stdio.h>
|
#include "deploy/yolov5.hpp"//目标识别
|
#include "deploy/run.h"
|
#include "deploy/belt.hpp"
|
#include <assert.h>
|
#include <fstream>
|
#include <string>
|
#include <json/json.h>
|
#include <locale>
|
#include <codecvt>
|
|
using namespace cv;
|
using namespace std;
|
using namespace Json;
|
|
struct MatData {
|
cv::Mat iMat; // Mat 对象
|
string codec;
|
bool flag; // 是否处理标志位
|
};
|
|
class PreProcessFn
|
{
|
|
public:
|
PreProcessFn();//构造函数
|
|
~PreProcessFn(void);//析构函数
|
|
string warningFilePath = "/home/zzj/video";//报警录像保存位置
|
string coalCode = "123456789";//煤矿编号
|
string redispath = "127.0.0.1";//redis链接
|
string redisport = "6379";//redis端口
|
string redispass = "";//redis密码
|
|
string mysqlpath = "127.0.0.1";//mysql链接
|
string mysqlport = "3306";//mysql端口
|
string mysqluser = "root";//mysql账号
|
string mysqlpass = "!zkyc13579";//mysql密码
|
string mysqldatabase = "db";//mysql连接的数据库
|
|
string rabbitpath = "";//rabblitMQ地址
|
string rabbitport = "";//rabblitMQ端口
|
string rabbituser = "";//rabblitMQ用户名
|
string rabbitpass = "";//rabblitMQ密码
|
std::vector<std::vector<int>> c_list;
|
bool asyncStop = false;
|
|
long skipN = 50;//取帧延迟
|
int recordtime = 20;//报警录制时长
|
int RecIntervalime = 100;//录像间隔时间
|
|
/// @brief 视频流拉取处理
|
/// @param _rtspUrl 视频流源地址
|
/// @param queJC 未处理的视频流帧队列
|
void fnGetVideoMatToQueue(string _rtspUrl, queue<Mat>& queJC);
|
|
/// @brief 视频帧处理函数
|
/// @param ipcsNode 摄像机节点
|
/// @param modelArray 模型列表
|
/// @param queJC 未处理的视频流帧队列
|
/// @param queJC2 处理完的视频流帧队列
|
void fnImRecognitionPro(const Json::Value& ipcsNode,Json::Value modelArray, queue<Mat>& queJC, queue<Mat>& queJC2);
|
|
/// @brief 推流到rabbitmq
|
/// @param queJC2 处理完的视频流帧队列
|
/// @param ipccode 摄像机编号
|
void fnPushVideoInRabbitMQ(queue<Mat>& queJC2, string ipccode);
|
|
void fnPushVideo(queue<Mat>& queJC2, string ipccode);
|
|
void fnPushVideoToUrl(queue<Mat>& queJC2,string toRtsp, string fps,string ipccode);
|
|
};
|