Commit 784d6dae by “liusq”

新增算法权限和推送设备版本,ip

parent 264b6d6a
......@@ -11,6 +11,8 @@
#include "Json_Header/System_TimeZone.h"
#include "Json_Header/RecordCfg.h"
#include "Json_Header/NetWork_SPVMN.h"
#include "Json_Header/SystemInfo.h"
#include "Json_Header/OPMachine.h"
#include "mainwindow.h"
#include "ParkingSpaceInfo.h"
#include "so_human_sdk.h"
......@@ -45,25 +47,25 @@ public:
int sdkDevLoginSyn(QString sDevId, int nDevPort, QString sUserName, QString sPassword, int nTimeout);
//int SdkMediaGetFaceImage(int hDevice, int nSeq, int nTimeout);
int sdkDevSetAlarmListener(XSDK_HANDLE hDevice, int bListener);
int getHdevice();
int getChannel();
void clearCameraHandle();
// void rebindTimer(int hDevice);
void initSdkRealTimeDevSnapSyn(int hDevice,int syn_timer,uint64 face_frequency);
void updateImage(const cv::Mat & frame,qint64 currentTime);
void matToBase64(const cv::Mat &image, QByteArray &base64Data);
int callbackFunction(XSDK_HANDLE hObject,QString &szString);
void checkAndUpdateCurrentPlate(ParkingSpaceInfo*park,const cv::Mat & frame,RecognizedInfo& newInfo,int &result,std::map<int,RecognizedInfo>&exitAndMoMap);
void licensePlateRecognitionResults(vides_data::requestLicensePlate &location);
void sdkDevSnapSyn(XSDK_HANDLE hDevice, int nChannel);
//时间设置
void sdkDevSystemTimeZoneSyn(QString &time);
......@@ -73,90 +75,96 @@ public:
void sdkEncodeCfg(const char *enCode);
//28181更新
void sdkDevSpvMn(const char* spvMn);
//重启设备
void deviceReboot();
//获取固件版本
void findFirmwareVersion(QString &firmwareVersion);
//获取ip
void findIp(QString &ip);
void sdkDownloadFileByTime(XSDK_HANDLE hDevice,int id,
QString startTimer,QString endTime);
void setTimeoutMs(int timeoutMs);
QString startTimer,QString endTime);
QString getSSn();
int getMediaHandle();
void setMediaHandle(int mediaHandle);
void setCurrentFace(int currentFace);
void initAlgorithmPermissions(__uint8_t algorithm);
void initParkingSpaceInfo(const std::list<vides_data::responseArea>&areas);
bool compareLists(const std::list<vides_data::responseArea>& newAreas);
void updateParkMapAndParkingSpaceInfos(const std::list<vides_data::responseArea>&newAreas);
std::map<int, vides_data::responseRecognitionData>&getVideoCurrentData();
std::map<QString, QString>&getCurrentData();
// 检查点是否在多边形内
bool polygonsOverlap(ParkingSpaceInfo &poly1, ParkingSpaceInfo &poly2);
// 计算两个多边形的交集面积
double calculateIntersectionArea(const QPolygonF &polygon1, const QPolygonF &polygon2);
double ccw(const QPointF& a, const QPointF& b, const QPointF& c);
void getCurrentFrame(std::vector<uchar> &buffer);
int findPointRegion(ParkingSpaceInfo &prakArea);
int determineArea(ParkingSpaceInfo &prakArea);
signals:
void callbackFrameReady(const cv::Mat &frame, const QString &url);
void afterDownloadFile( int id,int recognitionType,QString ossUrl);
private slots:
void sdkRealTimeDevSnapSyn(int hDevice);
void pushRecordToCloud(int id,int recognitionType,QString ossUrl);
//void releaseSemaphore();
private :
int hDevice;
int channel;
QString httpUrl;
SXSDKLoginParam *loginParam;
SXMediaFaceImageReq *sxMediaFaceImageReq;
std::mutex plateMutex;
std::mutex faceMutex;
QString sSn;
QString url;
std::map<int, vides_data::responseRecognitionData> videoCurrentData;
std::map<QString, QString> currentData;
//每个区域编号对应一个区域信息
std::map<int,ParkingSpaceInfo*>parkMap;
//当前相机监视所以车位区域
std::vector<ParkingSpaceInfo*>parkingSpaceInfos;
//当前人脸数
int currentFace;
int mediaHandle;
//2秒钟抓一次图
QTimer *dev_snap_syn_timer;
int offlineCount=0;
TCV_HumanDetector *detector;
P_HLPR_Context ctx ;
QSemaphore semaphore;
int timeoutMs;
int image_save;
std::atomic<uint64> faceCount;
uint64 face_frequency;
__uint8_t algorithmPermissions;
};
#endif // CAMERAHANDLE_H
#ifndef FACERECOGNITION_H
#define FACERECOGNITION_H
#include "hyperface.h"
#include <opencv2/opencv.hpp>
#include<QCoreApplication>
#include "herror.h"
#include "LogHandle.h"
#include "VidesData.h"
#include <QReadWriteLock>
#include <opencv2/opencv.hpp>
#include<QCoreApplication>
class FaceReconition
{
......@@ -16,10 +17,8 @@ private:
HContextHandle ctxHandle=nullptr;
float configConfidence;
std::vector<int32_t>customIds;
QReadWriteLock rwLock;
std::vector<int32_t>customIds;
FaceReconition();
~FaceReconition();
......@@ -32,11 +31,12 @@ public:
return instance;
}
cv::Mat loadImage(const QString &path);
cv::Mat loadImageFromByteStream(const QString& filePath);
void doesItExistEmployee(const cv::Mat &source,std::list<vides_data::faceRecognitionResult>&face);
void initSourceImageMap(std::map<QString,QString>&maps,float confidence);
void initSourceImageMap(std::map<QString,QString>&maps,int numberFaces,float confidence);
int featureRemove();
};
......
......@@ -2,6 +2,11 @@
#include <QImage>
#include <QThread>
#define cimg_display 0
#include "CImg.h"
using namespace cimg_library;
FaceReconition::FaceReconition() {}
......@@ -15,33 +20,44 @@ FaceReconition::~FaceReconition(){
FaceReconition* FaceReconition::instance = nullptr;
//cv::Mat FaceReconition::loadImage(const QString &path) {
// // 尝试使用OpenCV直接加载图像
// std::string stdPath = path.toStdString(); // 将路径转换为std::string
// cv::Mat image = cv::imread(stdPath, cv::IMREAD_COLOR); // 尝试加载图像
// if (!image.empty()) {
// qDebug() << "图像以OpenCV成功加载。";
// return image;
// }
// // 使用OpenCV加载失败,尝试使用QImage
// qDebug() << "使用OpenCV加载图像失败,尝试QImage转换。";
// QImage qimg(path);
// if (qimg.isNull()) {
// qDebug() << "QImage也无法加载图像,检查文件路径或文件损坏。";
// return cv::Mat(); // 返回空的cv::Mat对象
// }
// // 转换QImage格式为RGB888
// QImage converted = qimg.convertToFormat(QImage::Format_RGB888);
// cv::Mat mat(converted.height(), converted.width(), CV_8UC3, const_cast<uchar*>(converted.bits()), static_cast<size_t>(converted.bytesPerLine()));
// // 不进行颜色转换,直接返回
// return mat;
//}
cv::Mat FaceReconition::loadImage(const QString &path) {
// 尝试使用OpenCV直接加载图像
std::string stdPath = path.toStdString(); // 将路径转换为std::string
cv::Mat image = cv::imread(stdPath, cv::IMREAD_COLOR); // 尝试加载图像
std::string stdPath = path.toStdString();
cv::Mat image = cv::imread(stdPath, cv::IMREAD_COLOR);
if (!image.empty()) {
qDebug() << "图像以OpenCV成功加载。";
return image;
}
// 使用OpenCV加载失败,尝试使用QImage
qDebug() << "使用OpenCV加载图像失败,尝试QImage转换。";
QImage qimg(path);
if (qimg.isNull()) {
qDebug() << "QImage也无法加载图像,检查文件路径或文件损坏。";
return cv::Mat(); // 返回空的cv::Mat对象
}
// 转换QImage格式为RGB888
QImage converted = qimg.convertToFormat(QImage::Format_RGB888);
cv::Mat mat(converted.height(), converted.width(), CV_8UC3, const_cast<uchar*>(converted.bits()), converted.bytesPerLine());
// 将RGB转换为BGR,以便OpenCV处理
cv::cvtColor(mat, mat, cv::COLOR_RGB2BGR);
return mat;
return loadImageFromByteStream(path);
}
void FaceReconition::initSourceImageMap(std::map<QString,QString>&maps,float confidence){
void FaceReconition::initSourceImageMap(std::map<QString,QString>&maps,int numberFaces,float confidence){
//QWriteLocker locker(&rwLock);
featureRemove();
HResult ret;
......@@ -62,7 +78,7 @@ void FaceReconition::initSourceImageMap(std::map<QString,QString>&maps,float con
HF_DetectMode detMode = HF_DETECT_MODE_IMAGE; // 选择图像模式 即总是检测
if(ctxHandle==nullptr){
// 创建ctx
ret = HF_CreateFaceContextFromResourceFileOptional(path, option, detMode, 5, &ctxHandle);
ret = HF_CreateFaceContextFromResourceFileOptional(path, option, detMode, numberFaces, &ctxHandle);
if (ret != HSUCCEED) {
qInfo() << QString("Create ctx error: %1").arg(ret);
return;
......@@ -149,6 +165,45 @@ int FaceReconition::featureRemove(){
}
}
}
cv::Mat FaceReconition::loadImageFromByteStream(const QString& filePath) {
try {
// 使用 CImg 读取 JPEG 图像
QByteArray bPath =filePath.toUtf8();
const char* ctr=bPath.data();
CImg<unsigned char> cimg_image(ctr);
// 将 CImg 对象转换为 OpenCV 的 Mat 格式
int width = cimg_image.width();
int height = cimg_image.height();
int channels = cimg_image.spectrum(); // 图像通道数
// 创建一个对应的空 Mat 对象
cv::Mat opencv_image(height, width, channels == 1 ? CV_8UC1 : CV_8UC3);
// 复制图像数据到 Mat 对象
cimg_forXY(cimg_image, x, y) {
if (channels == 1) {
opencv_image.at<unsigned char>(y, x) = cimg_image(x, y, 0, 0);
} else {
// 注意 OpenCV 默认使用 BGR 而不是 RGB
cv::Vec3b& opencv_pixel = opencv_image.at<cv::Vec3b>(y, x);
opencv_pixel[2] = cimg_image(x, y, 0, 0); // Red
opencv_pixel[1] = cimg_image(x, y, 0, 1); // Green
opencv_pixel[0] = cimg_image(x, y, 0, 2); // Blue
}
}
return opencv_image;
} catch (const CImgException& e) {
qDebug() << "CImg Error: " << e.what();
return cv::Mat();;
} catch (const cv::Exception& e) {
qDebug() << "OpenCV Error: " << e.what();
return cv::Mat(); ;
}
return cv::Mat();
}
void FaceReconition::doesItExistEmployee(const cv::Mat &source,std::list<vides_data::faceRecognitionResult>&faces){
//QReadLocker locker(&rwLock);
HResult ret;
......@@ -207,34 +262,6 @@ void FaceReconition::doesItExistEmployee(const cv::Mat &source,std::list<vides_d
qDebug()<<QString("匹配到的tag: %1").arg(searchIdentity.tag);
qDebug()<<QString("匹配到的customId: %1").arg(searchIdentity.customId);
// Face Pipeline
ret = HF_MultipleFacePipelineProcess(ctxHandle, imageSteamHandle, &multipleFaceData, parameter);
if (ret != HSUCCEED) {
//printf("pipeline执行失败: %ld", ret);
qInfo()<<QString("pipeline执行失败: %1").arg(ret);
return ;
}
HF_RGBLivenessConfidence livenessConfidence = {0};
ret = HF_GetRGBLivenessConfidence(ctxHandle, &livenessConfidence);
if (ret != HSUCCEED) {
qInfo()<<QString("获取活体数据失败1");
return ;
}
//printf("活体置信度: %f", livenessConfidence.confidence[0]);
qDebug()<<QString("活体置信度====>:%1").arg(livenessConfidence.confidence[0],0,'Q',4);
HF_FaceMaskConfidence maskConfidence = {0};
ret = HF_GetFaceMaskConfidence(ctxHandle, &maskConfidence);
if (ret != HSUCCEED) {
qInfo()<<QString("获口罩数据失败");
return ;
}
HInt32 faceNum;
ret = HF_FeatureGroupGetCount(ctxHandle, &faceNum);
if (ret != HSUCCEED) {
// printf("获取失败");
qInfo()<<QString("获取失败");
return ;
}
//printf("人脸特征数量: %d", faceNum);
if (confidence > configConfidence) {
vides_data::faceRecognitionResult newface;
......
......@@ -14,36 +14,52 @@ HttpService::~HttpService() {
vides_data::response* HttpService::httpPostDeviceStatus(vides_data::requestDeviceStatus & deviceStatus) {
httpUrl.append("/api/v1.0/device/ping");
// 创建主 JSON 对象
QJsonObject json;
json.insert("sn",deviceStatus.sSn);
json.insert("type",deviceStatus.type);
json.insert("state",deviceStatus.status);
json.insert("ip_addr",deviceStatus.ip_addr);
QJsonDocument jsonDoc;
jsonDoc.setObject(json);
QByteArray bytearr= jsonDoc.toJson(QJsonDocument::Compact);
vides_data::response *resp=new vides_data::response();
json.insert("sn", deviceStatus.sSn);
json.insert("type", deviceStatus.type);
json.insert("state", deviceStatus.status);
json.insert("ip_addr", deviceStatus.ip_addr);
json.insert("firmware_version", deviceStatus.firmware_version); // 将固件版本添加到主 JSON 对象中
// 创建摄像头信息列表 JSON 数组
QJsonArray cameraArray;
for (const auto& cameraInfo : deviceStatus.camera_info_list) {
QJsonObject cameraObject;
cameraObject.insert("sn", cameraInfo.sSn);
cameraObject.insert("ip_addr", cameraInfo.ip_addr);
cameraObject.insert("firmware_version", cameraInfo.firmware_version);
cameraArray.append(cameraObject);
}
// 将摄像头信息列表添加到主 JSON 对象中
json.insert("camera_info_list", cameraArray);
// 将 JSON 对象转换为 JSON 文档
QJsonDocument jsonDoc(json);
QByteArray bytearr = jsonDoc.toJson(QJsonDocument::Compact);
vides_data::response *resp = new vides_data::response();
QNetworkRequest request;
request.setUrl(QUrl(httpUrl));
request.setRawHeader(vides_data::HEADER_TYPE_KAY, vides_data::HEADER_TYPE_VALUE);
QMutexLocker locker(&m_httpClientMutex);
if(m_httpClient.post(request,bytearr)){
QByteArray && byte=m_httpClient.text().toUtf8();
QJsonDocument docujson= QJsonDocument::fromJson(byte.data());
QJsonObject maps= docujson.object();
QVariantMap map =std::move(maps.toVariantMap());
resp->code=map["code"].toInt();
resp->msg=map["message"].toString();
}else{
qDebug()<<"httpPostDeviceStatus"<<m_httpClient.errorCode();
resp->code=2;
resp->msg=OPERATION_FAILED;
if (m_httpClient.post(request, bytearr)) {
QByteArray && byte = m_httpClient.text().toUtf8();
QJsonDocument docujson = QJsonDocument::fromJson(byte.data());
QJsonObject maps = docujson.object();
QVariantMap map = std::move(maps.toVariantMap());
resp->code = map["code"].toInt();
resp->msg = map["message"].toString();
} else {
qDebug() << "httpPostDeviceStatus" << m_httpClient.errorCode();
resp->code = 2;
resp->msg = m_httpClient.errorString();
}
return resp;
}
vides_data::response* HttpService::httpPostRecord(int id,int recongnition_type,QString sn,QString videw_addr){
httpUrl.append("/api/v1.0/recongnition/record");
......@@ -108,7 +124,8 @@ vides_data::response *HttpService::httpFindCameras(QString &serialNumber,vides_d
HttpService::stsCredentials.endpoint=responseData.sts_credentials.endpoint = stsCredentialsObj["endpoint"].toString();
HttpService::stsCredentials.expiration=responseData.sts_credentials.expiration = stsCredentialsObj["expiration"].toString();
HttpService::stsCredentials.security_token=responseData.sts_credentials.security_token = stsCredentialsObj["security_token"].toString();
int algorithm= dataObj["algorithm"].toInt();
responseData.algorithm=algorithm;
QJsonArray dataArray = dataObj["list"].toArray();
for (const QJsonValue& value : dataArray) {
vides_data::responseDeviceStatus status;
......@@ -116,6 +133,7 @@ vides_data::response *HttpService::httpFindCameras(QString &serialNumber,vides_d
status.sSn = deviceObject["sn"].toString();
status.type = static_cast<int8_t>(deviceObject["type"].toInt());
status.is_reboot=deviceObject["is_reboot"].toBool();
status.merchant_id = static_cast<int8_t>(deviceObject["merchant_id"].toInt());
// 处理"areas"数组
......@@ -268,6 +286,39 @@ vides_data::response* HttpService::httpFindFaceReconition(QString &serialNumber,
}
return resp;
}
vides_data::response *HttpService::httpPostUniforms(QByteArray &img,int &number,QString sn,qint64 time){
httpUrl.append("/api/v1.0/recongnition/uniform");
QJsonObject json;
json.insert("img", QJsonValue::fromVariant(img));
json.insert("sn",sn);
json.insert("number",number);
json.insert("time",QJsonValue::fromVariant(time));
QJsonDocument jsonDoc;
jsonDoc.setObject(json);
QByteArray bytearr= jsonDoc.toJson(QJsonDocument::Compact);
vides_data::response *resp=new vides_data::response();
QNetworkRequest request;
request.setUrl(QUrl(httpUrl));
request.setRawHeader(vides_data::HEADER_TYPE_KAY, vides_data::HEADER_TYPE_VALUE);
QMutexLocker locker(&m_httpClientMutex);
if(m_httpClient.post(request,bytearr)){
QByteArray && byte=m_httpClient.text().toUtf8();
QJsonDocument docujson= QJsonDocument::fromJson(byte.data());
QJsonObject maps= docujson.object();
QVariantMap map =maps.toVariantMap();
resp->code=map["code"].toInt();
resp->msg=map["message"].toString();
}else{
qDebug()<<m_httpClient.errorCode();
qDebug()<<"httpPostUniforms"<<m_httpClient.errorString();
resp->code=2;
resp->msg=OPERATION_FAILED;
}
return resp;
}
vides_data::response *HttpService::httpPostFacePopulation(QByteArray &img,int &number,QString sn,qint64 time){
httpUrl.append("/api/v1.0/recongnition/population");
QJsonObject json;
......
......@@ -35,6 +35,9 @@ public:
vides_data::response *httpPostFaceReconition(vides_data::requestFaceReconition & faceReconition);
//人数变化推送
vides_data::response *httpPostFacePopulation(QByteArray &img,int &number,QString sn,qint64 time);
//工服推送
vides_data::response *httpPostUniforms(QByteArray &img,int &number,QString sn,qint64 time);
//客户端组列表
vides_data::response *httpFindStream(QString &serialNumber);
......
......@@ -15,10 +15,34 @@ int HumanDetection::findHuManCar(const cv::Mat &source,int res,TCV_HumanDetector
// 执行一帧目标检测
TCV_HumanDetectorProcessFrame(detector, stream);
int num = (res == 0) ? TCV_HumanDetectorGetNumOfHuman(detector) :TCV_HumanDetectorGetNumOfCar(detector);
qDebug() << (res == 0 ? "Number of people detected:" : "Number of cars detected:") << num;
TCV_ReleaseCameraStream(stream);
int num=-1;
if(res==0x00 || res==0x02){
num= TCV_HumanDetectorGetNumOfHuman(detector);
if (num > 0 && res==0x02) {
// 创建一个接收检测结果的对象数组
TCV_ObjectLocation result[num];
// 提取行人检测结果
TCV_HumanDetectorGetHumanLocation(detector, result, num);
int num_uniforms = 0;
//工服
for (int i = 0; i < num; ++i) {
if (result[i].uniform == 0) {
++num_uniforms;
}
}
num=num_uniforms;
}
qDebug() << (res == 0 ? "Number of people detected:" : "Number of people with uniform == 0 detected:") << num;
}else if (res==0x01) {
num=TCV_HumanDetectorGetNumOfCar(detector);
qDebug() << "Number of cars detected:" << num;
}else {
qDebug() << "参数错误";
}
TCV_ReleaseCameraStream(stream);
return num;
}
......@@ -21,6 +21,7 @@ void ParkingSpaceInfo::removeQueue(){
queuels.dequeue();
}
}
void ParkingSpaceInfo::removeNoQueue() {
QMutexLocker locker(&queueMutex);
if (!queuels.isEmpty() && queuels.size() > 3) {
......
......@@ -23,14 +23,27 @@ struct response
QString msg;
response() {}
};
struct requestCameraInfo{
QString ip_addr;
QString firmware_version;
QString sSn;
requestCameraInfo() {}
};
struct requestDeviceStatus
{
QString sSn;
int8_t type;
int8_t status;
QString ip_addr;
QString firmware_version;
std::list<requestCameraInfo>camera_info_list;
requestDeviceStatus() {}
};
struct responseStsCredentials{
QString access_key_id;
QString access_key_secret;
......@@ -67,10 +80,12 @@ struct responseDeviceStatus
QString sSn;
int8_t type;
int8_t merchant_id;
bool is_reboot;
std::list<responseArea>areas;
responseDeviceStatus() {}
responseDeviceStatus() : is_reboot(false) {}
};
struct responseDeviceData{
int algorithm ;
std::list<responseDeviceStatus> list;
responseStsCredentials sts_credentials;
};
......@@ -257,19 +272,22 @@ inline bool pingAddress(const QString &address) {
return output.contains("1 packets transmitted, 1 received");
}
inline QString getSerialNumber() {
inline QString getCpuSerialNumber() {
QProcess process;
// 使用管道将两个命令的执行结果串联起来,直接查找包含"Serial"的行
process.start("bash", QStringList() << "-c" << "cat /proc/cpuinfo | grep Serial");
process.waitForFinished(-1); // 等待命令执行完成
// 启动一个进程运行shell命令
process.start("sh", QStringList() << "-c" << "cat /proc/cpuinfo | grep Serial");
// 等待命令执行完成
process.waitForFinished();
// 读取命令的标准输出
QString output = process.readAllStandardOutput();
QString serialNumber;
if (!output.isEmpty()) {
// 已经确保了输出仅包含 Serial 行,所以直接分割并提取
serialNumber = output.split(":").at(1).trimmed();
serialNumber = output.split(":").last().trimmed();
}
return serialNumber;
}
}
......
......@@ -3,7 +3,7 @@ QT += core gui network multimedia sql concurrent
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
TARGET = GAMERAVIDEO
TARGET = cameravideo
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
......@@ -11,45 +11,46 @@ TEMPLATE = app
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
DEFINES += APP_VERSION=\\\"1.0.0\\\"
QMAKE_LIBDIR += /usr/local/lib
INCLUDEPATH+=/usr/local/include/opencv4
INCLUDEPATH+=/usr/local/include/hyperface
INCLUDEPATH+=/usr/local/include/hyper
INCLUDEPATH+=/usr/local/include/XNetSDK
INCLUDEPATH+=/usr/local/include/human
#unix:contains(QMAKE_HOST.arch, x86_64) {
# QMAKE_LIBDIR += /home/mark/Public/x86_opencv/lib
#}
#unix:contains(QMAKE_HOST.arch, arm) {
# QMAKE_LIBDIR += /usr/local/lib
#}
## 根据编译器类型选择库路径和头文件路径
#unix: {
# # x86 架构
# contains(QMAKE_HOST.arch, x86_64) {
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/opencv4
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyperface
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyper
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/XNetSDK
# INCLUDEPATH+=/home/mark/Public/x86_opencv/include/human
# }
# # ARM 架构
# contains(QMAKE_HOST.arch, arm) {
# INCLUDEPATH+=/usr/local/include/opencv4
# INCLUDEPATH+=/usr/local/include/hyperface
# INCLUDEPATH+=/usr/local/include/hyper
# INCLUDEPATH+=/usr/local/include/XNetSDK
# INCLUDEPATH+=/usr/local/include/human
# }
#}
#QMAKE_LIBDIR += /usr/local/lib
#INCLUDEPATH+=/usr/local/include/opencv4
#INCLUDEPATH+=/usr/local/include/hyperface
#INCLUDEPATH+=/usr/local/include/hyper
#INCLUDEPATH+=/usr/local/include/XNetSDK
#INCLUDEPATH+=/usr/local/include/human
#INCLUDEPATH+=/usr/local/include/CImg
unix:contains(QMAKE_HOST.arch, x86_64) {
QMAKE_LIBDIR += /home/mark/Public/x86_opencv/lib
}
unix:contains(QMAKE_HOST.arch, arm) {
QMAKE_LIBDIR += /usr/local/lib
}
# 根据编译器类型选择库路径和头文件路径
unix: {
# x86 架构
contains(QMAKE_HOST.arch, x86_64) {
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/opencv4
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyperface
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyper
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/XNetSDK
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/human
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/CImg
}
# ARM 架构
contains(QMAKE_HOST.arch, arm) {
INCLUDEPATH+=/usr/local/include/opencv4
INCLUDEPATH+=/usr/local/include/hyperface
INCLUDEPATH+=/usr/local/include/hyper
INCLUDEPATH+=/usr/local/include/XNetSDK
INCLUDEPATH+=/usr/local/include/human
}
}
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
......
......@@ -40,37 +40,40 @@ public:
void createDirectory(int flag,const QString& dirName, const QString& successMsg, const QString& failureMsg);
void initFaceFaceRecognition();
void initCameras(vides_data::cameraParameters &parameter,const std::list<vides_data::responseArea>&areas);
void initCameras(vides_data::cameraParameters &parameter,
const std::list<vides_data::responseArea>&areas,int algorithm,std::list<vides_data::requestCameraInfo>&camera_info_list);
__uint8_t intToUint8t(int algorithm);
static MainWindow * sp_this;
CameraHandle* findHandle(QString sn);
void sendJsonResponse(QTcpSocket* socket, int code, const QString& data, const QString& msg);
void sendEmptyResponse(QTcpSocket* socket);
void sendNotFoundResponse(QTcpSocket* socket);
void updateLocalFace(const QString &httpurl);
void removeImageFiles(QString id);
void modifyImagesAndNames(QString &modId);
void findLocalSerialNumber(QString &serialNumber);
void initDevConfigSyn(CameraHandle *cameraHandle);
void iniRecordingToString(QString &recorJson);
void iniEncodeToString(QString &enCodeJson);
void clearOfflineCameraHandle(QString sDevId, int nDevPort);
bool iniWorkSpVMn(vides_data::responseGb28181 *gb28181,QString &workSpWMn,QString &sn);
bool isDeviceInList(const QString& deviceId, const std::list<vides_data::responseDeviceStatus>& devices);
// 过滤函数
void deleteCloudNotCamer (const std::map<QString,vides_data::localDeviceStatus*>& localDevices,
......@@ -84,9 +87,9 @@ private slots:
void startCamera(const QString &httpurl);
void deleteLogFile();
void clearHandle(QString sDevId, int nDevPort);
void deleteMkvFileTimer();
void handleMatNewConnection();
......@@ -98,11 +101,12 @@ private:
QTimer *deleteLogFileTimer;
QTimer *deleteFrameFileTimer;
QTimer*dePermissionSynTimer;
QTcpServer server;
QString localSn;
//本地id:图片路径
std::map<QString,QString>localImageMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment