Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gamera_videos_no_ui
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liusq
gamera_videos_no_ui
Commits
b6009d23
Commit
b6009d23
authored
Jul 04, 2025
by
Amos
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release' into 'master'
merge Release See merge request
!102
parents
987a0177
ac65e986
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
386 additions
and
101 deletions
+386
-101
AlgorithmTaskManage.cpp
+2
-2
AlgorithmTaskManage.h
+1
-1
CameraHandle.cpp
+74
-26
CameraHandle.h
+7
-2
FaceReconitionHandle.cpp
+2
-2
FaceReconitionHandle.h
+1
-1
HttpService.cpp
+47
-1
HttpService.h
+7
-0
HumanDetection.cpp
+21
-6
HumanDetection.h
+2
-2
MediaFaceImage.cpp
+81
-1
MediaFaceImage.h
+8
-0
ParkingSpaceInfo.h
+1
-1
RecognizedInfo.cpp
+1
-1
RecognizedInfo.h
+0
-0
ScopeSemaphoreExit.h
+0
-0
VidesData.h
+12
-4
gamera_videos.pro
+7
-5
mainwindow.cpp
+102
-46
mainwindow.h
+10
-0
No files found.
AlgorithmTaskManage.cpp
View file @
b6009d23
...
@@ -42,7 +42,7 @@ void AlgorithmTaskManage::initialize(int humanDetectionLen, int licensePlateLen,
...
@@ -42,7 +42,7 @@ void AlgorithmTaskManage::initialize(int humanDetectionLen, int licensePlateLen,
}
}
void
AlgorithmTaskManage
::
initHumanDetectionManage
(
const
QString
&
modelPaths
,
void
AlgorithmTaskManage
::
initHumanDetectionManage
(
const
QString
&
modelPaths
,
float
carShapeConfidence
,
int
&
uniformColor
)
{
float
carShapeConfidence
,
QString
&
uniformColor
)
{
for
(
int
i
=
0
;
i
<
humanDetectionLen
;
++
i
)
{
for
(
int
i
=
0
;
i
<
humanDetectionLen
;
++
i
)
{
HumanDetection
*
human
=
new
HumanDetection
(
modelPaths
,
carShapeConfidence
);
HumanDetection
*
human
=
new
HumanDetection
(
modelPaths
,
carShapeConfidence
);
human
->
setHuManParameter
(
uniformColor
);
human
->
setHuManParameter
(
uniformColor
);
...
@@ -113,7 +113,7 @@ void AlgorithmTaskManage::releaseResources(const vides_data::DetectionParams& pa
...
@@ -113,7 +113,7 @@ void AlgorithmTaskManage::releaseResources(const vides_data::DetectionParams& pa
QString
modelPath
=
params
.
modelPaths
;
QString
modelPath
=
params
.
modelPaths
;
float
humanCarShapeConfidence
=
params
.
humanCarShapeConfidence
;
float
humanCarShapeConfidence
=
params
.
humanCarShapeConfidence
;
int
uniformColor
=
params
.
uniformColor
;
QString
uniformColor
=
params
.
uniformColor
;
std
::
map
<
QString
,
QString
>
faceMaps
=
params
.
faceMaps
;
std
::
map
<
QString
,
QString
>
faceMaps
=
params
.
faceMaps
;
int
numberFaces
=
params
.
numberFaces
;
int
numberFaces
=
params
.
numberFaces
;
float
faceConfidence
=
params
.
faceConfidence
;
float
faceConfidence
=
params
.
faceConfidence
;
...
...
AlgorithmTaskManage.h
View file @
b6009d23
...
@@ -26,7 +26,7 @@ public:
...
@@ -26,7 +26,7 @@ public:
void
initialize
(
int
humanDetectionLen
,
int
licensePlateLen
,
int
faceLen
,
bool
first
,
__uint8_t
algorithmPermissions
);
void
initialize
(
int
humanDetectionLen
,
int
licensePlateLen
,
int
faceLen
,
bool
first
,
__uint8_t
algorithmPermissions
);
void
initHumanDetectionManage
(
const
QString
&
modelPaths
,
void
initHumanDetectionManage
(
const
QString
&
modelPaths
,
float
carShapeConfidence
,
int
&
uniformColor
);
float
carShapeConfidence
,
QString
&
uniformColor
);
void
initLicensePlateManage
(
const
QString
&
modelPaths
,
bool
is_high
,
int
maxNum
,
bool
useHalf
,
void
initLicensePlateManage
(
const
QString
&
modelPaths
,
bool
is_high
,
int
maxNum
,
bool
useHalf
,
float
boxThreshold
,
float
nmsThreshold
,
float
recThreshold
);
float
boxThreshold
,
float
nmsThreshold
,
float
recThreshold
);
...
...
CameraHandle.cpp
View file @
b6009d23
...
@@ -217,15 +217,20 @@ int XNetSDK_MediaCallBack(XSDK_HANDLE hMedia, int nDataType, int nDataLen, int n
...
@@ -217,15 +217,20 @@ int XNetSDK_MediaCallBack(XSDK_HANDLE hMedia, int nDataType, int nDataLen, int n
}
}
}
}
}
}
}
}
int
CameraHandle
::
sdkDevSetAlarmListener
(
XSDK_HANDLE
hDevice
,
int
bListener
)
{
int
CameraHandle
::
sdkDevSetAlarmListener
(
XSDK_HANDLE
hDevice
,
int
bListener
)
{
return
XSDK_DevSetAlarmListener
(
hDevice
,
bListener
);
return
XSDK_DevSetAlarmListener
(
hDevice
,
bListener
);
}
}
void
CameraHandle
::
setHkDevice
(
bool
hk_status
,
int
hk_Device
){
this
->
hk_Device
=
hk_Device
;
this
->
hk_status
=
hk_status
;
}
int
CameraHandle
::
getChannel
(){
int
CameraHandle
::
getChannel
(){
return
channel
;
return
channel
;
}
}
int
CameraHandle
::
getHdevice
()
{
int
CameraHandle
::
getHdevice
()
{
return
hDevice
;
return
hDevice
;
}
}
...
@@ -394,6 +399,10 @@ int CameraHandle::callbackFunction(XSDK_HANDLE hObject, QString &szString) {
...
@@ -394,6 +399,10 @@ int CameraHandle::callbackFunction(XSDK_HANDLE hObject, QString &szString) {
{
{
qInfo
()
<<
"OnDevAlarmCallback[Dev:"
<<
hObject
<<
"][Event:"
<<
szString
<<
"]"
;
qInfo
()
<<
"OnDevAlarmCallback[Dev:"
<<
hObject
<<
"][Event:"
<<
szString
<<
"]"
;
}
}
if
(
algorithmPermissions
==
0x00
){
return
-
1
;
}
cv
::
Mat
image
;
cv
::
Mat
image
;
MediaFaceImage
*
mediaFaceImage
=
MediaFaceImage
::
getInstance
();
MediaFaceImage
*
mediaFaceImage
=
MediaFaceImage
::
getInstance
();
qint64
currentTime
=
QDateTime
::
currentSecsSinceEpoch
();
qint64
currentTime
=
QDateTime
::
currentSecsSinceEpoch
();
...
@@ -401,9 +410,24 @@ int CameraHandle::callbackFunction(XSDK_HANDLE hObject, QString &szString) {
...
@@ -401,9 +410,24 @@ int CameraHandle::callbackFunction(XSDK_HANDLE hObject, QString &szString) {
if
(
image
.
empty
())
if
(
image
.
empty
())
{
{
qInfo
()
<<
"Failed to read the image"
;
qInfo
()
<<
"FaceImageCallBack抓图失败,尝试调用FaceHkImageCallBack"
;
if
(
!
hk_status
){
qInfo
()
<<
QString
(
"SN(%1): callbackFunction通过IP获取到对应通道号失败"
).
arg
(
sSn
);
return
-
1
;
}
int
hk_channel
=
mediaFaceImage
->
getIPChannelInfo
(
hk_Device
,
QString
(
loginParam
->
sDevId
));
if
(
hk_channel
<
0
){
qInfo
()
<<
QString
(
"SN(%1): callbackFunction通过IP获取到对应通道号失败"
).
arg
(
sSn
);
return
-
1
;
}
// 调用FaceHkImageCallBack抓图
mediaFaceImage
->
FaceHkImageCallBack
(
hk_Device
,
hk_channel
,
image
,
sSn
);
// 再次检查抓图是否成功
if
(
image
.
empty
())
{
qInfo
()
<<
"FaceHkImageCallBack抓图也失败"
;
return
-
1
;
return
-
1
;
}
}
}
if
(
image
.
rows
<=
0
||
image
.
cols
<=
0
||
image
.
channels
()
<=
0
)
{
if
(
image
.
rows
<=
0
||
image
.
cols
<=
0
||
image
.
channels
()
<=
0
)
{
qInfo
()
<<
"图像尺寸或通道数不正确,需排查原因"
;
qInfo
()
<<
"图像尺寸或通道数不正确,需排查原因"
;
return
-
1
;
return
-
1
;
...
@@ -412,25 +436,8 @@ int CameraHandle::callbackFunction(XSDK_HANDLE hObject, QString &szString) {
...
@@ -412,25 +436,8 @@ int CameraHandle::callbackFunction(XSDK_HANDLE hObject, QString &szString) {
updateImage
(
image
,
currentTime
);
updateImage
(
image
,
currentTime
);
}
}
void
CameraHandle
::
sdkDevSnapSyn
(
XSDK_HANDLE
hDevice
,
int
nChannel
){
bool
CameraHandle
::
threeConsecutiveImage
(){
if
(
hDevice
<=
0
){
qInfo
()
<<
QString
(
"SN(%1): 相机断线"
).
arg
(
sSn
);
return
;
}
if
(
!
semaphore
.
tryAcquire
())
{
qInfo
()
<<
QString
(
"SN(%1): callbackFunction:正在执行线程"
).
arg
(
sSn
);;
return
;
}
ScopeSemaphoreExit
guard
([
this
]()
{
semaphore
.
release
();
// 释放信号量
});
Common
&
instace
=
Common
::
getInstance
();
Common
&
instace
=
Common
::
getInstance
();
cv
::
Mat
image
;
MediaFaceImage
*
mediaFaceImage
=
MediaFaceImage
::
getInstance
();
qint64
currentTime
=
QDateTime
::
currentSecsSinceEpoch
();
int
ret
=
mediaFaceImage
->
FaceImageCallBack
(
hDevice
,
nChannel
,
image
,
sSn
);
if
(
ret
<
0
)
{
offlineCount
++
;
// 累加计数器
offlineCount
++
;
// 累加计数器
if
(
offlineCount
>=
3
)
{
// 判断是否连续3次返回0
if
(
offlineCount
>=
3
)
{
// 判断是否连续3次返回0
qInfo
()
<<
QString
(
"SN(%1): 设备离线"
).
arg
(
sSn
);
qInfo
()
<<
QString
(
"SN(%1): 设备离线"
).
arg
(
sSn
);
...
@@ -448,11 +455,51 @@ void CameraHandle::sdkDevSnapSyn(XSDK_HANDLE hDevice, int nChannel){
...
@@ -448,11 +455,51 @@ void CameraHandle::sdkDevSnapSyn(XSDK_HANDLE hDevice, int nChannel){
// TODO: 可以在此处更新设备状态、发送告警通知等
// TODO: 可以在此处更新设备状态、发送告警通知等
// 重置计数器,以便下次再次检测连续离线
// 重置计数器,以便下次再次检测连续离线
offlineCount
=
0
;
offlineCount
=
0
;
return
true
;
}
return
false
;
}
void
CameraHandle
::
sdkDevSnapSyn
(
XSDK_HANDLE
hDevice
,
int
nChannel
){
if
(
hDevice
<=
0
){
qInfo
()
<<
QString
(
"SN(%1): 相机断线"
).
arg
(
sSn
);
return
;
return
;
}
}
if
(
!
semaphore
.
tryAcquire
())
{
qInfo
()
<<
QString
(
"SN(%1): callbackFunction:正在执行线程"
).
arg
(
sSn
);
return
;
}
ScopeSemaphoreExit
guard
([
this
]()
{
semaphore
.
release
();
// 释放信号量
});
if
(
algorithmPermissions
==
0x00
){
return
;
}
cv
::
Mat
image
;
MediaFaceImage
*
mediaFaceImage
=
MediaFaceImage
::
getInstance
();
qint64
currentTime
=
QDateTime
::
currentSecsSinceEpoch
();
int
ret
=
mediaFaceImage
->
FaceImageCallBack
(
hDevice
,
nChannel
,
image
,
sSn
);
if
(
ret
<=
0
)
{
if
(
!
hk_status
){
if
(
threeConsecutiveImage
())
return
;
}
else
{
int
hk_channel
=
mediaFaceImage
->
getIPChannelInfo
(
hk_Device
,
QString
(
loginParam
->
sDevId
));
if
(
hk_channel
<
0
){
qInfo
()
<<
QString
(
"SN(%1): NVR=>sdkDevSnapSyn 通过IP获取到对应通道号失败"
).
arg
(
sSn
);
return
;
}
int
retHk
=
mediaFaceImage
->
FaceHkImageCallBack
(
hk_Device
,
hk_channel
,
image
,
sSn
);
if
(
retHk
<
0
){
qInfo
()
<<
QString
(
"SN(%1): NVR=>FaceHkImageCallBack 句柄获取图片失败"
).
arg
(
sSn
);
if
(
threeConsecutiveImage
())
return
;
}
else
{
// NVR抓图成功,则重置计数器
offlineCount
=
0
;
}
}
}
else
{
}
else
{
//
如果不连续,则
重置计数器
//
第一次相机抓图成功,
重置计数器
offlineCount
=
0
;
offlineCount
=
0
;
}
}
if
(
image
.
empty
())
if
(
image
.
empty
())
...
@@ -462,7 +509,6 @@ void CameraHandle::sdkDevSnapSyn(XSDK_HANDLE hDevice, int nChannel){
...
@@ -462,7 +509,6 @@ void CameraHandle::sdkDevSnapSyn(XSDK_HANDLE hDevice, int nChannel){
}
}
if
(
image
.
rows
<=
0
||
image
.
cols
<=
0
||
image
.
channels
()
<=
0
)
{
if
(
image
.
rows
<=
0
||
image
.
cols
<=
0
||
image
.
channels
()
<=
0
)
{
qInfo
()
<<
QString
(
"SN(%1): 图像尺寸或通道数不正确,需排查原因"
).
arg
(
sSn
);
qInfo
()
<<
QString
(
"SN(%1): 图像尺寸或通道数不正确,需排查原因"
).
arg
(
sSn
);
return
;
return
;
}
}
updateImage
(
image
,
currentTime
);
updateImage
(
image
,
currentTime
);
...
@@ -474,6 +520,7 @@ void CameraHandle::matToBase64(const cv::Mat &image, QByteArray &base64Data) {
...
@@ -474,6 +520,7 @@ void CameraHandle::matToBase64(const cv::Mat &image, QByteArray &base64Data) {
cv
::
imencode
(
".jpg"
,
image
,
buffer
,
params
);
cv
::
imencode
(
".jpg"
,
image
,
buffer
,
params
);
base64Data
=
QByteArray
(
reinterpret_cast
<
const
char
*>
(
buffer
.
data
()),
buffer
.
size
()).
toBase64
();
base64Data
=
QByteArray
(
reinterpret_cast
<
const
char
*>
(
buffer
.
data
()),
buffer
.
size
()).
toBase64
();
}
}
void
CameraHandle
::
checkAndUpdateCurrentPlate
(
ParkingSpaceInfo
*
park
,
const
cv
::
Mat
&
frame
,
RecognizedInfo
&
newInfo
,
void
CameraHandle
::
checkAndUpdateCurrentPlate
(
ParkingSpaceInfo
*
park
,
const
cv
::
Mat
&
frame
,
RecognizedInfo
&
newInfo
,
int
&
result
){
int
&
result
){
if
(
newInfo
.
getLicensePlate
()
!=
park
->
getCurrentPlate
().
getLicensePlate
())
{
if
(
newInfo
.
getLicensePlate
()
!=
park
->
getCurrentPlate
().
getLicensePlate
())
{
...
@@ -511,7 +558,7 @@ void CameraHandle::checkAndUpdateCurrentPlate(ParkingSpaceInfo*park,const cv::Ma
...
@@ -511,7 +558,7 @@ void CameraHandle::checkAndUpdateCurrentPlate(ParkingSpaceInfo*park,const cv::Ma
}
else
{
}
else
{
// 没有车辆或车辆在停车区域内部,移除队列
// 没有车辆或车辆在停车区域内部,移除队列
park
->
removeNoQueue
();
park
->
removeNoQueue
();
q
Debug
()
<<
QString
(
"SN(%1): no出场::%2"
).
arg
(
sSn
).
arg
(
car_size
);
q
Info
()
<<
QString
(
"SN(%1): no出场::%2"
).
arg
(
sSn
).
arg
(
car_size
);
}
}
}
else
{
}
else
{
//当前不为空,新车,新车入场,老车出场
//当前不为空,新车,新车入场,老车出场
...
@@ -750,7 +797,6 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
...
@@ -750,7 +797,6 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
if
(
image_save
==
1
){
if
(
image_save
==
1
){
QString
fileName
=
instace
.
getVideoOut
().
append
(
instace
.
getTimeString
()
+
".jpg"
);
QString
fileName
=
instace
.
getVideoOut
().
append
(
instace
.
getTimeString
()
+
".jpg"
);
bool
success
=
cv
::
imwrite
(
fileName
.
toStdString
(),
frame
);
bool
success
=
cv
::
imwrite
(
fileName
.
toStdString
(),
frame
);
if
(
success
)
{
if
(
success
)
{
qInfo
()
<<
"图片已成功保存至:"
<<
fileName
;
qInfo
()
<<
"图片已成功保存至:"
<<
fileName
;
}
else
{
}
else
{
...
@@ -1164,7 +1210,7 @@ void CameraHandle::initWorkSpVMn(vides_data::responseGb28181 *gb28181, QString &
...
@@ -1164,7 +1210,7 @@ void CameraHandle::initWorkSpVMn(vides_data::responseGb28181 *gb28181, QString &
toJsonObject
[
"uiAlarmStateLoseEnable"
]
=
"0xFFFFFFFF"
;
toJsonObject
[
"uiAlarmStateLoseEnable"
]
=
"0xFFFFFFFF"
;
toJsonObject
[
"uiAlarmStateMotionEnable"
]
=
"0xFFFFFFFF"
;
toJsonObject
[
"uiAlarmStateMotionEnable"
]
=
"0xFFFFFFFF"
;
toJsonObject
[
"uiAlarmStatePerformanceEnable"
]
=
"0xFFFFFFFF"
;
toJsonObject
[
"uiAlarmStatePerformanceEnable"
]
=
"0xFFFFFFFF"
;
toJsonObject
[
"sUdpPort"
]
=
5060
;
toJsonObject
[
"sUdpPort"
]
=
gb28181
->
sUdpPort
;
// 生成 workSpWMn
// 生成 workSpWMn
QJsonDocument
doc
(
toJsonObject
);
QJsonDocument
doc
(
toJsonObject
);
...
@@ -1312,6 +1358,7 @@ void CameraHandle::updateSdkDevSpvMn(vides_data::responseGb28181 *gb28181){
...
@@ -1312,6 +1358,7 @@ void CameraHandle::updateSdkDevSpvMn(vides_data::responseGb28181 *gb28181){
const
char
*
szDeviceNO
=
config
.
szDeviceNO
.
ToString
();
const
char
*
szDeviceNO
=
config
.
szDeviceNO
.
ToString
();
const
char
*
szServerDn
=
config
.
szServerDn
.
ToString
();
const
char
*
szServerDn
=
config
.
szServerDn
.
ToString
();
const
char
*
szServerNo
=
config
.
szServerNo
.
ToString
();
const
char
*
szServerNo
=
config
.
szServerNo
.
ToString
();
int
u_port
=
config
.
sUdpPort
.
ToInt
();
bool
isEqual
=
(
szCsIP
==
gb28181
->
sip_ip
&&
bool
isEqual
=
(
szCsIP
==
gb28181
->
sip_ip
&&
sCsPort
==
gb28181
->
sip_port
&&
sCsPort
==
gb28181
->
sip_port
&&
szServerNo
==
gb28181
->
serial
&&
szServerNo
==
gb28181
->
serial
&&
...
@@ -1320,6 +1367,7 @@ void CameraHandle::updateSdkDevSpvMn(vides_data::responseGb28181 *gb28181){
...
@@ -1320,6 +1367,7 @@ void CameraHandle::updateSdkDevSpvMn(vides_data::responseGb28181 *gb28181){
iHsIntervalTime
==
gb28181
->
heartbeat_interval
&&
iHsIntervalTime
==
gb28181
->
heartbeat_interval
&&
szConnPass
==
gb28181
->
password
&&
szConnPass
==
gb28181
->
password
&&
szDeviceNO
==
gb28181
->
device_id
&&
szDeviceNO
==
gb28181
->
device_id
&&
u_port
==
gb28181
->
sUdpPort
&&
Camreaid
==
gb28181
->
channel_id
);
Camreaid
==
gb28181
->
channel_id
);
if
(
!
isEqual
){
if
(
!
isEqual
){
config
.
Camreaid
.
InitArraySize
(
64
);
config
.
Camreaid
.
InitArraySize
(
64
);
...
@@ -1347,7 +1395,7 @@ void CameraHandle::updateSdkDevSpvMn(vides_data::responseGb28181 *gb28181){
...
@@ -1347,7 +1395,7 @@ void CameraHandle::updateSdkDevSpvMn(vides_data::responseGb28181 *gb28181){
config
.
szServerNo
.
SetValue
(
sz_ServerNo
);
config
.
szServerNo
.
SetValue
(
sz_ServerNo
);
config
.
sCsPort
.
SetValue
(
gb28181
->
sip_port
);
config
.
sCsPort
.
SetValue
(
gb28181
->
sip_port
);
config
.
sUdpPort
.
SetValue
(
5060
);
config
.
sUdpPort
.
SetValue
(
gb28181
->
sUdpPort
);
QByteArray
&&
bSzServerDn
=
gb28181
->
realm
.
toUtf8
();
QByteArray
&&
bSzServerDn
=
gb28181
->
realm
.
toUtf8
();
char
*
sz_ServerDn
=
bSzServerDn
.
data
();
char
*
sz_ServerDn
=
bSzServerDn
.
data
();
...
...
CameraHandle.h
View file @
b6009d23
#ifndef CAMERAHANDLE_H
#ifndef CAMERAHANDLE_H
#define CAMERAHANDLE_H
#define CAMERAHANDLE_H
#include "Recogni
tion
Info.h"
#include "Recogni
zed
Info.h"
#include "FaceReconitionHandle.h"
#include "FaceReconitionHandle.h"
#include "HttpService.h"
#include "HttpService.h"
#include "LicensePlateRecognition.h"
#include "LicensePlateRecognition.h"
...
@@ -50,9 +50,9 @@ public:
...
@@ -50,9 +50,9 @@ public:
~
CameraHandle
();
~
CameraHandle
();
int
sdkDevLoginSyn
(
QString
sDevId
,
int
nDevPort
,
QString
sUserName
,
QString
sPassword
,
int
nTimeout
);
int
sdkDevLoginSyn
(
QString
sDevId
,
int
nDevPort
,
QString
sUserName
,
QString
sPassword
,
int
nTimeout
);
//int SdkMediaGetFaceImage(int hDevice, int nSeq, int nTimeout);
//int SdkMediaGetFaceImage(int hDevice, int nSeq, int nTimeout);
int
sdkDevSetAlarmListener
(
XSDK_HANDLE
hDevice
,
int
bListener
);
int
sdkDevSetAlarmListener
(
XSDK_HANDLE
hDevice
,
int
bListener
);
void
setHkDevice
(
bool
hk_status
,
int
hk_Device
);
int
getHdevice
();
int
getHdevice
();
int
getChannel
();
int
getChannel
();
...
@@ -83,6 +83,8 @@ public:
...
@@ -83,6 +83,8 @@ public:
void
licensePlateRecognitionResults
(
vides_data
::
requestLicensePlate
&
location
);
void
licensePlateRecognitionResults
(
vides_data
::
requestLicensePlate
&
location
);
bool
threeConsecutiveImage
();
void
sdkDevSnapSyn
(
XSDK_HANDLE
hDevice
,
int
nChannel
);
void
sdkDevSnapSyn
(
XSDK_HANDLE
hDevice
,
int
nChannel
);
void
printWifi
(
XSDK_HANDLE
hDevice
,
XSDK_CFG
::
NetWork_Wifi
&
cfg
);
void
printWifi
(
XSDK_HANDLE
hDevice
,
XSDK_CFG
::
NetWork_Wifi
&
cfg
);
...
@@ -185,7 +187,10 @@ private slots:
...
@@ -185,7 +187,10 @@ private slots:
private
:
private
:
int
hDevice
;
int
hDevice
;
int
hk_Device
;
bool
hk_status
;
int
channel
;
int
channel
;
QString
httpUrl
;
QString
httpUrl
;
SXSDKLoginParam
*
loginParam
;
SXSDKLoginParam
*
loginParam
;
...
...
FaceReconitionHandle.cpp
View file @
b6009d23
...
@@ -51,7 +51,7 @@ cv::Mat FaceReconitionHandle::loadImage(const QString &path) {
...
@@ -51,7 +51,7 @@ cv::Mat FaceReconitionHandle::loadImage(const QString &path) {
qInfo
()
<<
"图像以CImg成功加载。"
;
qInfo
()
<<
"图像以CImg成功加载。"
;
return
image
;
return
image
;
}
}
image
=
loadImageWithS
TB
(
path
);
image
=
loadImageWithS
tb
(
path
);
if
(
!
image
.
empty
())
{
if
(
!
image
.
empty
())
{
qInfo
()
<<
"图像以stb_image成功加载。"
;
qInfo
()
<<
"图像以stb_image成功加载。"
;
return
image
;
return
image
;
...
@@ -204,7 +204,7 @@ void FaceReconitionHandle::featureRemoveMap(std::map<QString, QString> &maps){
...
@@ -204,7 +204,7 @@ void FaceReconitionHandle::featureRemoveMap(std::map<QString, QString> &maps){
}
}
cv
::
Mat
FaceReconitionHandle
::
loadImageWithS
TB
(
const
QString
&
filename
)
{
cv
::
Mat
FaceReconitionHandle
::
loadImageWithS
tb
(
const
QString
&
filename
)
{
int
width
,
height
,
channels
;
int
width
,
height
,
channels
;
QByteArray
&&
b_filename
=
filename
.
toUtf8
();
QByteArray
&&
b_filename
=
filename
.
toUtf8
();
char
*
c_filename
=
b_filename
.
data
();
char
*
c_filename
=
b_filename
.
data
();
...
...
FaceReconitionHandle.h
View file @
b6009d23
...
@@ -32,7 +32,7 @@ public:
...
@@ -32,7 +32,7 @@ public:
cv
::
Mat
loadQImageFromByteStream
(
const
QString
&
filePath
);
cv
::
Mat
loadQImageFromByteStream
(
const
QString
&
filePath
);
cv
::
Mat
loadImageWithS
TB
(
const
QString
&
filename
);
cv
::
Mat
loadImageWithS
tb
(
const
QString
&
filename
);
bool
getImageChanged
()
const
;
bool
getImageChanged
()
const
;
...
...
HttpService.cpp
View file @
b6009d23
#include "HttpService.h"
#include "HttpService.h"
vides_data
::
responseStsCredentials
HttpService
::
stsCredentials
;
vides_data
::
responseStsCredentials
HttpService
::
stsCredentials
;
QString
HttpService
::
sing_key
;
HttpService
::
HttpService
()
{
HttpService
::
HttpService
()
{
...
@@ -45,6 +46,7 @@ vides_data::response* HttpService::httpPostDeviceStatus(vides_data::requestDevic
...
@@ -45,6 +46,7 @@ vides_data::response* HttpService::httpPostDeviceStatus(vides_data::requestDevic
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
QNetworkRequest
request
;
QNetworkRequest
request
;
assembleSingHeaders
(
request
);
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
...
@@ -78,6 +80,7 @@ vides_data::response* HttpService::httpPostRecord(int id,int recongnition_type,Q
...
@@ -78,6 +80,7 @@ vides_data::response* HttpService::httpPostRecord(int id,int recongnition_type,Q
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
QNetworkRequest
request
;
QNetworkRequest
request
;
assembleSingHeaders
(
request
);
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
...
@@ -99,6 +102,15 @@ vides_data::response* HttpService::httpPostRecord(int id,int recongnition_type,Q
...
@@ -99,6 +102,15 @@ vides_data::response* HttpService::httpPostRecord(int id,int recongnition_type,Q
void
HttpService
::
setHttpUrl
(
const
QString
&
httpUrl
){
void
HttpService
::
setHttpUrl
(
const
QString
&
httpUrl
){
this
->
httpUrl
=
httpUrl
;
this
->
httpUrl
=
httpUrl
;
}
}
void
HttpService
::
setSingKey
(
const
QString
&
key
)
{
sing_key
=
key
;
}
QString
HttpService
::
getSingKey
()
{
return
sing_key
;
}
vides_data
::
response
*
HttpService
::
httpFindCameras
(
QString
&
serialNumber
,
vides_data
::
responseDeviceData
&
responseData
)
{
vides_data
::
response
*
HttpService
::
httpFindCameras
(
QString
&
serialNumber
,
vides_data
::
responseDeviceData
&
responseData
)
{
httpUrl
.
append
(
"/api/v1.0/device/all"
);
httpUrl
.
append
(
"/api/v1.0/device/all"
);
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
...
@@ -106,6 +118,7 @@ vides_data::response *HttpService::httpFindCameras(QString &serialNumber,vides_d
...
@@ -106,6 +118,7 @@ vides_data::response *HttpService::httpFindCameras(QString &serialNumber,vides_d
query
.
addQueryItem
(
"sn"
,
serialNumber
);
query
.
addQueryItem
(
"sn"
,
serialNumber
);
query
.
addQueryItem
(
"new_token"
,
QString
::
number
(
1
));
query
.
addQueryItem
(
"new_token"
,
QString
::
number
(
1
));
QNetworkRequest
request
;
QNetworkRequest
request
;
assembleSingHeaders
(
request
);
QUrl
url
(
httpUrl
);
QUrl
url
(
httpUrl
);
url
.
setQuery
(
query
);
url
.
setQuery
(
query
);
request
.
setUrl
(
url
);
request
.
setUrl
(
url
);
...
@@ -222,6 +235,7 @@ vides_data::response *HttpService::httpLicensePlateRecognition(vides_data::reque
...
@@ -222,6 +235,7 @@ vides_data::response *HttpService::httpLicensePlateRecognition(vides_data::reque
QByteArray
bytearr
=
doc
.
toJson
(
QJsonDocument
::
Compact
);
QByteArray
bytearr
=
doc
.
toJson
(
QJsonDocument
::
Compact
);
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
assembleSingHeaders
(
request
);
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
...
@@ -264,6 +278,7 @@ vides_data::response* HttpService::httpFindFaceReconition(QString &serialNumber,
...
@@ -264,6 +278,7 @@ vides_data::response* HttpService::httpFindFaceReconition(QString &serialNumber,
query
.
addQueryItem
(
"sn"
,
serialNumber
);
query
.
addQueryItem
(
"sn"
,
serialNumber
);
QUrl
url
(
httpUrl
);
QUrl
url
(
httpUrl
);
url
.
setQuery
(
query
);
url
.
setQuery
(
query
);
assembleSingHeaders
(
request
);
request
.
setUrl
(
url
);
request
.
setUrl
(
url
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
...
@@ -305,6 +320,7 @@ vides_data::response *HttpService::httpPostUniforms(QByteArray &img,QString &id,
...
@@ -305,6 +320,7 @@ vides_data::response *HttpService::httpPostUniforms(QByteArray &img,QString &id,
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
QNetworkRequest
request
;
QNetworkRequest
request
;
assembleSingHeaders
(
request
);
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
...
@@ -346,6 +362,7 @@ vides_data::response *HttpService::httpPostFacePopulation(QByteArray &img,int &h
...
@@ -346,6 +362,7 @@ vides_data::response *HttpService::httpPostFacePopulation(QByteArray &img,int &h
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
QNetworkRequest
request
;
QNetworkRequest
request
;
assembleSingHeaders
(
request
);
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
...
@@ -394,6 +411,7 @@ vides_data::response *HttpService::httpPostFaceReconition(vides_data::requestFac
...
@@ -394,6 +411,7 @@ vides_data::response *HttpService::httpPostFaceReconition(vides_data::requestFac
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
vides_data
::
response
*
resp
=
new
vides_data
::
response
();
QNetworkRequest
request
;
QNetworkRequest
request
;
assembleSingHeaders
(
request
);
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setUrl
(
QUrl
(
httpUrl
));
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
...
@@ -419,6 +437,7 @@ vides_data::response*HttpService::httpFindGb28181Config(QString &serialNumber){
...
@@ -419,6 +437,7 @@ vides_data::response*HttpService::httpFindGb28181Config(QString &serialNumber){
QNetworkRequest
request
;
QNetworkRequest
request
;
QUrl
url
(
httpUrl
);
QUrl
url
(
httpUrl
);
url
.
setQuery
(
query
);
url
.
setQuery
(
query
);
assembleSingHeaders
(
request
);
request
.
setUrl
(
url
);
request
.
setUrl
(
url
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
...
@@ -442,6 +461,8 @@ vides_data::response*HttpService::httpFindGb28181Config(QString &serialNumber){
...
@@ -442,6 +461,8 @@ vides_data::response*HttpService::httpFindGb28181Config(QString &serialNumber){
response
->
heartbeat_interval
=
data
[
"heartbeat_interval"
].
toInt
();
response
->
heartbeat_interval
=
data
[
"heartbeat_interval"
].
toInt
();
response
->
device_id
=
data
[
"device_id"
].
toString
();
response
->
device_id
=
data
[
"device_id"
].
toString
();
response
->
channel_id
=
data
[
"channel_id"
].
toString
();
response
->
channel_id
=
data
[
"channel_id"
].
toString
();
QString
local_port
=
data
[
"local_port"
].
toString
();
response
->
sUdpPort
=
local_port
.
toInt
();
resp
->
data
=
response
;
resp
->
data
=
response
;
resp
->
msg
=
map
[
"message"
].
toString
();
resp
->
msg
=
map
[
"message"
].
toString
();
}
else
{
}
else
{
...
@@ -460,6 +481,7 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber,
...
@@ -460,6 +481,7 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber,
QNetworkRequest
request
;
QNetworkRequest
request
;
QUrl
url
(
httpUrl
);
QUrl
url
(
httpUrl
);
url
.
setQuery
(
query
);
url
.
setQuery
(
query
);
assembleSingHeaders
(
request
);
request
.
setUrl
(
url
);
request
.
setUrl
(
url
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
request
.
setRawHeader
(
vides_data
::
HEADER_TYPE_KAY
,
vides_data
::
HEADER_TYPE_VALUE
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
QMutexLocker
locker
(
&
m_httpClientMutex
);
...
@@ -531,7 +553,7 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber,
...
@@ -531,7 +553,7 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber,
// 解析 uniformConfig
// 解析 uniformConfig
QJsonObject
uniformConfigObj
=
dataObj
[
"uniformConfig"
].
toObject
();
QJsonObject
uniformConfigObj
=
dataObj
[
"uniformConfig"
].
toObject
();
config
.
uniformConfig
.
isOn
=
uniformConfigObj
[
"isOn"
].
toBool
();
config
.
uniformConfig
.
isOn
=
uniformConfigObj
[
"isOn"
].
toBool
();
config
.
uniformConfig
.
uniformColor
=
uniformConfigObj
[
"uniformColor"
].
to
Int
();
config
.
uniformConfig
.
uniformColor
=
uniformConfigObj
[
"uniformColor"
].
to
String
();
config
.
uniformConfig
.
humanDetectionLen
=
uniformConfigObj
[
"humanDetectionLen"
].
toInt
();
config
.
uniformConfig
.
humanDetectionLen
=
uniformConfigObj
[
"humanDetectionLen"
].
toInt
();
config
.
uniformConfig
.
updateAt
=
uniformConfigObj
[
"updateAt"
].
toVariant
().
toULongLong
();
config
.
uniformConfig
.
updateAt
=
uniformConfigObj
[
"updateAt"
].
toVariant
().
toULongLong
();
config
.
uniformConfig
.
carShapeConfidence
=
uniformConfigObj
[
"carShapeConfidence"
].
toVariant
().
toFloat
();
config
.
uniformConfig
.
carShapeConfidence
=
uniformConfigObj
[
"carShapeConfidence"
].
toVariant
().
toFloat
();
...
@@ -540,6 +562,13 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber,
...
@@ -540,6 +562,13 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber,
config
.
humanConfig
.
isOn
=
humanConfigObj
[
"isOn"
].
toBool
();
config
.
humanConfig
.
isOn
=
humanConfigObj
[
"isOn"
].
toBool
();
config
.
humanConfig
.
updateAt
=
humanConfigObj
[
"updateAt"
].
toVariant
().
toULongLong
();
config
.
humanConfig
.
updateAt
=
humanConfigObj
[
"updateAt"
].
toVariant
().
toULongLong
();
config
.
humanConfig
.
faceFrequency
=
humanConfigObj
[
"faceFrequency"
].
toVariant
().
toUInt
();
config
.
humanConfig
.
faceFrequency
=
humanConfigObj
[
"faceFrequency"
].
toVariant
().
toUInt
();
//解析nvrConfig;
QJsonObject
nvrConfigObj
=
dataObj
[
"nvrConfig"
].
toObject
();
config
.
nvrConfig
.
isOn
=
nvrConfigObj
[
"isOn"
].
toBool
();
config
.
nvrConfig
.
ip
=
nvrConfigObj
[
"ip"
].
toString
();
config
.
nvrConfig
.
port
=
(
unsigned
short
)
nvrConfigObj
[
"port"
].
toInt
();
config
.
nvrConfig
.
password
=
nvrConfigObj
[
"password"
].
toString
();
config
.
nvrConfig
.
username
=
nvrConfigObj
[
"username"
].
toString
();
// 解析 devicesConfig
// 解析 devicesConfig
QJsonObject
devicesConfigObj
=
dataObj
[
"camera"
].
toObject
();
QJsonObject
devicesConfigObj
=
dataObj
[
"camera"
].
toObject
();
...
@@ -573,6 +602,23 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber,
...
@@ -573,6 +602,23 @@ vides_data::response *HttpService::httpDeviceConfig(const QString &serialNumber,
}
}
void
HttpService
::
assembleSingHeaders
(
QNetworkRequest
&
reques
){
QString
ts
=
QString
::
number
(
QDateTime
::
currentMSecsSinceEpoch
()
/
1000
);
// 计算签名
QCryptographicHash
hash
(
QCryptographicHash
::
Md5
);
hash
.
addData
(
HttpService
::
getSingKey
().
toUtf8
());
hash
.
addData
(
ts
.
toUtf8
());
QString
sign
=
hash
.
result
().
toHex
();
// 设置头部信息
QMap
<
QString
,
QVariant
>
headers
;
headers
.
insert
(
"ts"
,
ts
);
headers
.
insert
(
"sign"
,
sign
);
for
(
auto
it
=
headers
.
begin
();
it
!=
headers
.
end
();
++
it
)
{
reques
.
setRawHeader
(
it
.
key
().
toLatin1
(),
it
.
value
().
toString
().
toLatin1
());
}
}
vides_data
::
response
*
HttpService
::
httpFindStream
(
QString
&
serialNumber
){
vides_data
::
response
*
HttpService
::
httpFindStream
(
QString
&
serialNumber
){
httpUrl
.
append
(
"/api/v1.0/stream"
);
httpUrl
.
append
(
"/api/v1.0/stream"
);
...
...
HttpService.h
View file @
b6009d23
...
@@ -49,7 +49,13 @@ public:
...
@@ -49,7 +49,13 @@ public:
vides_data
::
response
*
httpUploadFile
(
const
QString
&
filePath
,
QString
&
accessKeyId
,
QString
&
accessKeySecret
,
vides_data
::
response
*
httpUploadFile
(
const
QString
&
filePath
,
QString
&
accessKeyId
,
QString
&
accessKeySecret
,
QString
&
bucketName
,
QString
&
securityToken
);
QString
&
bucketName
,
QString
&
securityToken
);
void
setHttpUrl
(
const
QString
&
httpUrl
);
void
setHttpUrl
(
const
QString
&
httpUrl
);
static
void
setSingKey
(
const
QString
&
key
);
static
QString
getSingKey
();
//组装验证头
void
assembleSingHeaders
(
QNetworkRequest
&
reques
);
vides_data
::
response
*
httpDeviceConfig
(
const
QString
&
serialNumber
,
vides_data
::
responseConfig
&
config
);
vides_data
::
response
*
httpDeviceConfig
(
const
QString
&
serialNumber
,
vides_data
::
responseConfig
&
config
);
...
@@ -63,5 +69,6 @@ private:
...
@@ -63,5 +69,6 @@ private:
QMutex
m_httpClientMutex
;
QMutex
m_httpClientMutex
;
static
QString
sing_key
;
};
};
#endif // HTTPSERVICE_H
#endif // HTTPSERVICE_H
HumanDetection.cpp
View file @
b6009d23
...
@@ -72,7 +72,7 @@ void HumanDetection::draw_human_on_image(const cv::Mat& image, const TCV_ObjectL
...
@@ -72,7 +72,7 @@ void HumanDetection::draw_human_on_image(const cv::Mat& image, const TCV_ObjectL
}
}
}
}
void
HumanDetection
::
setHuManParameter
(
int
&
uniformColor
){
void
HumanDetection
::
setHuManParameter
(
QString
&
uniformColor
){
this
->
uniformColor
=
uniformColor
;
this
->
uniformColor
=
uniformColor
;
}
}
...
@@ -98,23 +98,38 @@ int HumanDetection::findHuManCar(const cv::Mat &source, int res,std::map<int,int
...
@@ -98,23 +98,38 @@ int HumanDetection::findHuManCar(const cv::Mat &source, int res,std::map<int,int
int
num
=
0
;
int
num
=
0
;
if
(
res
==
0x00
||
res
==
0x02
)
{
if
(
res
==
0x00
||
res
==
0x02
)
{
QStringList
colorList
=
uniformColor
.
split
(
','
);
num
=
TCV_HumanDetectorGetNumOfHuman
(
detector
);
num
=
TCV_HumanDetectorGetNumOfHuman
(
detector
);
qInfo
()
<<
QString
(
"SN(%1): 获取人形数量:%2"
).
arg
(
sSn
).
arg
(
num
);
qInfo
()
<<
QString
(
"SN(%1): 获取人形数量:%2"
).
arg
(
sSn
).
arg
(
num
);
if
(
num
==
0
)
return
num
;
// 无行人检测结果,提前返回
if
(
num
==
0
)
return
num
;
// 无行人检测结果,提前返回
if
(
res
==
0x02
&&
colorList
.
size
()
==
0
){
reMap
[
0x02
]
=
0
;
// 未穿工服的行人数量
reMap
[
0x00
]
=
num
;
// 所有满足条件的行人数量
num
=
0
;
return
num
;
}
int
count_no_uniform
=
0
;
// 未穿工服的行人数量
int
count_all
=
0
;
// 所有满足条件的行人数量
std
::
vector
<
TCV_ObjectLocation
>
results
(
num
);
std
::
vector
<
TCV_ObjectLocation
>
results
(
num
);
TCV_HumanDetectorGetHumanLocation
(
detector
,
results
.
data
(),
num
);
TCV_HumanDetectorGetHumanLocation
(
detector
,
results
.
data
(),
num
);
int
count_no_uniform
=
0
;
// 未穿工服的行人数量
QSet
<
int
>
uniformNumbers
;
int
count_all
=
0
;
// 所有满足条件的行人数量
for
(
const
QString
&
numStr
:
colorList
)
{
bool
ok
;
int
num
=
numStr
.
toInt
(
&
ok
);
if
(
ok
)
{
uniformNumbers
.
insert
(
num
);
}
}
for
(
const
auto
&
person
:
results
)
{
for
(
const
auto
&
person
:
results
)
{
int
tenPlace
=
uniformColor
/
10
;
// 十位
int
onePlace
=
uniformColor
%
10
;
// 个位
if
(
std
::
abs
(
person
.
y2
-
person
.
y1
)
>=
heightReference
)
{
if
(
std
::
abs
(
person
.
y2
-
person
.
y1
)
>=
heightReference
)
{
++
count_all
;
++
count_all
;
//工服
//工服
if
(
person
.
uniform
!=
tenPlace
&&
person
.
uniform
!=
onePlace
){
if
(
!
uniformNumbers
.
contains
(
person
.
uniform
)
){
vides_data
::
ParkingArea
area
;
vides_data
::
ParkingArea
area
;
area
.
topLeftCornerX
=
person
.
x1
;
area
.
topLeftCornerX
=
person
.
x1
;
area
.
topLeftCornerY
=
person
.
y1
;
area
.
topLeftCornerY
=
person
.
y1
;
...
...
HumanDetection.h
View file @
b6009d23
...
@@ -19,7 +19,7 @@ public:
...
@@ -19,7 +19,7 @@ public:
int
findHuManCar
(
const
cv
::
Mat
&
source
,
int
res
,
std
::
map
<
int
,
int
>&
reMap
,
QString
&
sSn
,
int
findHuManCar
(
const
cv
::
Mat
&
source
,
int
res
,
std
::
map
<
int
,
int
>&
reMap
,
QString
&
sSn
,
float
&
heightReference
,
std
::
vector
<
vides_data
::
ParkingArea
>
&
currentPlate
);
float
&
heightReference
,
std
::
vector
<
vides_data
::
ParkingArea
>
&
currentPlate
);
void
setHuManParameter
(
int
&
uniformColor
);
void
setHuManParameter
(
QString
&
uniformColor
);
void
draw_human_on_image
(
const
cv
::
Mat
&
image
,
const
TCV_ObjectLocation
*
boxes
,
int
size
);
void
draw_human_on_image
(
const
cv
::
Mat
&
image
,
const
TCV_ObjectLocation
*
boxes
,
int
size
);
...
@@ -27,7 +27,7 @@ private:
...
@@ -27,7 +27,7 @@ private:
//高度基准
//高度基准
float
heightReference
;
float
heightReference
;
int
uniformColor
;
QString
uniformColor
;
TCV_HumanDetector
*
detector
;
TCV_HumanDetector
*
detector
;
...
...
MediaFaceImage.cpp
View file @
b6009d23
...
@@ -117,6 +117,21 @@ int MediaFaceImage::SdkSearchDevicesSyn(std::map<QString, vides_data::localDevic
...
@@ -117,6 +117,21 @@ int MediaFaceImage::SdkSearchDevicesSyn(std::map<QString, vides_data::localDevic
}
}
int
MediaFaceImage
::
SdkIpcSearchDevicesSyn
(
int
lUserID
,
NET_DVR_IPPARACFG_V40
*
reqParams
){
int
iRet
=
-
1
;
DWORD
uiReturnLen
=
0
;
LONG
lChannel
=
0
;
//get
iRet
=
NET_DVR_GetDVRConfig
(
lUserID
,
NET_DVR_GET_IPPARACFG_V40
,
lChannel
,
\
reqParams
,
sizeof
(
NET_DVR_IPPARACFG_V40
),
&
uiReturnLen
);
if
(
!
iRet
){
qInfo
()
<<
QString
(
"pyd---NET_DVR_GetDVRConfig NET_DVR_GET_IPPARACFG_V40 error.%1
\n
"
).
arg
(
NET_DVR_GetLastError
());
return
-
1
;
}
return
0
;
}
int
MediaFaceImage
::
SdkInit
(
QString
&
szConfigPath
,
QString
&
szTempPath
)
{
int
MediaFaceImage
::
SdkInit
(
QString
&
szConfigPath
,
QString
&
szTempPath
)
{
SXSDKInitParam
*
pParam
=
new
SXSDKInitParam
();
SXSDKInitParam
*
pParam
=
new
SXSDKInitParam
();
pParam
->
nLogLevel
=
8
;
pParam
->
nLogLevel
=
8
;
...
@@ -235,7 +250,7 @@ int MediaFaceImage::FaceImageCallBack(XSDK_HANDLE hMedia, int nChannel, cv::Mat
...
@@ -235,7 +250,7 @@ int MediaFaceImage::FaceImageCallBack(XSDK_HANDLE hMedia, int nChannel, cv::Mat
const
int
BufferSize
=
1024
*
1024
*
2
;
// 缓冲区大小
const
int
BufferSize
=
1024
*
1024
*
2
;
// 缓冲区大小
image
.
release
();
// 释放之前的图像
image
.
release
();
// 释放之前的图像
std
::
unique_ptr
<
unsigned
char
[]
>
pOutBuffer
(
new
unsigned
char
[
BufferSize
]);
// 智能指针管理内存
std
::
unique_ptr
<
unsigned
char
[]
>
pOutBuffer
(
new
unsigned
char
[
BufferSize
]);
// 智能指针管理内存
int
pInOutBufferSize
=
0
;
int
pInOutBufferSize
=
-
1
;
int
ret
=
XSDK_DevSnapSyn
(
hMedia
,
nChannel
,
""
,
pOutBuffer
.
get
(),
&
pInOutBufferSize
);
int
ret
=
XSDK_DevSnapSyn
(
hMedia
,
nChannel
,
""
,
pOutBuffer
.
get
(),
&
pInOutBufferSize
);
if
(
ret
<
0
||
pInOutBufferSize
<=
0
)
{
if
(
ret
<
0
||
pInOutBufferSize
<=
0
)
{
...
@@ -262,6 +277,71 @@ int MediaFaceImage::FaceImageCallBack(XSDK_HANDLE hMedia, int nChannel, cv::Mat
...
@@ -262,6 +277,71 @@ int MediaFaceImage::FaceImageCallBack(XSDK_HANDLE hMedia, int nChannel, cv::Mat
return
pInOutBufferSize
;
return
pInOutBufferSize
;
}
}
int
MediaFaceImage
::
getIPChannelInfo
(
int
hk_Device
,
const
QString
&
ip
){
NET_DVR_IPPARACFG_V40
m_strIpparaCfg
=
{
0
};
m_strIpparaCfg
.
dwSize
=
sizeof
(
m_strIpparaCfg
);
int
bRet
=
SdkIpcSearchDevicesSyn
(
hk_Device
,
&
m_strIpparaCfg
);
if
(
bRet
<
0
)
{
qInfo
()
<<
"获取IP接入配置参数失败,错误码:"
<<
NET_DVR_GetLastError
();
return
-
1
;
}
for
(
int
iChannum
=
0
;
iChannum
<
m_strIpparaCfg
.
dwDChanNum
;
++
iChannum
)
{
if
(
m_strIpparaCfg
.
struStreamMode
[
iChannum
].
byGetStreamType
==
0
)
{
int
channel
=
m_strIpparaCfg
.
struStreamMode
[
iChannum
].
uGetStream
.
struChanInfo
.
byIPID
+
(
m_strIpparaCfg
.
struStreamMode
[
iChannum
].
uGetStream
.
struChanInfo
.
byIPIDHigh
*
256
);
if
(
channel
>
0
&&
m_strIpparaCfg
.
struStreamMode
[
iChannum
].
uGetStream
.
struChanInfo
.
byEnable
==
1
)
{
char
ip_addr
[
16
]
=
{
0
};
strncpy
(
ip_addr
,
m_strIpparaCfg
.
struIPDevInfo
[
channel
-
1
].
struIP
.
sIpV4
,
sizeof
(
ip_addr
)
-
1
);
QString
key
=
QString
::
fromUtf8
(
ip_addr
).
trimmed
();
qInfo
()
<<
"匹配的IP:"
<<
key
<<
",通道号:"
<<
channel
;
if
(
key
==
ip
)
{
qInfo
()
<<
"找到匹配的IP:"
<<
key
<<
",通道号:"
<<
channel
;
return
channel
;
// 返回找到的第一个匹配的通道号
}
}
}
}
qInfo
()
<<
"未找到匹配的IP:"
<<
ip
;
return
-
1
;
// 没有找到匹配的IP地址
}
int
MediaFaceImage
::
FaceHkImageCallBack
(
int
userID
,
int
channelID
,
cv
::
Mat
&
image
,
QString
&
sSn
){
image
.
release
();
NET_DVR_JPEGPARA
jpegpara
=
{
0
};
jpegpara
.
wPicQuality
=
0
;
jpegpara
.
wPicSize
=
0xff
;
// 自动选择图片大小
const
size_t
M1
=
8
<<
20
;
// 8 MB 缓冲区大小
std
::
unique_ptr
<
char
[]
>
buffer
(
new
char
[
M1
]);
// 使用智能指针管理缓冲区
unsigned
int
imageLen
=
0
;
bool
result
=
NET_DVR_CaptureJPEGPicture_NEW
(
userID
,
32
+
channelID
,
&
jpegpara
,
buffer
.
get
(),
M1
,
&
imageLen
);
if
(
!
result
||
imageLen
==
0
)
{
qInfo
()
<<
"抓图失败, 错误码:"
<<
NET_DVR_GetLastError
();
return
-
1
;
}
// 使用 std::vector 管理缓冲区数据
std
::
vector
<
uchar
>
imageBuffer
(
imageLen
);
memcpy
(
imageBuffer
.
data
(),
buffer
.
get
(),
imageLen
);
try
{
// 解码 JPEG 数据为 cv::Mat
cv
::
Mat
decodedImage
=
cv
::
imdecode
(
imageBuffer
,
cv
::
IMREAD_UNCHANGED
);
if
(
decodedImage
.
empty
())
{
qInfo
()
<<
QString
(
"SN(%1): 图像解码失败"
).
arg
(
sSn
);
return
-
1
;
}
// 转移解码后的图像到输出参数
image
=
std
::
move
(
decodedImage
);
}
catch
(
const
cv
::
Exception
&
e
)
{
qInfo
()
<<
QString
(
"SN(%1): 图像解码过程中捕获异常:%2"
).
arg
(
sSn
).
arg
(
e
.
what
());
return
-
1
;
}
return
imageLen
;
// 返回图像数据长度
}
int
MediaFaceImage
::
CameraImage
(
XSDK_HANDLE
hMedia
,
int
nChannel
,
std
::
vector
<
uchar
>
&
buffer
){
int
MediaFaceImage
::
CameraImage
(
XSDK_HANDLE
hMedia
,
int
nChannel
,
std
::
vector
<
uchar
>
&
buffer
){
static
const
int
BufferSize
=
1024
*
1024
*
2
;
// 2MB buffer size
static
const
int
BufferSize
=
1024
*
1024
*
2
;
// 2MB buffer size
static
unsigned
char
pOutBuffer
[
BufferSize
];
static
unsigned
char
pOutBuffer
[
BufferSize
];
...
...
MediaFaceImage.h
View file @
b6009d23
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include "VidesData.h"
#include "VidesData.h"
#include "Common.h"
#include "Common.h"
#include "TaskRunnable.h"
#include "TaskRunnable.h"
#include "HCNetSDK.h"
#include <memory>
#include <memory>
#include <map>
#include <map>
#include <QDebug>
#include <QDebug>
...
@@ -19,6 +20,9 @@ public:
...
@@ -19,6 +20,9 @@ public:
void
ParserImageData
(
const
unsigned
char
*
pData
,
int
nDataLen
,
char
*
pJpg
,
int
*
nJpgLen
,
char
*
pJson
);
void
ParserImageData
(
const
unsigned
char
*
pData
,
int
nDataLen
,
char
*
pJpg
,
int
*
nJpgLen
,
char
*
pJson
);
int
FaceImageCallBack
(
XSDK_HANDLE
hMedia
,
int
nChannel
,
cv
::
Mat
&
image
,
QString
&
sSn
);
int
FaceImageCallBack
(
XSDK_HANDLE
hMedia
,
int
nChannel
,
cv
::
Mat
&
image
,
QString
&
sSn
);
int
FaceHkImageCallBack
(
int
userID
,
int
channelID
,
cv
::
Mat
&
image
,
QString
&
sSn
);
int
CameraImage
(
XSDK_HANDLE
hMedia
,
int
nChannel
,
std
::
vector
<
uchar
>
&
buffer
);
int
CameraImage
(
XSDK_HANDLE
hMedia
,
int
nChannel
,
std
::
vector
<
uchar
>
&
buffer
);
int
ToFile
(
const
char
*
pFileName
,
const
void
*
pData
,
int
nLenght
);
int
ToFile
(
const
char
*
pFileName
,
const
void
*
pData
,
int
nLenght
);
...
@@ -27,6 +31,10 @@ public:
...
@@ -27,6 +31,10 @@ public:
int
SdkSearchDevicesSyn
(
std
::
map
<
QString
,
vides_data
::
localDeviceStatus
*>&
devices
);
int
SdkSearchDevicesSyn
(
std
::
map
<
QString
,
vides_data
::
localDeviceStatus
*>&
devices
);
int
SdkIpcSearchDevicesSyn
(
int
lUserID
,
NET_DVR_IPPARACFG_V40
*
reqParams
);
//通过IP获取到对应通道号
int
getIPChannelInfo
(
int
hk_Device
,
const
QString
&
ip
);
int
SdkInit
(
QString
&
szConfigPath
,
QString
&
szTempPath
);
int
SdkInit
(
QString
&
szConfigPath
,
QString
&
szTempPath
);
std
::
map
<
int
,
CameraHandle
*>
getCurrentDevice
();
std
::
map
<
int
,
CameraHandle
*>
getCurrentDevice
();
...
...
ParkingSpaceInfo.h
View file @
b6009d23
#ifndef PARKINGSPACEINFO_H
#ifndef PARKINGSPACEINFO_H
#define PARKINGSPACEINFO_H
#define PARKINGSPACEINFO_H
#include "VidesData.h"
#include "VidesData.h"
#include "Recogni
tion
Info.h"
#include "Recogni
zed
Info.h"
#include <QMutex>
#include <QMutex>
#include <QQueue>
#include <QQueue>
class
ParkingSpaceInfo
{
class
ParkingSpaceInfo
{
...
...
RecognizedInfo.cpp
View file @
b6009d23
#include "Recogni
tion
Info.h"
#include "Recogni
zed
Info.h"
RecognizedInfo
::
RecognizedInfo
(){
RecognizedInfo
::
RecognizedInfo
(){
...
...
Recogni
tion
Info.h
→
Recogni
zed
Info.h
View file @
b6009d23
File moved
ScopeSemaphoreExit.h
View file @
b6009d23
VidesData.h
View file @
b6009d23
...
@@ -70,6 +70,7 @@ struct responseGb28181 {
...
@@ -70,6 +70,7 @@ struct responseGb28181 {
int
heartbeat_interval
;
int
heartbeat_interval
;
QString
device_id
;
QString
device_id
;
QString
channel_id
;
QString
channel_id
;
int
sUdpPort
;
};
};
struct
responseArea
{
struct
responseArea
{
float
bottom_right_corner_x
;
float
bottom_right_corner_x
;
...
@@ -288,7 +289,7 @@ struct LicensePlateConfig {
...
@@ -288,7 +289,7 @@ struct LicensePlateConfig {
struct
UniformConfig
{
struct
UniformConfig
{
bool
isOn
;
bool
isOn
;
int
uniformColor
;
QString
uniformColor
;
int
humanDetectionLen
;
int
humanDetectionLen
;
float
carShapeConfidence
;
float
carShapeConfidence
;
quint64
updateAt
;
quint64
updateAt
;
...
@@ -310,6 +311,14 @@ struct MqttConfig {
...
@@ -310,6 +311,14 @@ struct MqttConfig {
QString
password
;
QString
password
;
quint64
updateAt
;
quint64
updateAt
;
};
};
struct
NvrConfig
{
bool
isOn
;
QString
ip
;
QString
username
;
QString
password
;
uint16_t
port
;
};
struct
responseConfig
{
struct
responseConfig
{
MainFormat
mainFormat
;
MainFormat
mainFormat
;
...
@@ -320,7 +329,7 @@ struct responseConfig {
...
@@ -320,7 +329,7 @@ struct responseConfig {
UniformConfig
uniformConfig
;
UniformConfig
uniformConfig
;
Camera
camera
;
Camera
camera
;
MqttConfig
mqttConfig
;
MqttConfig
mqttConfig
;
NvrConfig
nvrConfig
;
HumanConfig
humanConfig
;
HumanConfig
humanConfig
;
};
};
...
@@ -342,7 +351,7 @@ struct DetectionParams {
...
@@ -342,7 +351,7 @@ struct DetectionParams {
int
newFaceLen
;
int
newFaceLen
;
QString
modelPaths
;
QString
modelPaths
;
float
humanCarShapeConfidence
;
float
humanCarShapeConfidence
;
int
uniformColor
;
QString
uniformColor
;
std
::
map
<
QString
,
QString
>
faceMaps
;
std
::
map
<
QString
,
QString
>
faceMaps
;
int
numberFaces
;
int
numberFaces
;
float
faceConfidence
;
float
faceConfidence
;
...
@@ -355,7 +364,6 @@ struct DetectionParams {
...
@@ -355,7 +364,6 @@ struct DetectionParams {
float
recConfidenceThreshold
;
///< 识别置信度阈值
float
recConfidenceThreshold
;
///< 识别置信度阈值
};
};
inline
bool
isVirtualMachine
()
inline
bool
isVirtualMachine
()
{
{
QString
dmiPath
;
QString
dmiPath
;
...
...
gamera_videos.pro
View file @
b6009d23
...
@@ -17,7 +17,9 @@ DEFINES += APP_VERSION=\\\"1.3.2\\\"
...
@@ -17,7 +17,9 @@ DEFINES += APP_VERSION=\\\"1.3.2\\\"
DEFINES
+=
QT_MESSAGELOGCONTEXT
DEFINES
+=
QT_MESSAGELOGCONTEXT
DEFINES
+=
QT_NO_DEBUG_OUTPUT
DEFINES
+=
QT_NO_DEBUG_OUTPUT
QMAKE_LIBDIR
+=
/
usr
/
local
/
lib
# 设置库路径
QMAKE_LIBDIR
+=
/
usr
/
local
/
lib
\
/
usr
/
local
/
lib
/
HCNetSDKCom
INCLUDEPATH
+=/
usr
/
local
/
include
/
opencv4
INCLUDEPATH
+=/
usr
/
local
/
include
/
opencv4
INCLUDEPATH
+=/
usr
/
local
/
include
/
hyperface
INCLUDEPATH
+=/
usr
/
local
/
include
/
hyperface
...
@@ -27,7 +29,7 @@ INCLUDEPATH+=/usr/local/include/human
...
@@ -27,7 +29,7 @@ INCLUDEPATH+=/usr/local/include/human
INCLUDEPATH
+=/
usr
/
local
/
include
/
CImg
INCLUDEPATH
+=/
usr
/
local
/
include
/
CImg
INCLUDEPATH
+=/
usr
/
local
/
include
/
mqtt
INCLUDEPATH
+=/
usr
/
local
/
include
/
mqtt
INCLUDEPATH
+=/
usr
/
local
/
include
/
stb_image
INCLUDEPATH
+=/
usr
/
local
/
include
/
stb_image
INCLUDEPATH
+=/
usr
/
local
/
include
/
hkws
...
@@ -88,6 +90,7 @@ LIBS += -lopencv_core \
...
@@ -88,6 +90,7 @@ LIBS += -lopencv_core \
-
lopencv_objdetect
\
-
lopencv_objdetect
\
-
lsohuman
\
-
lsohuman
\
-
lpaho
-
mqtt3a
\
-
lpaho
-
mqtt3a
\
-
lhcnetsdk
\
# -lssl \
# -lssl \
# -lcrypto \ sudo apt-get install libjpeg-dev libpng-dev
# -lcrypto \ sudo apt-get install libjpeg-dev libpng-dev
-
lc
\
-
lc
\
...
@@ -100,7 +103,6 @@ SOURCES += \
...
@@ -100,7 +103,6 @@ SOURCES += \
mainwindow
.
cpp
\
mainwindow
.
cpp
\
LicensePlateRecognition
.
cpp
\
LicensePlateRecognition
.
cpp
\
MediaFaceImage
.
cpp
\
MediaFaceImage
.
cpp
\
RecognizedInfo
.
cpp
\
Httpclient
.
cpp
\
Httpclient
.
cpp
\
HttpService
.
cpp
\
HttpService
.
cpp
\
TaskRunnable
.
cpp
\
TaskRunnable
.
cpp
\
...
@@ -112,7 +114,8 @@ SOURCES += \
...
@@ -112,7 +114,8 @@ SOURCES += \
AlgorithmTaskManage
.
cpp
\
AlgorithmTaskManage
.
cpp
\
BaseAlgorithm
.
cpp
\
BaseAlgorithm
.
cpp
\
MqttSubscriber
.
cpp
\
MqttSubscriber
.
cpp
\
NonConnectedCameraHandle
.
cpp
NonConnectedCameraHandle
.
cpp
\
RecognizedInfo
.
cpp
HEADERS
+=
\
HEADERS
+=
\
Common
.
h
\
Common
.
h
\
...
@@ -120,7 +123,6 @@ HEADERS += \
...
@@ -120,7 +123,6 @@ HEADERS += \
mainwindow
.
h
\
mainwindow
.
h
\
LicensePlateRecognition
.
h
\
LicensePlateRecognition
.
h
\
MediaFaceImage
.
h
\
MediaFaceImage
.
h
\
RecognitionInfo
.
h
\
HttpClient
.
h
\
HttpClient
.
h
\
HttpService
.
h
\
HttpService
.
h
\
VidesData
.
h
\
VidesData
.
h
\
...
...
mainwindow.cpp
View file @
b6009d23
...
@@ -7,8 +7,6 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -7,8 +7,6 @@ MainWindow::MainWindow():isResetting(false)
{
{
sp_this
=
this
;
sp_this
=
this
;
LogHandler
::
Get
().
installMessageHandler
();
LogHandler
::
Get
().
installMessageHandler
();
QString
inifile
=
QCoreApplication
::
applicationDirPath
()
+
"/gameras.ini"
;
QString
inifile
=
QCoreApplication
::
applicationDirPath
()
+
"/gameras.ini"
;
...
@@ -19,7 +17,7 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -19,7 +17,7 @@ MainWindow::MainWindow():isResetting(false)
QThreadPool
*
threadPool
=
QThreadPool
::
globalInstance
();
QThreadPool
*
threadPool
=
QThreadPool
::
globalInstance
();
threadPool
->
setMaxThreadCount
(
1
2
);
threadPool
->
setMaxThreadCount
(
1
8
);
QString
httpurl
;
QString
httpurl
;
QString
profile
=
qSetting
->
value
(
"cloudservice/profile"
,
"test"
).
toString
();
QString
profile
=
qSetting
->
value
(
"cloudservice/profile"
,
"test"
).
toString
();
...
@@ -30,23 +28,9 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -30,23 +28,9 @@ MainWindow::MainWindow():isResetting(false)
}
else
{
}
else
{
httpurl
=
qSetting
->
value
(
"cloudservice/pro_http"
).
toString
();
httpurl
=
qSetting
->
value
(
"cloudservice/pro_http"
).
toString
();
}
}
Common
&
instace
=
Common
::
getInstance
();
QString
serialNumber
;
QString
serialNumber
;
findLocalSerialNumber
(
serialNumber
);
realTimeUpdateDivConfig
(
httpurl
,
serialNumber
);
bool
configFetched
=
false
;
while
(
!
configFetched
)
{
HttpService
httpService
(
httpurl
);
vides_data
::
response
*
res
=
httpService
.
httpDeviceConfig
(
serialNumber
,
config
);
if
(
res
->
code
!=
0
)
{
qInfo
()
<<
"请求远程商户配置失败,重试中..."
;
instace
.
deleteObj
(
res
);
QThread
::
sleep
(
5
);
// 等待5秒后重试
}
else
{
instace
.
deleteObj
(
res
);
configFetched
=
true
;
}
}
initCommon
();
initCommon
();
...
@@ -55,11 +39,9 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -55,11 +39,9 @@ MainWindow::MainWindow():isResetting(false)
int
deleteLogfileTimer
=
config
.
timerSettings
.
deleteLogFileTimer
;
int
deleteLogfileTimer
=
config
.
timerSettings
.
deleteLogFileTimer
;
deleteLogFileTimer
->
start
(
deleteLogfileTimer
);
deleteLogFileTimer
->
start
(
deleteLogfileTimer
);
initFaceFaceRecognition
();
initFaceFaceRecognition
();
QString
uniformColor
=
config
.
uniformConfig
.
uniformColor
;
int
uniformColor
=
config
.
uniformConfig
.
uniformColor
;
int
humanDetectionLen
=
config
.
uniformConfig
.
humanDetectionLen
;
int
humanDetectionLen
=
config
.
uniformConfig
.
humanDetectionLen
;
int
licensePlateLen
=
config
.
licensePlateConfig
.
licensePlateLen
;
int
licensePlateLen
=
config
.
licensePlateConfig
.
licensePlateLen
;
...
@@ -80,8 +62,7 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -80,8 +62,7 @@ MainWindow::MainWindow():isResetting(false)
algorithmTaskManage
.
initialize
(
humanDetectionLen
,
licensePlateLen
,
faceLen
,
true
,
0x00
);
algorithmTaskManage
.
initialize
(
humanDetectionLen
,
licensePlateLen
,
faceLen
,
true
,
0x00
);
algorithmTaskManage
.
initHumanDetectionManage
(
modelPaths
,
carShapeConfidence
,
uniformColor
);
algorithmTaskManage
.
initHumanDetectionManage
(
modelPaths
,
carShapeConfidence
,
uniformColor
);
algorithmTaskManage
.
initLicensePlateManage
(
modelPaths
,
is_high
,
maxNum
,
algorithmTaskManage
.
initLicensePlateManage
(
modelPaths
,
is_high
,
maxNum
,
useHalf
,
boxThreshold
,
nmsThreshold
,
recThreshold
useHalf
,
boxThreshold
,
nmsThreshold
,
recThreshold
);
);
MediaFaceImage
*
mediaFaceImage
=
MediaFaceImage
::
getInstance
();
MediaFaceImage
*
mediaFaceImage
=
MediaFaceImage
::
getInstance
();
QString
configPath
=
qSetting
->
value
(
"devices/sz_config_path"
).
toString
();
QString
configPath
=
qSetting
->
value
(
"devices/sz_config_path"
).
toString
();
...
@@ -92,6 +73,14 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -92,6 +73,14 @@ MainWindow::MainWindow():isResetting(false)
qInfo
()
<<
"sdk初始化失败"
;
qInfo
()
<<
"sdk初始化失败"
;
return
;
return
;
}
}
if
(
!
NET_DVR_Init
())
{
qInfo
()
<<
"初始化海康 SDK 失败!"
;
return
;
}
this
->
hk_Device
=-
1
;
this
->
nvr_status
=
config
.
nvrConfig
.
isOn
;
connect
(
this
,
SIGNAL
(
shutdownSignals
(
QString
,
int
)),
this
,
SLOT
(
clearHandle
(
QString
,
int
)),
Qt
::
QueuedConnection
);
connect
(
this
,
SIGNAL
(
shutdownSignals
(
QString
,
int
)),
this
,
SLOT
(
clearHandle
(
QString
,
int
)),
Qt
::
QueuedConnection
);
...
@@ -102,7 +91,9 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -102,7 +91,9 @@ MainWindow::MainWindow():isResetting(false)
},
Qt
::
QueuedConnection
);
},
Qt
::
QueuedConnection
);
this
->
startCamera
(
httpurl
);
this
->
startCamera
(
httpurl
);
QString
sign_Key
=
qSetting
->
value
(
"cloudservice/signKey"
,
"sign_key"
).
toString
();
HttpService
::
setSingKey
(
sign_Key
);
float
confidence
=
config
.
faceConfig
.
confidence
;
float
confidence
=
config
.
faceConfig
.
confidence
;
int
faceNumbers
=
config
.
faceConfig
.
faceNumbers
;
int
faceNumbers
=
config
.
faceConfig
.
faceNumbers
;
...
@@ -113,9 +104,6 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -113,9 +104,6 @@ MainWindow::MainWindow():isResetting(false)
// 启动定时器
// 启动定时器
dePermissionSynTimer
->
start
();
dePermissionSynTimer
->
start
();
//dePermissionSynTimer->start(dePermissionTimer);
//vides_data::scanWiFiNetworks();
connect
(
&
server
,
&
QTcpServer
::
newConnection
,
this
,
&
MainWindow
::
handleMatNewConnection
);
connect
(
&
server
,
&
QTcpServer
::
newConnection
,
this
,
&
MainWindow
::
handleMatNewConnection
);
...
@@ -133,12 +121,73 @@ MainWindow::MainWindow():isResetting(false)
...
@@ -133,12 +121,73 @@ MainWindow::MainWindow():isResetting(false)
this
->
mqttConfig
=
config
.
mqttConfig
;
this
->
mqttConfig
=
config
.
mqttConfig
;
runOrRebootMqtt
(
mqttConfig
,
httpurl
,
serialNumber
);
runOrRebootMqtt
(
mqttConfig
,
httpurl
,
serialNumber
);
}
}
void
MainWindow
::
realTimeUpdateDivConfig
(
QString
&
httpurl
,
QString
&
serialNumber
){
Common
&
instace
=
Common
::
getInstance
();
findLocalSerialNumber
(
serialNumber
);
bool
configFetched
=
false
;
while
(
!
configFetched
)
{
HttpService
httpService
(
httpurl
);
vides_data
::
response
*
res
=
httpService
.
httpDeviceConfig
(
serialNumber
,
config
);
if
(
res
->
code
!=
0
)
{
qInfo
()
<<
"请求远程商户配置失败,重试中..."
;
instace
.
deleteObj
(
res
);
QThread
::
sleep
(
5
);
// 等待5秒后重试
}
else
{
instace
.
deleteObj
(
res
);
configFetched
=
true
;
}
}
}
void
MainWindow
::
runOrRebootMqtt
(
vides_data
::
MqttConfig
&
mqtt_config
,
QString
&
httpUrl
,
QString
&
serialNumber
){
void
MainWindow
::
runOrRebootMqtt
(
vides_data
::
MqttConfig
&
mqtt_config
,
QString
&
httpUrl
,
QString
&
serialNumber
){
MqttSubscriber
*
subscriber
=
MqttSubscriber
::
getInstance
(
this
);
MqttSubscriber
*
subscriber
=
MqttSubscriber
::
getInstance
(
this
);
subscriber
->
init
(
mqtt_config
,
httpUrl
,
serialNumber
);
subscriber
->
init
(
mqtt_config
,
httpUrl
,
serialNumber
);
subscriber
->
start
();
subscriber
->
start
();
}
}
int
MainWindow
::
loginNetDvr
(
QString
ip
,
QString
userName
,
QString
passWord
,
uint16_t
port
){
if
(
hk_Device
<
0
){
NET_DVR_USER_LOGIN_INFO
struLoginInfo
=
{
0
};
NET_DVR_DEVICEINFO_V40
struDeviceInfoV40
=
{
0
};
struLoginInfo
.
bUseAsynLogin
=
FALSE
;
int
lUserID
=
-
1
;
struLoginInfo
.
wPort
=
8000
;
QByteArray
bIp
=
ip
.
toUtf8
();
char
*
cDevid
=
bIp
.
data
();
memcpy
(
struLoginInfo
.
sDeviceAddress
,
cDevid
,
129
);
QByteArray
byteName
=
userName
.
toUtf8
();
char
*
cName
=
byteName
.
data
();
memcpy
(
struLoginInfo
.
sUserName
,
cName
,
64
);
QByteArray
bytePassword
=
passWord
.
toUtf8
();
char
*
cPassword
=
bytePassword
.
data
();
memcpy
(
struLoginInfo
.
sPassword
,
cPassword
,
64
);
// 打印 NET_DVR_USER_LOGIN_INFO 的内容
lUserID
=
NET_DVR_Login_V40
(
&
struLoginInfo
,
&
struDeviceInfoV40
);
if
(
lUserID
<
0
)
{
qInfo
()
<<
QString
(
"登录设备失败,错误编码:%1"
).
arg
(
NET_DVR_GetLastError
());
return
lUserID
;
}
this
->
hk_Device
=
lUserID
;
return
lUserID
;
}
}
bool
MainWindow
::
getDeviceStatus
(
int
UserId
)
{
if
(
UserId
<
0
)
return
false
;
bool
devStatus
=
NET_DVR_RemoteControl
(
UserId
,
NET_DVR_CHECK_USER_STATUS
,
nullptr
,
0
);
if
(
devStatus
)
{
qInfo
()
<<
"NET_DVR_RemoteControl 设备在线"
;
}
else
{
qInfo
()
<<
"NET_DVR_RemoteControl 设备不在线"
;
}
return
devStatus
;
}
void
MainWindow
::
divParameterUpdate
(
vides_data
::
responseConfig
&
cloudConfig
,
QString
&
httpUrl
,
QString
&
serialNumber
){
void
MainWindow
::
divParameterUpdate
(
vides_data
::
responseConfig
&
cloudConfig
,
QString
&
httpUrl
,
QString
&
serialNumber
){
bool
faceAlgorithm
=
false
,
licensePlateAlgorithm
=
false
,
uniformAlgorithm
=
false
,
timeChange
=
false
;
bool
faceAlgorithm
=
false
,
licensePlateAlgorithm
=
false
,
uniformAlgorithm
=
false
,
timeChange
=
false
;
AlgorithmTaskManage
&
algorithmTaskManage
=
AlgorithmTaskManage
::
getInstance
();
AlgorithmTaskManage
&
algorithmTaskManage
=
AlgorithmTaskManage
::
getInstance
();
...
@@ -502,6 +551,7 @@ void MainWindow::clearOfflineCameraHandle(QString sDevId, int nDevPort) {
...
@@ -502,6 +551,7 @@ void MainWindow::clearOfflineCameraHandle(QString sDevId, int nDevPort) {
void
MainWindow
::
setIsResetting
(
bool
running
)
{
void
MainWindow
::
setIsResetting
(
bool
running
)
{
this
->
isResetting
.
store
(
running
,
std
::
memory_order_release
);
this
->
isResetting
.
store
(
running
,
std
::
memory_order_release
);
}
}
//平台没有 盒子有 盒子关闭
//平台没有 盒子有 盒子关闭
void
MainWindow
::
startCamera
(
const
QString
&
httpurl
){
void
MainWindow
::
startCamera
(
const
QString
&
httpurl
){
if
(
this
->
isResetting
.
load
(
std
::
memory_order_acquire
)){
if
(
this
->
isResetting
.
load
(
std
::
memory_order_acquire
)){
...
@@ -530,6 +580,8 @@ void MainWindow::startCamera(const QString &httpurl){
...
@@ -530,6 +580,8 @@ void MainWindow::startCamera(const QString &httpurl){
reStatus
.
mac
=
std
::
move
(
is_mac
);
reStatus
.
mac
=
std
::
move
(
is_mac
);
HttpService
httpService
(
httpurl
);
HttpService
httpService
(
httpurl
);
vides_data
::
response
*
re
=
httpService
.
httpFindCameras
(
serialNumber
,
devices
);
vides_data
::
response
*
re
=
httpService
.
httpFindCameras
(
serialNumber
,
devices
);
if
(
re
->
code
==
0
||
re
->
code
==
20004
){
if
(
re
->
code
==
0
||
re
->
code
==
20004
){
//本次搜索到设备列表
//本次搜索到设备列表
std
::
map
<
QString
,
vides_data
::
localDeviceStatus
*>
localDevices
;
std
::
map
<
QString
,
vides_data
::
localDeviceStatus
*>
localDevices
;
...
@@ -553,6 +605,22 @@ void MainWindow::startCamera(const QString &httpurl){
...
@@ -553,6 +605,22 @@ void MainWindow::startCamera(const QString &httpurl){
instace
.
deleteObj
(
res_config
);
instace
.
deleteObj
(
res_config
);
return
;
return
;
}
}
config
.
nvrConfig
=
cloudConfig
.
nvrConfig
;
if
(
config
.
nvrConfig
.
isOn
&&
!
getDeviceStatus
(
hk_Device
)
){
int
res
=
loginNetDvr
(
config
.
nvrConfig
.
ip
,
config
.
nvrConfig
.
username
,
config
.
nvrConfig
.
password
,
config
.
nvrConfig
.
port
);
if
(
res
<
0
){
nvr_status
=
false
;
}
else
{
nvr_status
=
true
;
}
}
else
if
(
!
config
.
nvrConfig
.
isOn
){
nvr_status
=
false
;
}
else
if
(
config
.
nvrConfig
.
isOn
&&
getDeviceStatus
(
hk_Device
)){
nvr_status
=
true
;
}
instace
.
deleteObj
(
res_config
);
instace
.
deleteObj
(
res_config
);
divParameterUpdate
(
cloudConfig
,
nonConstHttpUrl
,
serialNumber
);
divParameterUpdate
(
cloudConfig
,
nonConstHttpUrl
,
serialNumber
);
...
@@ -609,6 +677,8 @@ void MainWindow::startCamera(const QString &httpurl){
...
@@ -609,6 +677,8 @@ void MainWindow::startCamera(const QString &httpurl){
offlineCameraHandle
->
findFirmwareVersion
(
camera_info
.
firmware_version
);
offlineCameraHandle
->
findFirmwareVersion
(
camera_info
.
firmware_version
);
camera_info
.
mac
=
localDevice
->
mac
;
camera_info
.
mac
=
localDevice
->
mac
;
reStatus
.
camera_info_list
.
push_front
(
camera_info
);
reStatus
.
camera_info_list
.
push_front
(
camera_info
);
offlineCameraHandle
->
setHkDevice
(
nvr_status
,
hk_Device
);
qInfo
()
<<
QString
(
"offlineCameraHandle->setHkDevice:%1,%2"
).
arg
(
nvr_status
).
arg
(
hk_Device
);
HttpService
http_gb28181
(
httpurl
);
HttpService
http_gb28181
(
httpurl
);
vides_data
::
response
*
res
=
http_gb28181
.
httpFindGb28181Config
(
camera_info
.
sSn
);
vides_data
::
response
*
res
=
http_gb28181
.
httpFindGb28181Config
(
camera_info
.
sSn
);
...
@@ -656,8 +726,6 @@ void MainWindow::startCamera(const QString &httpurl){
...
@@ -656,8 +726,6 @@ void MainWindow::startCamera(const QString &httpurl){
}
}
instace
.
deleteObj
(
res
);
instace
.
deleteObj
(
res
);
updateLocalFace
(
httpurl
);
updateLocalFace
(
httpurl
);
instace
.
deleteObj
(
re
);
instace
.
deleteObj
(
re
);
...
@@ -756,7 +824,6 @@ void MainWindow::initEncodeToString(QString &enCodeJson) {
...
@@ -756,7 +824,6 @@ void MainWindow::initEncodeToString(QString &enCodeJson) {
// 添加 ExtraFormat 到 JSON 对象中
// 添加 ExtraFormat 到 JSON 对象中
QJsonObject
extraFormatObject
;
QJsonObject
extraFormatObject
;
QJsonObject
videoObjectExtra
=
{
QJsonObject
videoObjectExtra
=
{
// {"BitRate", qSetting->value("ExtraFormat/Video.BitRate").toInt()},
{
"BitRateControl"
,
qSetting
->
value
(
"ExtraFormat/Video.BitRateControl"
).
toString
()},
{
"BitRateControl"
,
qSetting
->
value
(
"ExtraFormat/Video.BitRateControl"
).
toString
()},
{
"Compression"
,
qSetting
->
value
(
"ExtraFormat/Video.Compression"
).
toString
()},
{
"Compression"
,
qSetting
->
value
(
"ExtraFormat/Video.Compression"
).
toString
()},
{
"FPS"
,
qSetting
->
value
(
"ExtraFormat/Video.FPS"
).
toInt
()},
{
"FPS"
,
qSetting
->
value
(
"ExtraFormat/Video.FPS"
).
toInt
()},
...
@@ -773,7 +840,6 @@ void MainWindow::initEncodeToString(QString &enCodeJson) {
...
@@ -773,7 +840,6 @@ void MainWindow::initEncodeToString(QString &enCodeJson) {
// 添加 MainFormat 到 JSON 对象中
// 添加 MainFormat 到 JSON 对象中
QJsonObject
mainFormatObject
;
QJsonObject
mainFormatObject
;
QJsonObject
videoObjectMain
=
{
QJsonObject
videoObjectMain
=
{
// {"BitRate", qSetting->value("MainFormat/Video.BitRate").toInt()},
{
"BitRateControl"
,
qSetting
->
value
(
"MainFormat/Video.BitRateControl"
).
toString
()},
{
"BitRateControl"
,
qSetting
->
value
(
"MainFormat/Video.BitRateControl"
).
toString
()},
{
"Compression"
,
qSetting
->
value
(
"MainFormat/Video.Compression"
).
toString
()},
{
"Compression"
,
qSetting
->
value
(
"MainFormat/Video.Compression"
).
toString
()},
{
"FPS"
,
qSetting
->
value
(
"MainFormat/Video.FPS"
).
toInt
()},
{
"FPS"
,
qSetting
->
value
(
"MainFormat/Video.FPS"
).
toInt
()},
...
@@ -1056,7 +1122,7 @@ void MainWindow::initCameras(vides_data::cameraParameters ¶meter,vides_data:
...
@@ -1056,7 +1122,7 @@ void MainWindow::initCameras(vides_data::cameraParameters ¶meter,vides_data:
CameraHandle
*
cameraHandle
=
new
CameraHandle
(
parameter
.
sDevId
,
parameter
.
httpUrl
,
parameter
.
sSn
,
parameter
.
channel
,
image_save
,
heightReference
,
devConfig
);
CameraHandle
*
cameraHandle
=
new
CameraHandle
(
parameter
.
sDevId
,
parameter
.
httpUrl
,
parameter
.
sSn
,
parameter
.
channel
,
image_save
,
heightReference
,
devConfig
);
int
sdk_handle
=
cameraHandle
->
sdkDevLoginSyn
(
parameter
.
sDevId
,
parameter
.
nDevPort
,
parameter
.
sUserName
,
parameter
.
sPassword
,
3000
);
int
sdk_handle
=
cameraHandle
->
sdkDevLoginSyn
(
parameter
.
sDevId
,
parameter
.
nDevPort
,
parameter
.
sUserName
,
parameter
.
sPassword
,
3000
);
q
Debug
()
<<
QString
(
"SN(%1): 句柄为%2"
).
arg
(
parameter
.
sSn
).
arg
(
sdk_handle
);
q
Info
()
<<
QString
(
"SN(%1): 句柄为%2"
).
arg
(
parameter
.
sSn
).
arg
(
sdk_handle
);
if
(
sdk_handle
<=
0
){
if
(
sdk_handle
<=
0
){
qInfo
()
<<
QString
(
"SN(%1): 登录失败"
).
arg
(
parameter
.
sSn
);
qInfo
()
<<
QString
(
"SN(%1): 登录失败"
).
arg
(
parameter
.
sSn
);
...
@@ -1064,12 +1130,10 @@ void MainWindow::initCameras(vides_data::cameraParameters ¶meter,vides_data:
...
@@ -1064,12 +1130,10 @@ void MainWindow::initCameras(vides_data::cameraParameters ¶meter,vides_data:
}
}
mediaFaceImage
->
setMap
(
sdk_handle
,
cameraHandle
);
mediaFaceImage
->
setMap
(
sdk_handle
,
cameraHandle
);
initDevConfigSyn
(
cameraHandle
,
devConfig
);
initDevConfigSyn
(
cameraHandle
,
devConfig
);
cameraHandle
->
sdkDevSetAlarmListener
(
sdk_handle
,
0
);
cameraHandle
->
sdkDevSetAlarmListener
(
sdk_handle
,
0
);
qInfo
()
<<
QString
(
"initCameras->setHkDevice:%1,%2"
).
arg
(
nvr_status
).
arg
(
hk_Device
);
cameraHandle
->
setHkDevice
(
nvr_status
,
hk_Device
);
int
synTime
=
devConfig
.
camera
.
devSnapSynTimer
;
int
synTime
=
devConfig
.
camera
.
devSnapSynTimer
;
uint64
face_frequency
=
devConfig
.
humanConfig
.
faceFrequency
;
uint64
face_frequency
=
devConfig
.
humanConfig
.
faceFrequency
;
float
carConfidenceMax
=
devConfig
.
licensePlateConfig
.
carConfidenceMax
;
float
carConfidenceMax
=
devConfig
.
licensePlateConfig
.
carConfidenceMax
;
...
@@ -1078,9 +1142,6 @@ void MainWindow::initCameras(vides_data::cameraParameters ¶meter,vides_data:
...
@@ -1078,9 +1142,6 @@ void MainWindow::initCameras(vides_data::cameraParameters ¶meter,vides_data:
cameraHandle
->
initSdkRealTimeDevSnapSyn
(
synTime
,
face_frequency
);
cameraHandle
->
initSdkRealTimeDevSnapSyn
(
synTime
,
face_frequency
);
cameraHandle
->
setCarConfidenceMaxAndMin
(
carConfidenceMax
,
carConfidenceMin
);
cameraHandle
->
setCarConfidenceMaxAndMin
(
carConfidenceMax
,
carConfidenceMin
);
// QString pwd="admin2024";
// QString sid="MERCURY_8C4F";
// cameraHandle->sdkWifi(pwd,sid);
vides_data
::
requestCameraInfo
camera_info
;
vides_data
::
requestCameraInfo
camera_info
;
camera_info
.
sSn
=
parameter
.
sSn
;
camera_info
.
sSn
=
parameter
.
sSn
;
camera_info
.
ip_addr
=
parameter
.
sDevId
;
camera_info
.
ip_addr
=
parameter
.
sDevId
;
...
@@ -1106,13 +1167,6 @@ void MainWindow::initCameras(vides_data::cameraParameters ¶meter,vides_data:
...
@@ -1106,13 +1167,6 @@ void MainWindow::initCameras(vides_data::cameraParameters ¶meter,vides_data:
return
;
return
;
}
}
vides_data
::
responseGb28181
*
gb281
=
reinterpret_cast
<
vides_data
::
responseGb28181
*>
(
res
->
data
);
vides_data
::
responseGb28181
*
gb281
=
reinterpret_cast
<
vides_data
::
responseGb28181
*>
(
res
->
data
);
// QString stGb281;
// bool re= iniWorkSpVMn(gb281,stGb281,parameter.sSn);
// if(!re){
// QByteArray bGb =stGb281.toUtf8();
// const char* cGb=bGb.data();
// cameraHandle->sdkDevSpvMn(cGb);
// }
cameraHandle
->
updateSdkDevSpvMn
(
gb281
);
cameraHandle
->
updateSdkDevSpvMn
(
gb281
);
instace
.
deleteObj
(
gb281
);
instace
.
deleteObj
(
gb281
);
instace
.
deleteObj
(
res
);
instace
.
deleteObj
(
res
);
...
@@ -1170,8 +1224,10 @@ MainWindow::~MainWindow()
...
@@ -1170,8 +1224,10 @@ MainWindow::~MainWindow()
// 清空 handleMap
// 清空 handleMap
faceDetectionParkingPushs
.
clear
();
faceDetectionParkingPushs
.
clear
();
LogHandler
::
Get
().
uninstallMessageHandler
();
NET_DVR_Logout
(
hk_Device
);
// 注销登录
NET_DVR_Cleanup
();
LogHandler
::
Get
().
uninstallMessageHandler
();
}
}
void
MainWindow
::
deleteLogFile
(){
void
MainWindow
::
deleteLogFile
(){
...
...
mainwindow.h
View file @
b6009d23
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include "MediaFaceImage.h"
#include "MediaFaceImage.h"
#include "AlgorithmTaskManage.h"
#include "AlgorithmTaskManage.h"
#include "MqttSubscriber.h"
#include "MqttSubscriber.h"
#include "HCNetSDK.h"
#include <algorithm>
#include <algorithm>
#include <QString>
#include <QString>
#include <QTextCodec>
#include <QTextCodec>
...
@@ -52,6 +53,10 @@ public:
...
@@ -52,6 +53,10 @@ public:
CameraHandle
*
findHandle
(
QString
sn
);
CameraHandle
*
findHandle
(
QString
sn
);
void
realTimeUpdateDivConfig
(
QString
&
httpurl
,
QString
&
serialNumber
);
bool
getDeviceStatus
(
int
UserId
);
void
modifySnMapIp
(
QString
&
sn
,
QString
&
ip
);
void
modifySnMapIp
(
QString
&
sn
,
QString
&
ip
);
void
findSnMapIp
(
QString
&
sn
,
QString
&
ip
);
void
findSnMapIp
(
QString
&
sn
,
QString
&
ip
);
...
@@ -86,6 +91,7 @@ public:
...
@@ -86,6 +91,7 @@ public:
void
setIsResetting
(
bool
running
);
void
setIsResetting
(
bool
running
);
int
loginNetDvr
(
QString
ip
,
QString
userName
,
QString
passWord
,
uint16_t
port
);
~
MainWindow
();
~
MainWindow
();
signals
:
signals
:
...
@@ -127,5 +133,9 @@ private:
...
@@ -127,5 +133,9 @@ private:
std
::
atomic
<
bool
>
isResetting
;
std
::
atomic
<
bool
>
isResetting
;
int
hk_Device
;
bool
nvr_status
;
};
};
#endif // MAINWINDOW_H
#endif // MAINWINDOW_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment