Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PeTrack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pedestrian Dynamics Empiricism
PeTrack
Commits
a1123b1d
Commit
a1123b1d
authored
1 year ago
by
ar.graf
Browse files
Options
Downloads
Patches
Plain Diff
Deleted unused class-member: camValues, distValues, isExtCalib
parent
57f3a783
No related branches found
No related tags found
1 merge request
!282
Deleted unused class-member: camValues, distValues, isExtCalib
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/extrCalibration.h
+1
-9
1 addition, 9 deletions
include/extrCalibration.h
src/extrCalibration.cpp
+20
-47
20 additions, 47 deletions
src/extrCalibration.cpp
with
21 additions
and
56 deletions
include/extrCalibration.h
+
1
−
9
View file @
a1123b1d
...
...
@@ -152,18 +152,10 @@ private:
std
::
vector
<
cv
::
Point3f
>
points3D
;
std
::
vector
<
cv
::
Point2f
>
points2D
;
double
*
rotation_matrix
;
double
*
translation_vector
;
double
*
translation_vector2
;
double
*
camValues
;
double
*
distValues
;
bool
isExtCalib
;
float
camHeight
;
float
camHeight
;
ReprojectionError
reprojectionError
;
QString
mExtrCalibFile
;
void
init
();
public:
ExtrCalibration
(
PersonStorage
&
storage
);
...
...
This diff is collapsed.
Click to expand it.
src/extrCalibration.cpp
+
20
−
47
View file @
a1123b1d
...
...
@@ -40,19 +40,8 @@ void ExtrCalibration::setMainWindow(Petrack *mw)
{
mMainWindow
=
mw
;
mControlWidget
=
mw
->
getControlWidget
();
init
();
}
void
ExtrCalibration
::
init
()
{
rotation_matrix
=
new
double
[
9
];
translation_vector
=
new
double
[
3
];
translation_vector2
=
new
double
[
3
];
camValues
=
new
double
[
9
];
distValues
=
new
double
[
8
];
isExtCalib
=
false
;
}
bool
ExtrCalibration
::
isEmptyExtrCalibFile
()
{
return
mExtrCalibFile
.
isEmpty
();
...
...
@@ -478,6 +467,8 @@ std::optional<ExtrinsicParameters> ExtrCalibration::calibExtrParams()
return
std
::
nullopt
;
}
cv
::
Vec3d
translation_vector2
{
0.
,
0.
,
0.
};
int
bS
=
mMainWindow
->
getImageBorderSize
();
/* Create Camera-Matrix form Camera-Params in the Petrack-GUI */
cv
::
Mat
camMat
=
mControlWidget
->
getIntrinsicCameraParams
().
cameraMatrix
;
...
...
@@ -500,48 +491,37 @@ std::optional<ExtrinsicParameters> ExtrCalibration::calibExtrParams()
// Transform the rotation vector into a rotation matrix with opencvs rodrigues method
Rodrigues
(
rvec
,
rot_mat
);
rotation_matrix
[
0
]
=
rot_mat
.
at
<
double
>
(
0
,
0
);
rotation_matrix
[
1
]
=
rot_mat
.
at
<
double
>
(
0
,
1
);
rotation_matrix
[
2
]
=
rot_mat
.
at
<
double
>
(
0
,
2
);
rotation_matrix
[
3
]
=
rot_mat
.
at
<
double
>
(
1
,
0
);
rotation_matrix
[
4
]
=
rot_mat
.
at
<
double
>
(
1
,
1
);
rotation_matrix
[
5
]
=
rot_mat
.
at
<
double
>
(
1
,
2
);
rotation_matrix
[
6
]
=
rot_mat
.
at
<
double
>
(
2
,
0
);
rotation_matrix
[
7
]
=
rot_mat
.
at
<
double
>
(
2
,
1
);
rotation_matrix
[
8
]
=
rot_mat
.
at
<
double
>
(
2
,
2
);
translation_vector
[
0
]
=
tvec
.
at
<
double
>
(
0
,
0
);
translation_vector
[
1
]
=
tvec
.
at
<
double
>
(
0
,
1
);
translation_vector
[
2
]
=
tvec
.
at
<
double
>
(
0
,
2
);
translation_vector2
[
0
]
=
rotation_matrix
[
0
]
*
translation_vector
[
0
]
+
rotation_matrix
[
3
]
*
translation_vector
[
1
]
+
rotation_matrix
[
6
]
*
translation_vector
[
2
];
translation_vector2
[
1
]
=
rotation_matrix
[
1
]
*
translation_vector
[
0
]
+
rotation_matrix
[
4
]
*
translation_vector
[
1
]
+
rotation_matrix
[
7
]
*
translation_vector
[
2
];
translation_vector2
[
2
]
=
rotation_matrix
[
2
]
*
translation_vector
[
0
]
+
rotation_matrix
[
5
]
*
translation_vector
[
1
]
+
rotation_matrix
[
8
]
*
translation_vector
[
2
];
//(inverse of rot_mat is its transposed) we want rot_inverse times tvec, which looks like
translation_vector2
[
0
]
=
rot_mat
.
at
<
double
>
(
0
,
0
)
*
tvec
.
at
<
double
>
(
0
)
+
rot_mat
.
at
<
double
>
(
1
,
0
)
*
tvec
.
at
<
double
>
(
1
)
+
rot_mat
.
at
<
double
>
(
2
,
0
)
*
tvec
.
at
<
double
>
(
2
);
translation_vector2
[
1
]
=
rot_mat
.
at
<
double
>
(
0
,
1
)
*
tvec
.
at
<
double
>
(
0
)
+
rot_mat
.
at
<
double
>
(
1
,
1
)
*
tvec
.
at
<
double
>
(
1
)
+
rot_mat
.
at
<
double
>
(
2
,
1
)
*
tvec
.
at
<
double
>
(
2
);
translation_vector2
[
2
]
=
rot_mat
.
at
<
double
>
(
0
,
2
)
*
tvec
.
at
<
double
>
(
0
)
+
rot_mat
.
at
<
double
>
(
1
,
2
)
*
tvec
.
at
<
double
>
(
1
)
+
rot_mat
.
at
<
double
>
(
2
,
2
)
*
tvec
.
at
<
double
>
(
2
);
SPDLOG_INFO
(
"-.- ESTIMATED ROTATION -.-"
);
for
(
size_t
p
=
0
;
p
<
3
;
p
++
)
{
SPDLOG_INFO
(
"{}, {}, {}"
,
rotation_matrix
[
p
*
3
],
rotation_matrix
[
p
*
3
+
1
],
rotation_matrix
[
p
*
3
]
+
2
);
}
SPDLOG_INFO
(
"{}, {}, {}"
,
rot_mat
.
at
<
double
>
(
0
,
0
),
rot_mat
.
at
<
double
>
(
0
,
1
),
rot_mat
.
at
<
double
>
(
0
,
2
));
SPDLOG_INFO
(
"{}, {}, {}"
,
rot_mat
.
at
<
double
>
(
1
,
0
),
rot_mat
.
at
<
double
>
(
1
,
1
),
rot_mat
.
at
<
double
>
(
1
,
2
));
SPDLOG_INFO
(
"{}, {}, {}"
,
rot_mat
.
at
<
double
>
(
2
,
0
),
rot_mat
.
at
<
double
>
(
2
,
1
),
rot_mat
.
at
<
double
>
(
2
,
2
));
SPDLOG_INFO
(
"-.- ESTIMATED TRANSLATION -.-"
);
SPDLOG_INFO
(
"{}, {}, {}"
,
t
ranslation_vector
[
0
],
translation_vector
[
1
],
translation_vector
[
2
]
);
SPDLOG_INFO
(
"{}, {}, {}"
,
t
vec
.
at
<
double
>
(
0
),
tvec
.
at
<
double
>
(
1
),
tvec
.
at
<
double
>
(
2
)
);
SPDLOG_INFO
(
"-.- Translation vector -.-"
);
SPDLOG_INFO
(
"{}, {}, {}"
,
translation_vector2
[
0
],
translation_vector2
[
1
],
translation_vector2
[
2
]);
SPDLOG_INFO
(
"-.- Rotation vector -.-"
);
SPDLOG_INFO
(
"{}, {}, {}"
,
rvec
.
at
<
double
>
(
0
,
0
),
rvec
.
at
<
double
>
(
1
,
0
),
rvec
.
at
<
double
>
(
2
,
0
));
SPDLOG_INFO
(
"{}, {}, {}"
,
rvec
.
at
<
double
>
(
0
),
rvec
.
at
<
double
>
(
1
),
rvec
.
at
<
double
>
(
2
));
camHeight
=
translation_vector2
[
2
]
<
0
?
-
translation_vector2
[
2
]
:
translation_vector2
[
2
];
ExtrinsicParameters
results
;
results
.
rot1
=
rvec
.
at
<
double
>
(
0
,
0
);
results
.
rot2
=
rvec
.
at
<
double
>
(
1
,
0
);
results
.
rot3
=
rvec
.
at
<
double
>
(
2
,
0
);
results
.
rot1
=
rvec
.
at
<
double
>
(
0
);
results
.
rot2
=
rvec
.
at
<
double
>
(
1
);
results
.
rot3
=
rvec
.
at
<
double
>
(
2
);
results
.
trans1
=
translation_vector2
[
0
];
results
.
trans2
=
translation_vector2
[
1
];
...
...
@@ -558,10 +538,6 @@ std::optional<ExtrinsicParameters> ExtrCalibration::calibExtrParams()
translation_vector2
[
1
]
=
0
;
translation_vector2
[
2
]
=
0
;
rotation_matrix
[
0
]
=
0
;
rotation_matrix
[
1
]
=
0
;
rotation_matrix
[
2
]
=
0
;
results
.
trans1
=
translation_vector2
[
0
];
results
.
trans2
=
translation_vector2
[
1
];
results
.
trans3
=
translation_vector2
[
2
];
...
...
@@ -573,12 +549,9 @@ std::optional<ExtrinsicParameters> ExtrCalibration::calibExtrParams()
QObject
::
tr
(
"Petrack"
),
QObject
::
tr
(
"Error: Could not calculate extrinsic calibration. Please select other 2D/3D point "
"correspondences for extrinsic calibration!"
));
isExtCalib
=
false
;
return
results
;
}
isExtCalib
=
true
;
SPDLOG_INFO
(
"End of extern calibration!"
);
mMainWindow
->
getScene
()
->
update
();
return
results
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment