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
af92429f
Commit
af92429f
authored
Apr 17, 2024
by
“liusq”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
车牌大于最大匹配度进场
parent
38d74e8b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
46 deletions
+44
-46
CameraHandle.cpp
+6
-8
HumanDetection.cpp
+1
-1
gamera_videos.pro
+37
-37
No files found.
CameraHandle.cpp
View file @
af92429f
...
@@ -20,8 +20,8 @@ CameraHandle::CameraHandle(QString &url, QString &httpUrl, QString &sSn, int &ch
...
@@ -20,8 +20,8 @@ CameraHandle::CameraHandle(QString &url, QString &httpUrl, QString &sSn, int &ch
connect
(
this
,
SIGNAL
(
afterDownloadFile
(
int
,
int
,
QString
)),
this
,
SLOT
(
pushRecordToCloud
(
int
,
int
,
QString
)),
Qt
::
QueuedConnection
);
connect
(
this
,
SIGNAL
(
afterDownloadFile
(
int
,
int
,
QString
)),
this
,
SLOT
(
pushRecordToCloud
(
int
,
int
,
QString
)),
Qt
::
QueuedConnection
);
detector
=
TCV_CreateHumanDetector
();
detector
=
TCV_CreateHumanDetector
();
// 设置检测得分阈值 默认0.5
// 设置检测得分阈值 默认0.5
TCV_HumanDetectorSetHumanThreshold
(
detector
,
0.5
f
);
//
TCV_HumanDetectorSetHumanThreshold(detector,0.5f);
TCV_HumanDetectorSetCarThreshold
(
detector
,
0.2
f
);
//
TCV_HumanDetectorSetCarThreshold(detector,0.2f);
HLPR_ContextConfiguration
configuration
=
{
0
};
HLPR_ContextConfiguration
configuration
=
{
0
};
QByteArray
&&
by_mpath
=
modelPaths
.
toUtf8
();
QByteArray
&&
by_mpath
=
modelPaths
.
toUtf8
();
...
@@ -558,7 +558,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
...
@@ -558,7 +558,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
std
::
map
<
int
,
RecognizedInfo
>
exitMoMap
;
std
::
map
<
int
,
RecognizedInfo
>
exitMoMap
;
vides_data
::
requestLicensePlate
newPlate
;
vides_data
::
requestLicensePlate
newPlate
;
newPlate
.
sn
=
sSn
;
newPlate
.
sn
=
sSn
;
qDebug
()
<<
QString
(
"sn==>%1,识别的车牌
号
是:%2"
).
arg
(
sSn
).
arg
(
lpNumber
);
qDebug
()
<<
QString
(
"sn==>%1,识别的车牌
信息
是:%2"
).
arg
(
sSn
).
arg
(
lpNumber
);
std
::
list
<
vides_data
::
LicensePlate
>
ps
=
plate
.
plates
;
std
::
list
<
vides_data
::
LicensePlate
>
ps
=
plate
.
plates
;
int
res
=-
1
;
int
res
=-
1
;
this
->
matToBase64
(
frame
,
imgs
);
this
->
matToBase64
(
frame
,
imgs
);
...
@@ -588,7 +588,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
...
@@ -588,7 +588,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
ParkingSpaceInfo
newcurrentPlate
;
ParkingSpaceInfo
newcurrentPlate
;
newcurrentPlate
.
setArea
(
currentPlate
.
recognition
);
newcurrentPlate
.
setArea
(
currentPlate
.
recognition
);
int
index
=
this
->
findPointRegion
(
newcurrentPlate
);
int
index
=
this
->
findPointRegion
(
newcurrentPlate
);
qDebug
()
<<
"
识别的区域:"
<<
index
;
qDebug
()
<<
sSn
<<
"==>
识别的区域:"
<<
index
;
indexToLicensePlate
[
index
]
=
currentPlate
;
indexToLicensePlate
[
index
]
=
currentPlate
;
}
}
for
(
auto
it
=
parkMap
.
begin
();
it
!=
parkMap
.
end
();
++
it
)
{
for
(
auto
it
=
parkMap
.
begin
();
it
!=
parkMap
.
end
();
++
it
)
{
...
@@ -612,6 +612,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
...
@@ -612,6 +612,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
value
->
removeQueue
();
value
->
removeQueue
();
}
}
}
for
(
int
var
=
0
;
var
<
3
;
++
var
)
{
for
(
int
var
=
0
;
var
<
3
;
++
var
)
{
RecognizedInfo
info
(
recognition
.
new_plate
,
recognition
.
time
,
recognition
.
new_color
);
RecognizedInfo
info
(
recognition
.
new_plate
,
recognition
.
time
,
recognition
.
new_color
);
value
->
addQueue
(
info
);
value
->
addQueue
(
info
);
...
@@ -619,10 +620,6 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
...
@@ -619,10 +620,6 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
}
}
this
->
checkAndUpdateCurrentPlate
(
value
,
frame
,
recognizedInfo
,
res
,
exitMoMap
);
this
->
checkAndUpdateCurrentPlate
(
value
,
frame
,
recognizedInfo
,
res
,
exitMoMap
);
}
}
}
qDebug
()
<<
sSn
<<
"==>识别的车牌置信度"
<<
recognition
.
text_confidence
;
qDebug
()
<<
sSn
<<
"==>最小车牌置信度"
<<
instace
.
getCarConfidenceMin
();
if
(
recognition
.
text_confidence
<=
instace
.
getCarConfidenceMin
()){
if
(
recognition
.
text_confidence
<=
instace
.
getCarConfidenceMin
()){
qDebug
()
<<
sSn
<<
"==>recognition.text_confidence<=instace.getCarConfidenceMin"
<<
instace
.
getCarConfidenceMin
();
qDebug
()
<<
sSn
<<
"==>recognition.text_confidence<=instace.getCarConfidenceMin"
<<
instace
.
getCarConfidenceMin
();
continue
;
continue
;
...
@@ -638,6 +635,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
...
@@ -638,6 +635,7 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
recognizedInfo
=
std
::
move
(
info
);
recognizedInfo
=
std
::
move
(
info
);
this
->
checkAndUpdateCurrentPlate
(
value
,
frame
,
recognizedInfo
,
res
,
exitMoMap
);
this
->
checkAndUpdateCurrentPlate
(
value
,
frame
,
recognizedInfo
,
res
,
exitMoMap
);
}
}
qDebug
()
<<
sSn
<<
"==>checkAndUpdateCurrentPlate结果是"
<<
res
;
if
(
res
==
Exit
||
res
==
Mobilization
)
{
if
(
res
==
Exit
||
res
==
Mobilization
)
{
recognition
.
areaLocation
=
value
->
getArea
();
recognition
.
areaLocation
=
value
->
getArea
();
...
...
HumanDetection.cpp
View file @
af92429f
...
@@ -15,7 +15,7 @@ int HumanDetection::findHuManCar(const cv::Mat &source,int res,TCV_HumanDetector
...
@@ -15,7 +15,7 @@ int HumanDetection::findHuManCar(const cv::Mat &source,int res,TCV_HumanDetector
// 执行一帧目标检测
// 执行一帧目标检测
TCV_HumanDetectorProcessFrame
(
detector
,
stream
);
TCV_HumanDetectorProcessFrame
(
detector
,
stream
);
int
num
=
(
res
==
0
)
?
TCV_HumanDetectorGetNumOfHuman
(
detector
)
:
TCV_HumanDetectorGetNumOfCar
(
detector
);
int
num
=
(
res
==
0
)
?
TCV_HumanDetectorGetNumOfHuman
(
detector
)
:
0
;
//
TCV_HumanDetectorGetNumOfCar(detector);
qDebug
()
<<
(
res
==
0
?
"Number of people detected:"
:
"Number of cars detected:"
)
<<
num
;
qDebug
()
<<
(
res
==
0
?
"Number of people detected:"
:
"Number of cars detected:"
)
<<
num
;
TCV_ReleaseCameraStream
(
stream
);
TCV_ReleaseCameraStream
(
stream
);
...
...
gamera_videos.pro
View file @
af92429f
...
@@ -13,43 +13,43 @@ TEMPLATE = app
...
@@ -13,43 +13,43 @@ TEMPLATE = app
DEFINES
+=
QT_DEPRECATED_WARNINGS
DEFINES
+=
QT_DEPRECATED_WARNINGS
QMAKE_LIBDIR
+=
/
usr
/
local
/
lib
#
QMAKE_LIBDIR += /usr/local/lib
INCLUDEPATH
+=/
usr
/
local
/
include
/
opencv4
#
INCLUDEPATH+=/usr/local/include/opencv4
INCLUDEPATH
+=/
usr
/
local
/
include
/
hyperface
#
INCLUDEPATH+=/usr/local/include/hyperface
INCLUDEPATH
+=/
usr
/
local
/
include
/
hyper
#
INCLUDEPATH+=/usr/local/include/hyper
INCLUDEPATH
+=/
usr
/
local
/
include
/
XNetSDK
#
INCLUDEPATH+=/usr/local/include/XNetSDK
INCLUDEPATH
+=/
usr
/
local
/
include
/
human
#
INCLUDEPATH+=/usr/local/include/human
#
unix:contains(QMAKE_HOST.arch, x86_64) {
unix
:
contains
(
QMAKE_HOST
.
arch
,
x86_64
)
{
#
QMAKE_LIBDIR += /home/mark/Public/x86_opencv/lib
QMAKE_LIBDIR
+=
/
home
/
mark
/
Public
/
x86_opencv
/
lib
#
}
}
#
unix:contains(QMAKE_HOST.arch, arm) {
unix
:
contains
(
QMAKE_HOST
.
arch
,
arm
)
{
#
QMAKE_LIBDIR += /usr/local/lib
QMAKE_LIBDIR
+=
/
usr
/
local
/
lib
#
}
}
#
#
根据编译器类型选择库路径和头文件路径
# 根据编译器类型选择库路径和头文件路径
#
unix: {
unix
:
{
#
# x86 架构
#
x86
架构
#
contains(QMAKE_HOST.arch, x86_64) {
contains
(
QMAKE_HOST
.
arch
,
x86_64
)
{
#
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/opencv4
INCLUDEPATH
+=/
home
/
mark
/
Public
/
x86_opencv
/
include
/
opencv4
#
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyperface
INCLUDEPATH
+=/
home
/
mark
/
Public
/
x86_opencv
/
include
/
hyperface
#
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/hyper
INCLUDEPATH
+=/
home
/
mark
/
Public
/
x86_opencv
/
include
/
hyper
#
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/XNetSDK
INCLUDEPATH
+=/
home
/
mark
/
Public
/
x86_opencv
/
include
/
XNetSDK
#
INCLUDEPATH+=/home/mark/Public/x86_opencv/include/human
INCLUDEPATH
+=/
home
/
mark
/
Public
/
x86_opencv
/
include
/
human
#
}
}
#
# ARM 架构
#
ARM
架构
#
contains(QMAKE_HOST.arch, arm) {
contains
(
QMAKE_HOST
.
arch
,
arm
)
{
#
INCLUDEPATH+=/usr/local/include/opencv4
INCLUDEPATH
+=/
usr
/
local
/
include
/
opencv4
#
INCLUDEPATH+=/usr/local/include/hyperface
INCLUDEPATH
+=/
usr
/
local
/
include
/
hyperface
#
INCLUDEPATH+=/usr/local/include/hyper
INCLUDEPATH
+=/
usr
/
local
/
include
/
hyper
#
INCLUDEPATH+=/usr/local/include/XNetSDK
INCLUDEPATH
+=/
usr
/
local
/
include
/
XNetSDK
#
INCLUDEPATH+=/usr/local/include/human
INCLUDEPATH
+=/
usr
/
local
/
include
/
human
#
}
}
#
}
}
# You can also make your code fail to compile if it uses deprecated APIs.
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# In order to do so, uncomment the following line.
...
...
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