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
1
Merge Requests
1
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
ac65e986
Commit
ac65e986
authored
Feb 20, 2025
by
guof
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-1007583' into 'release'
Feature 1007583 See merge request
!101
parents
aeaaee10
b2896bb0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
37 deletions
+8
-37
CameraHandle.cpp
+5
-10
mainwindow.cpp
+3
-27
No files found.
CameraHandle.cpp
View file @
ac65e986
...
...
@@ -218,7 +218,6 @@ int XNetSDK_MediaCallBack(XSDK_HANDLE hMedia, int nDataType, int nDataLen, int n
}
}
}
int
CameraHandle
::
sdkDevSetAlarmListener
(
XSDK_HANDLE
hDevice
,
int
bListener
)
{
return
XSDK_DevSetAlarmListener
(
hDevice
,
bListener
);
}
...
...
@@ -477,19 +476,15 @@ void CameraHandle::sdkDevSnapSyn(XSDK_HANDLE hDevice, int nChannel){
return
;
}
cv
::
Mat
image
;
MediaFaceImage
*
mediaFaceImage
=
MediaFaceImage
::
getInstance
();
MediaFaceImage
*
mediaFaceImage
=
MediaFaceImage
::
getInstance
();
qint64
currentTime
=
QDateTime
::
currentSecsSinceEpoch
();
int
ret
=-
1
;
if
(
sSn
!=
"9189806d008ac359"
&&
sSn
!=
"d92e8e4ff3912954"
){
ret
=
mediaFaceImage
->
FaceImageCallBack
(
hDevice
,
nChannel
,
image
,
sSn
);
}
if
(
ret
<
0
)
{
int
ret
=
mediaFaceImage
->
FaceImageCallBack
(
hDevice
,
nChannel
,
image
,
sSn
);
if
(
ret
<=
0
)
{
if
(
!
hk_status
){
if
(
threeConsecutiveImage
())
return
;
}
else
{
qInfo
()
<<
QString
(
"SN(%1): NVR=>hk_Device getIPChannelInfo:%2"
).
arg
(
sSn
).
arg
(
hk_Device
);
int
hk_channel
=
mediaFaceImage
->
getIPChannelInfo
(
hk_Device
,
QString
(
loginParam
->
sDevId
));
qInfo
()
<<
QString
(
"SN(%1): NVR=>hk_channel getIPChannelInfo:%2"
).
arg
(
sSn
).
arg
(
hk_channel
);
if
(
hk_channel
<
0
){
qInfo
()
<<
QString
(
"SN(%1): NVR=>sdkDevSnapSyn 通过IP获取到对应通道号失败"
).
arg
(
sSn
);
return
;
...
...
@@ -525,6 +520,7 @@ void CameraHandle::matToBase64(const cv::Mat &image, QByteArray &base64Data) {
cv
::
imencode
(
".jpg"
,
image
,
buffer
,
params
);
base64Data
=
QByteArray
(
reinterpret_cast
<
const
char
*>
(
buffer
.
data
()),
buffer
.
size
()).
toBase64
();
}
void
CameraHandle
::
checkAndUpdateCurrentPlate
(
ParkingSpaceInfo
*
park
,
const
cv
::
Mat
&
frame
,
RecognizedInfo
&
newInfo
,
int
&
result
){
if
(
newInfo
.
getLicensePlate
()
!=
park
->
getCurrentPlate
().
getLicensePlate
())
{
...
...
@@ -801,7 +797,6 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
if
(
image_save
==
1
){
QString
fileName
=
instace
.
getVideoOut
().
append
(
instace
.
getTimeString
()
+
".jpg"
);
bool
success
=
cv
::
imwrite
(
fileName
.
toStdString
(),
frame
);
if
(
success
)
{
qInfo
()
<<
"图片已成功保存至:"
<<
fileName
;
}
else
{
...
...
mainwindow.cpp
View file @
ac65e986
...
...
@@ -39,10 +39,8 @@ MainWindow::MainWindow():isResetting(false)
int
deleteLogfileTimer
=
config
.
timerSettings
.
deleteLogFileTimer
;
deleteLogFileTimer
->
start
(
deleteLogfileTimer
);
initFaceFaceRecognition
();
QString
uniformColor
=
config
.
uniformConfig
.
uniformColor
;
int
humanDetectionLen
=
config
.
uniformConfig
.
humanDetectionLen
;
...
...
@@ -64,8 +62,7 @@ MainWindow::MainWindow():isResetting(false)
algorithmTaskManage
.
initialize
(
humanDetectionLen
,
licensePlateLen
,
faceLen
,
true
,
0x00
);
algorithmTaskManage
.
initHumanDetectionManage
(
modelPaths
,
carShapeConfidence
,
uniformColor
);
algorithmTaskManage
.
initLicensePlateManage
(
modelPaths
,
is_high
,
maxNum
,
useHalf
,
boxThreshold
,
nmsThreshold
,
recThreshold
);
useHalf
,
boxThreshold
,
nmsThreshold
,
recThreshold
);
MediaFaceImage
*
mediaFaceImage
=
MediaFaceImage
::
getInstance
();
QString
configPath
=
qSetting
->
value
(
"devices/sz_config_path"
).
toString
();
...
...
@@ -76,7 +73,7 @@ MainWindow::MainWindow():isResetting(false)
qInfo
()
<<
"sdk初始化失败"
;
return
;
}
//QString ip,QString userName,QString passWord,uint16_t port
if
(
!
NET_DVR_Init
())
{
qInfo
()
<<
"初始化海康 SDK 失败!"
;
return
;
...
...
@@ -107,9 +104,6 @@ MainWindow::MainWindow():isResetting(false)
// 启动定时器
dePermissionSynTimer
->
start
();
//dePermissionSynTimer->start(dePermissionTimer);
//vides_data::scanWiFiNetworks();
connect
(
&
server
,
&
QTcpServer
::
newConnection
,
this
,
&
MainWindow
::
handleMatNewConnection
);
...
...
@@ -611,11 +605,8 @@ void MainWindow::startCamera(const QString &httpurl){
instace
.
deleteObj
(
res_config
);
return
;
}
qInfo
()
<<
"云端的nvr配置 isOn"
<<
cloudConfig
.
nvrConfig
.
isOn
<<
"ip"
<<
cloudConfig
.
nvrConfig
.
ip
<<
"username"
<<
cloudConfig
.
nvrConfig
.
username
<<
"pwd"
<<
cloudConfig
.
nvrConfig
.
password
;
config
.
nvrConfig
=
cloudConfig
.
nvrConfig
;
qInfo
()
<<
"修改过后nvr配置 isOn"
<<
config
.
nvrConfig
.
isOn
<<
"ip"
<<
config
.
nvrConfig
.
ip
<<
"username"
<<
config
.
nvrConfig
.
username
<<
"pwd"
<<
config
.
nvrConfig
.
password
;
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
){
...
...
@@ -630,7 +621,6 @@ void MainWindow::startCamera(const QString &httpurl){
nvr_status
=
true
;
}
instace
.
deleteObj
(
res_config
);
divParameterUpdate
(
cloudConfig
,
nonConstHttpUrl
,
serialNumber
);
...
...
@@ -736,8 +726,6 @@ void MainWindow::startCamera(const QString &httpurl){
}
instace
.
deleteObj
(
res
);
updateLocalFace
(
httpurl
);
instace
.
deleteObj
(
re
);
...
...
@@ -836,7 +824,6 @@ void MainWindow::initEncodeToString(QString &enCodeJson) {
// 添加 ExtraFormat 到 JSON 对象中
QJsonObject
extraFormatObject
;
QJsonObject
videoObjectExtra
=
{
// {"BitRate", qSetting->value("ExtraFormat/Video.BitRate").toInt()},
{
"BitRateControl"
,
qSetting
->
value
(
"ExtraFormat/Video.BitRateControl"
).
toString
()},
{
"Compression"
,
qSetting
->
value
(
"ExtraFormat/Video.Compression"
).
toString
()},
{
"FPS"
,
qSetting
->
value
(
"ExtraFormat/Video.FPS"
).
toInt
()},
...
...
@@ -853,7 +840,6 @@ void MainWindow::initEncodeToString(QString &enCodeJson) {
// 添加 MainFormat 到 JSON 对象中
QJsonObject
mainFormatObject
;
QJsonObject
videoObjectMain
=
{
// {"BitRate", qSetting->value("MainFormat/Video.BitRate").toInt()},
{
"BitRateControl"
,
qSetting
->
value
(
"MainFormat/Video.BitRateControl"
).
toString
()},
{
"Compression"
,
qSetting
->
value
(
"MainFormat/Video.Compression"
).
toString
()},
{
"FPS"
,
qSetting
->
value
(
"MainFormat/Video.FPS"
).
toInt
()},
...
...
@@ -1156,9 +1142,6 @@ void MainWindow::initCameras(vides_data::cameraParameters ¶meter,vides_data:
cameraHandle
->
initSdkRealTimeDevSnapSyn
(
synTime
,
face_frequency
);
cameraHandle
->
setCarConfidenceMaxAndMin
(
carConfidenceMax
,
carConfidenceMin
);
// QString pwd="admin2024";
// QString sid="MERCURY_8C4F";
// cameraHandle->sdkWifi(pwd,sid);
vides_data
::
requestCameraInfo
camera_info
;
camera_info
.
sSn
=
parameter
.
sSn
;
camera_info
.
ip_addr
=
parameter
.
sDevId
;
...
...
@@ -1184,13 +1167,6 @@ void MainWindow::initCameras(vides_data::cameraParameters ¶meter,vides_data:
return
;
}
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
);
instace
.
deleteObj
(
gb281
);
instace
.
deleteObj
(
res
);
...
...
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