mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-03 21:56:06 +00:00
a/tracking: Improve word choice/clarity
This commit is contained in:
parent
2a54dcdb19
commit
276f24c9ad
|
@ -209,7 +209,7 @@ ensure_buffers_are_allocated(class Calibration &c, int rows, int cols)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If our rgb is not allocated but our gray already is, alloc our rgb
|
// If our rgb is not allocated but our gray already is, alloc our rgb
|
||||||
// now. We will hit this path if we receive L8 format.
|
// now. We will end up in this path if we receive L8 format.
|
||||||
if (c.gray.cols == cols && c.gray.rows == rows) {
|
if (c.gray.cols == cols && c.gray.rows == rows) {
|
||||||
refresh_gui_frame(c, rows, cols);
|
refresh_gui_frame(c, rows, cols);
|
||||||
return;
|
return;
|
||||||
|
@ -352,7 +352,7 @@ do_view_sb_checkers(class Calibration &c, struct ViewState &view, cv::Mat &gray,
|
||||||
|
|
||||||
#ifdef SB_CHEESBOARD_CORNERS_MARKER_SUPPORTED
|
#ifdef SB_CHEESBOARD_CORNERS_MARKER_SUPPORTED
|
||||||
if (c.board.marker) {
|
if (c.board.marker) {
|
||||||
// Only available in OpenCV 4.3 and above.
|
// Only available in OpenCV 4.3 and newer.
|
||||||
flags += cv::CALIB_CB_MARKER;
|
flags += cv::CALIB_CB_MARKER;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace xrt::auxiliary::tracking {
|
||||||
/*!
|
/*!
|
||||||
* @brief Essential calibration data wrapped for C++.
|
* @brief Essential calibration data wrapped for C++.
|
||||||
*
|
*
|
||||||
* Just like the cv::Mat that it holds, this object does not own all the memory
|
* Like the cv::Mat that it holds, this object does not own all the memory
|
||||||
* it points to!
|
* it points to!
|
||||||
*/
|
*/
|
||||||
struct CameraCalibrationWrapper
|
struct CameraCalibrationWrapper
|
||||||
|
@ -67,7 +67,7 @@ struct CameraCalibrationWrapper
|
||||||
/*!
|
/*!
|
||||||
* @brief Essential stereo calibration data wrapped for C++.
|
* @brief Essential stereo calibration data wrapped for C++.
|
||||||
*
|
*
|
||||||
* Just like the cv::Mat that it holds, this object does not own (all) the
|
* Like the cv::Mat that it holds, this object does not own (all) the
|
||||||
* memory it points to!
|
* memory it points to!
|
||||||
*/
|
*/
|
||||||
struct StereoCameraCalibrationWrapper
|
struct StereoCameraCalibrationWrapper
|
||||||
|
@ -198,8 +198,7 @@ struct StereoRectificationMaps
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Provides cached, precomputed access to normalized image coordinates
|
* @brief Provides cached, precomputed normalized image coordinates from original, distorted ones.
|
||||||
* from original, distorted ones.
|
|
||||||
*
|
*
|
||||||
* Populates internal structures using cv::undistortPoints() and performs
|
* Populates internal structures using cv::undistortPoints() and performs
|
||||||
* subpixel sampling to interpolate for each query. Essentially, this class lets
|
* subpixel sampling to interpolate for each query. Essentially, this class lets
|
||||||
|
|
|
@ -346,7 +346,7 @@ t_calibration_gui_params_load_or_default(struct t_calibration_params *p)
|
||||||
{
|
{
|
||||||
t_calibration_gui_params_default(p);
|
t_calibration_gui_params_default(p);
|
||||||
|
|
||||||
// Load defaults from file, if it exists. This overwrites the above
|
// Load defaults from file, if it exists. This overwrites the preceding
|
||||||
struct u_config_json config_json = {0};
|
struct u_config_json config_json = {0};
|
||||||
|
|
||||||
u_gui_state_open_file(&config_json);
|
u_gui_state_open_file(&config_json);
|
||||||
|
|
|
@ -100,7 +100,7 @@ euroc_recorder_flush(struct euroc_recorder *er)
|
||||||
er->imu_queue.pop();
|
er->imu_queue.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flush csv streams. Not necessary, just doing it to increase flush frequency
|
// Flush csv streams. Not necessary, doing it only to increase flush frequency
|
||||||
er->imu_csv->flush();
|
er->imu_csv->flush();
|
||||||
er->left_cam_csv->flush();
|
er->left_cam_csv->flush();
|
||||||
er->right_cam_csv->flush();
|
er->right_cam_csv->flush();
|
||||||
|
|
|
@ -119,7 +119,7 @@ StereoRectificationMaps::StereoRectificationMaps(t_stereo_camera_calibration *da
|
||||||
//! @todo for some reason this looks weird?
|
//! @todo for some reason this looks weird?
|
||||||
// Alpha of 1.0 kinda works, not really.
|
// Alpha of 1.0 kinda works, not really.
|
||||||
int flags = cv::CALIB_ZERO_DISPARITY;
|
int flags = cv::CALIB_ZERO_DISPARITY;
|
||||||
double balance = 0.0; // aka alpha.
|
double balance = 0.0; // also known as alpha.
|
||||||
double fov_scale = 1.0;
|
double fov_scale = 1.0;
|
||||||
|
|
||||||
cv::fisheye::stereoRectify(
|
cv::fisheye::stereoRectify(
|
||||||
|
@ -217,8 +217,8 @@ t_stereo_camera_calibration_load_v1(FILE *calib_file, struct t_stereo_camera_cal
|
||||||
t_stereo_camera_calibration_alloc(&data_ptr, 5); // Hardcoded to 5 distortion parameters.
|
t_stereo_camera_calibration_alloc(&data_ptr, 5); // Hardcoded to 5 distortion parameters.
|
||||||
StereoCameraCalibrationWrapper wrapped(data_ptr);
|
StereoCameraCalibrationWrapper wrapped(data_ptr);
|
||||||
|
|
||||||
// Dummy matrix
|
// Scratch-space temporary matrix
|
||||||
cv::Mat dummy;
|
cv::Mat scratch;
|
||||||
|
|
||||||
// Read our calibration from this file
|
// Read our calibration from this file
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
@ -229,13 +229,13 @@ t_stereo_camera_calibration_load_v1(FILE *calib_file, struct t_stereo_camera_cal
|
||||||
result = result && read_cv_mat(calib_file, &wrapped.view[1].distortion_mat, "r_distortion"); // 5 x 1
|
result = result && read_cv_mat(calib_file, &wrapped.view[1].distortion_mat, "r_distortion"); // 5 x 1
|
||||||
result = result && read_cv_mat(calib_file, &wrapped.view[0].distortion_fisheye_mat, "l_distortion_fisheye"); // 4 x 1
|
result = result && read_cv_mat(calib_file, &wrapped.view[0].distortion_fisheye_mat, "l_distortion_fisheye"); // 4 x 1
|
||||||
result = result && read_cv_mat(calib_file, &wrapped.view[1].distortion_fisheye_mat, "r_distortion_fisheye"); // 4 x 1
|
result = result && read_cv_mat(calib_file, &wrapped.view[1].distortion_fisheye_mat, "r_distortion_fisheye"); // 4 x 1
|
||||||
result = result && read_cv_mat(calib_file, &dummy, "l_rotation"); // 3 x 3
|
result = result && read_cv_mat(calib_file, &scratch, "l_rotation"); // 3 x 3
|
||||||
result = result && read_cv_mat(calib_file, &dummy, "r_rotation"); // 3 x 3
|
result = result && read_cv_mat(calib_file, &scratch, "r_rotation"); // 3 x 3
|
||||||
result = result && read_cv_mat(calib_file, &dummy, "l_translation"); // empty
|
result = result && read_cv_mat(calib_file, &scratch, "l_translation"); // empty
|
||||||
result = result && read_cv_mat(calib_file, &dummy, "r_translation"); // empty
|
result = result && read_cv_mat(calib_file, &scratch, "r_translation"); // empty
|
||||||
result = result && read_cv_mat(calib_file, &dummy, "l_projection"); // 3 x 4
|
result = result && read_cv_mat(calib_file, &scratch, "l_projection"); // 3 x 4
|
||||||
result = result && read_cv_mat(calib_file, &dummy, "r_projection"); // 3 x 4
|
result = result && read_cv_mat(calib_file, &scratch, "r_projection"); // 3 x 4
|
||||||
result = result && read_cv_mat(calib_file, &dummy, "disparity_to_depth"); // 4 x 4
|
result = result && read_cv_mat(calib_file, &scratch, "disparity_to_depth"); // 4 x 4
|
||||||
result = result && read_cv_mat(calib_file, &mat_image_size, "mat_image_size");
|
result = result && read_cv_mat(calib_file, &mat_image_size, "mat_image_size");
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
@ -447,8 +447,8 @@ t_stereo_camera_calibration_save_v1(FILE *calib_file, struct t_stereo_camera_cal
|
||||||
CALIB_WARN("Deprecated function: %s", __func__);
|
CALIB_WARN("Deprecated function: %s", __func__);
|
||||||
|
|
||||||
StereoCameraCalibrationWrapper wrapped(data);
|
StereoCameraCalibrationWrapper wrapped(data);
|
||||||
// Dummy matrix
|
// Scratch-space temporary matrix
|
||||||
cv::Mat dummy;
|
cv::Mat scratch;
|
||||||
|
|
||||||
write_cv_mat(calib_file, &wrapped.view[0].intrinsics_mat);
|
write_cv_mat(calib_file, &wrapped.view[0].intrinsics_mat);
|
||||||
write_cv_mat(calib_file, &wrapped.view[1].intrinsics_mat);
|
write_cv_mat(calib_file, &wrapped.view[1].intrinsics_mat);
|
||||||
|
@ -456,13 +456,13 @@ t_stereo_camera_calibration_save_v1(FILE *calib_file, struct t_stereo_camera_cal
|
||||||
write_cv_mat(calib_file, &wrapped.view[1].distortion_mat);
|
write_cv_mat(calib_file, &wrapped.view[1].distortion_mat);
|
||||||
write_cv_mat(calib_file, &wrapped.view[0].distortion_fisheye_mat);
|
write_cv_mat(calib_file, &wrapped.view[0].distortion_fisheye_mat);
|
||||||
write_cv_mat(calib_file, &wrapped.view[1].distortion_fisheye_mat);
|
write_cv_mat(calib_file, &wrapped.view[1].distortion_fisheye_mat);
|
||||||
write_cv_mat(calib_file, &dummy); // view[0].rotation_mat
|
write_cv_mat(calib_file, &scratch); // view[0].rotation_mat
|
||||||
write_cv_mat(calib_file, &dummy); // view[1].rotation_mat
|
write_cv_mat(calib_file, &scratch); // view[1].rotation_mat
|
||||||
write_cv_mat(calib_file, &dummy); // l_translation
|
write_cv_mat(calib_file, &scratch); // l_translation
|
||||||
write_cv_mat(calib_file, &dummy); // r_translation
|
write_cv_mat(calib_file, &scratch); // r_translation
|
||||||
write_cv_mat(calib_file, &dummy); // view[0].projection_mat
|
write_cv_mat(calib_file, &scratch); // view[0].projection_mat
|
||||||
write_cv_mat(calib_file, &dummy); // view[1].projection_mat
|
write_cv_mat(calib_file, &scratch); // view[1].projection_mat
|
||||||
write_cv_mat(calib_file, &dummy); // disparity_to_depth_mat
|
write_cv_mat(calib_file, &scratch); // disparity_to_depth_mat
|
||||||
|
|
||||||
cv::Mat mat_image_size;
|
cv::Mat mat_image_size;
|
||||||
mat_image_size.create(1, 2, CV_32F);
|
mat_image_size.create(1, 2, CV_32F);
|
||||||
|
|
|
@ -268,7 +268,7 @@ SimpleIMUFusion::handleAccel(Eigen::Vector3d const &accel, timepoint_ns timestam
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initially, just set it to totally trust gravity.
|
// Initially, set it to totally trust gravity.
|
||||||
started_ = true;
|
started_ = true;
|
||||||
quat_ = Eigen::Quaterniond::FromTwoVectors(accel.normalized(), Eigen::Vector3d::UnitY());
|
quat_ = Eigen::Quaterniond::FromTwoVectors(accel.normalized(), Eigen::Vector3d::UnitY());
|
||||||
accel_filter_.addSample(accel, timestamp);
|
accel_filter_.addSample(accel, timestamp);
|
||||||
|
|
|
@ -173,8 +173,8 @@ do_view(TrackerPSMV &t, View &view, cv::Mat &grey, cv::Mat &rgb)
|
||||||
* computed by your functor.
|
* computed by your functor.
|
||||||
*
|
*
|
||||||
* Having this as a struct with a method, instead of a single "algorithm"-style
|
* Having this as a struct with a method, instead of a single "algorithm"-style
|
||||||
* function, allows you to keep your complicated filtering logic in your own
|
* function, lets you keep your complicated filtering logic in your own
|
||||||
* loop, just calling in when you have a new candidate for "best".
|
* loop, calling in when you have a new candidate for "best".
|
||||||
*
|
*
|
||||||
* @note Create by calling make_lowest_score_finder() with your
|
* @note Create by calling make_lowest_score_finder() with your
|
||||||
* function/lambda that takes an element and returns the score, to deduce the
|
* function/lambda that takes an element and returns the score, to deduce the
|
||||||
|
|
|
@ -119,7 +119,7 @@ namespace {
|
||||||
imu.handleGyro(map_vec3(sample->gyro_rad_secs).cast<double>(), timestamp_ns);
|
imu.handleGyro(map_vec3(sample->gyro_rad_secs).cast<double>(), timestamp_ns);
|
||||||
imu.postCorrect();
|
imu.postCorrect();
|
||||||
|
|
||||||
//! @todo use better measurements instead of the above "simple
|
//! @todo use better measurements instead of the preceding "simple
|
||||||
//! fusion"
|
//! fusion"
|
||||||
if (filter_time_ns != 0 && filter_time_ns != timestamp_ns) {
|
if (filter_time_ns != 0 && filter_time_ns != timestamp_ns) {
|
||||||
float dt = time_ns_to_s(timestamp_ns - filter_time_ns);
|
float dt = time_ns_to_s(timestamp_ns - filter_time_ns);
|
||||||
|
|
|
@ -197,7 +197,7 @@ typedef struct match_data
|
||||||
{
|
{
|
||||||
float angle = {}; // angle from reference vector
|
float angle = {}; // angle from reference vector
|
||||||
float distance = {}; // distance from base of reference vector
|
float distance = {}; // distance from base of reference vector
|
||||||
int32_t vertex_index = {}; // index aka tag
|
int32_t vertex_index = {}; // index also known as tag
|
||||||
Eigen::Vector4f position = {}; // 3d position of vertex
|
Eigen::Vector4f position = {}; // 3d position of vertex
|
||||||
blob_point_t src_blob = {}; // blob this vertex was derived from
|
blob_point_t src_blob = {}; // blob this vertex was derived from
|
||||||
} match_data_t;
|
} match_data_t;
|
||||||
|
@ -915,7 +915,7 @@ disambiguate(TrackerPSVR &t,
|
||||||
uint32_t matched_vertex_indices[PSVR_NUM_LEDS];
|
uint32_t matched_vertex_indices[PSVR_NUM_LEDS];
|
||||||
|
|
||||||
// we can early-out if we are 'close enough' to our last match model.
|
// we can early-out if we are 'close enough' to our last match model.
|
||||||
// if we just hold the previous led configuration, this increases
|
// if we hold the previous led configuration, this increases
|
||||||
// performance and should cut down on jitter.
|
// performance and should cut down on jitter.
|
||||||
if (t.last_optical_model > 0 && t.done_correction) {
|
if (t.last_optical_model > 0 && t.done_correction) {
|
||||||
|
|
||||||
|
@ -1293,9 +1293,8 @@ sample_line(cv::Mat &src, const cv::Point2i &start, const cv::Point2i &end, int
|
||||||
// cv is row, column
|
// cv is row, column
|
||||||
uint8_t *val = src.ptr(curr_y, curr_x);
|
uint8_t *val = src.ptr(curr_y, curr_x);
|
||||||
|
|
||||||
// @todo: we are just counting pixels rather
|
/// @todo: we are counting pixels rather than measuring length - bresenhams may introduce some
|
||||||
// than measuring length - bresenhams may introduce some
|
/// inaccuracy here.
|
||||||
// inaccuracy here.
|
|
||||||
if (*val > 128) {
|
if (*val > 128) {
|
||||||
(*inside_length) += 1;
|
(*inside_length) += 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue