Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_vision_new
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oscar
jfx_vision_new
Commits
6a95a47a
Commit
6a95a47a
authored
Mar 31, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交更新
parent
421e66f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
Track2D.cpp
src/BaseTracker/Track2D.cpp
+21
-3
Track2D.h
src/BaseTracker/Track2D.h
+2
-0
track.h
src/track.h
+1
-0
No files found.
src/BaseTracker/Track2D.cpp
View file @
6a95a47a
...
...
@@ -45,9 +45,27 @@ Track2D::Track2D():BaseTrack(8, 4)
kf_
=
kf
;
}
void
Track2D
::
Init
(
const
std
::
vector
<
float
>&
data
)
{
if
(
data
.
size
()
!=
5
)
return
;
std
::
vector
<
float
>
tmp
(
data
.
begin
()
+
1
,
data
.
end
());
BaseTrack
::
Init
(
tmp
);
}
void
Track2D
::
Update
(
const
std
::
vector
<
float
>&
data
)
{
std
::
vector
<
float
>
out
(
data
.
begin
()
+
1
,
data
.
end
());
BaseTrack
::
Update
(
out
);
}
double
Track2D
::
CalculateIou
(
const
std
::
vector
<
float
>&
data
)
{
if
(
data
.
size
()
!=
5
)
return
0
;
int
input_type
=
data
[
0
];
int
obj_type
=
m_obj
.
type
;
if
(
input_type
!=
obj_type
)
return
0.0
f
;
std
::
vector
<
float
>
states
;
GetStateData
(
states
);
...
...
@@ -65,11 +83,11 @@ double Track2D::CalculateIou(const std::vector<float>& data)
//float union_area = det_area + trk_area - intersection_area;
//auto iou = intersection_area / union_area;
auto
w
=
std
::
max
(
std
::
min
((
states
[
0
]
+
states
[
2
]),
(
data
[
0
]
+
data
[
2
]))
-
std
::
max
(
states
[
0
],
data
[
0
]),
0.0
f
);
auto
h
=
std
::
max
(
std
::
min
((
states
[
1
]
+
states
[
3
]),
(
data
[
1
]
+
data
[
3
]))
-
std
::
max
(
states
[
1
],
data
[
1
]),
0.0
f
);
auto
w
=
std
::
max
(
std
::
min
((
states
[
0
]
+
states
[
2
]),
(
data
[
1
]
+
data
[
3
]))
-
std
::
max
(
states
[
0
],
data
[
1
]),
0.0
f
);
auto
h
=
std
::
max
(
std
::
min
((
states
[
1
]
+
states
[
3
]),
(
data
[
2
]
+
data
[
4
]))
-
std
::
max
(
states
[
1
],
data
[
2
]),
0.0
f
);
auto
intersection_area
=
w
*
h
;
float
union_area
=
states
[
2
]
*
states
[
3
]
+
data
[
2
]
*
data
[
3
]
-
intersection_area
;
float
union_area
=
states
[
2
]
*
states
[
3
]
+
data
[
3
]
*
data
[
4
]
-
intersection_area
;
auto
iou
=
intersection_area
/
union_area
;
return
iou
;
}
src/BaseTracker/Track2D.h
View file @
6a95a47a
...
...
@@ -19,6 +19,8 @@ public:
Track2D
();
~
Track2D
()
{}
virtual
void
Init
(
const
std
::
vector
<
float
>&
data
);
virtual
void
Update
(
const
std
::
vector
<
float
>&
data
);
//trackOjbPtr m_obj = nullptr;
virtual
int
GetIouDataOrder
(
std
::
vector
<
int
>&
order
)
{
return
0
;
};
...
...
src/track.h
View file @
6a95a47a
...
...
@@ -238,6 +238,7 @@ public:
std
::
vector
<
float
>
data
;
auto
width
=
static_cast
<
float
>
(
trackItem
.
detections
[
i
].
width
);
auto
height
=
static_cast
<
float
>
(
trackItem
.
detections
[
i
].
height
);
data
.
push_back
(
item
.
type
);
data
.
push_back
(
trackItem
.
detections
[
i
].
x
+
trackItem
.
detections
[
i
].
width
/
2
);
data
.
push_back
(
trackItem
.
detections
[
i
].
y
+
trackItem
.
detections
[
i
].
height
/
2
);
data
.
push_back
(
width
);
...
...
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