Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
J
jfx_kalman_filter_src
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_kalman_filter_src
Commits
587f3fe9
Commit
587f3fe9
authored
Nov 03, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change param for points
parent
16e6aa83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Component.cpp
common/Component.cpp
+4
-4
Component.h
common/Component.h
+1
-1
No files found.
common/Component.cpp
View file @
587f3fe9
...
...
@@ -118,7 +118,7 @@ float calcIntersectionRate(cv::RotatedRect rect1, cv::RotatedRect rect2)
return
iou_2d
;
}
double
calculate_angle
(
std
::
vector
<
point2d
>&
points
)
double
calculate_angle
(
std
::
vector
<
std
::
vector
<
float
>
>&
points
)
{
if
(
points
.
size
()
<
5
)
return
0
;
...
...
@@ -126,8 +126,8 @@ double calculate_angle(std::vector<point2d>& points)
// 坐标 (1, 1), (2, 2), (3, 3)
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
X
(
i
,
0
)
=
points
[
i
]
.
x
;
X
(
i
,
1
)
=
points
[
i
]
.
y
;
X
(
i
,
0
)
=
points
[
i
]
[
0
]
;
X
(
i
,
1
)
=
points
[
i
]
[
1
]
;
}
Eigen
::
MatrixXd
X_copy
=
X
;
// 拷贝副本,因为X取均值后会被改变
Eigen
::
MatrixXd
C
(
2
,
2
);
// 方差
...
...
@@ -147,7 +147,7 @@ double calculate_angle(std::vector<point2d>& points)
//SDK_LOG(SDK_INFO, "val = [%f,%f]", val(0), val(1));
// 打印
//cout << "X_copy: " << endl << X_copy
Eigen
::
Vector2d
dX
(
points
[
4
]
.
x
-
points
[
0
].
x
,
points
[
4
].
y
-
points
[
0
].
y
);
Eigen
::
Vector2d
dX
(
points
[
4
]
[
0
]
-
points
[
0
][
0
],
points
[
4
][
1
]
-
points
[
0
][
1
]
);
Eigen
::
Vector2d
orientation
(
vec
(
1
,
0
),
vec
(
1
,
1
));
double
alpha
=
dX
.
transpose
()
*
orientation
;
if
(
alpha
<
0
)
...
...
common/Component.h
View file @
587f3fe9
...
...
@@ -20,4 +20,4 @@ double calcIntersectionArea(cv::RotatedRect rect1, cv::RotatedRect rect2);
float
calcIntersectionRate
(
cv
::
RotatedRect
rect1
,
cv
::
RotatedRect
rect2
);
double
calculate_angle
(
std
::
vector
<
point2d
>&
points
)
double
calculate_angle
(
std
::
vector
<
std
::
vector
<
float
>
>&
points
)
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