mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-04 06:06:17 +00:00
a/tracing: Do more tracing in PSMV tracking code
This commit is contained in:
parent
f552aacb87
commit
c195608602
|
@ -21,6 +21,7 @@
|
||||||
#include "util/u_debug.h"
|
#include "util/u_debug.h"
|
||||||
#include "util/u_frame.h"
|
#include "util/u_frame.h"
|
||||||
#include "util/u_format.h"
|
#include "util/u_format.h"
|
||||||
|
#include "util/u_trace_marker.h"
|
||||||
|
|
||||||
#include "math/m_api.h"
|
#include "math/m_api.h"
|
||||||
|
|
||||||
|
@ -134,28 +135,40 @@ static_assert(std::is_standard_layout<TrackerPSMV>::value);
|
||||||
static void
|
static void
|
||||||
do_view(TrackerPSMV &t, View &view, cv::Mat &grey, cv::Mat &rgb)
|
do_view(TrackerPSMV &t, View &view, cv::Mat &grey, cv::Mat &rgb)
|
||||||
{
|
{
|
||||||
// Undistort and rectify the whole image.
|
XRT_TRACE_MARKER();
|
||||||
cv::remap(grey, // src
|
|
||||||
view.frame_undist_rectified, // dst
|
|
||||||
view.undistort_rectify_map_x, // map1
|
|
||||||
view.undistort_rectify_map_y, // map2
|
|
||||||
cv::INTER_NEAREST, // interpolation
|
|
||||||
cv::BORDER_CONSTANT, // borderMode
|
|
||||||
cv::Scalar(0, 0, 0)); // borderValue
|
|
||||||
|
|
||||||
cv::threshold(view.frame_undist_rectified, // src
|
{
|
||||||
view.frame_undist_rectified, // dst
|
XRT_TRACE_IDENT(remap);
|
||||||
32.0, // thresh
|
|
||||||
255.0, // maxval
|
|
||||||
0); // type
|
|
||||||
|
|
||||||
// tracker_measurement_t m = {};
|
// Undistort and rectify the whole image.
|
||||||
|
cv::remap(grey, // src
|
||||||
|
view.frame_undist_rectified, // dst
|
||||||
|
view.undistort_rectify_map_x, // map1
|
||||||
|
view.undistort_rectify_map_y, // map2
|
||||||
|
cv::INTER_NEAREST, // interpolation
|
||||||
|
cv::BORDER_CONSTANT, // borderMode
|
||||||
|
cv::Scalar(0, 0, 0)); // borderValue
|
||||||
|
}
|
||||||
|
|
||||||
// Do blob detection with our masks.
|
{
|
||||||
//! @todo Re-enable masks.
|
XRT_TRACE_IDENT(threshold);
|
||||||
t.sbd->detect(view.frame_undist_rectified, // image
|
|
||||||
view.keypoints, // keypoints
|
cv::threshold(view.frame_undist_rectified, // src
|
||||||
cv::noArray()); // mask
|
view.frame_undist_rectified, // dst
|
||||||
|
32.0, // thresh
|
||||||
|
255.0, // maxval
|
||||||
|
0); // type
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
XRT_TRACE_IDENT(detect);
|
||||||
|
|
||||||
|
// Do blob detection with our masks.
|
||||||
|
//! @todo Re-enable masks.
|
||||||
|
t.sbd->detect(view.frame_undist_rectified, // image
|
||||||
|
view.keypoints, // keypoints
|
||||||
|
cv::noArray()); // mask
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Debug is wanted, draw the keypoints.
|
// Debug is wanted, draw the keypoints.
|
||||||
|
@ -246,6 +259,8 @@ world_point_from_blobs(const cv::Point2f &left, const cv::Point2f &right, const
|
||||||
static void
|
static void
|
||||||
process(TrackerPSMV &t, struct xrt_frame *xf)
|
process(TrackerPSMV &t, struct xrt_frame *xf)
|
||||||
{
|
{
|
||||||
|
XRT_TRACE_MARKER();
|
||||||
|
|
||||||
// Only IMU data: nothing to do
|
// Only IMU data: nothing to do
|
||||||
if (xf == NULL) {
|
if (xf == NULL) {
|
||||||
return;
|
return;
|
||||||
|
@ -350,6 +365,8 @@ process(TrackerPSMV &t, struct xrt_frame *xf)
|
||||||
static void
|
static void
|
||||||
run(TrackerPSMV &t)
|
run(TrackerPSMV &t)
|
||||||
{
|
{
|
||||||
|
U_TRACE_SET_THREAD_NAME("PSMV");
|
||||||
|
|
||||||
struct xrt_frame *frame = NULL;
|
struct xrt_frame *frame = NULL;
|
||||||
|
|
||||||
os_thread_helper_lock(&t.oth);
|
os_thread_helper_lock(&t.oth);
|
||||||
|
@ -549,6 +566,8 @@ t_psmv_create(struct xrt_frame_context *xfctx,
|
||||||
struct xrt_tracked_psmv **out_xtmv,
|
struct xrt_tracked_psmv **out_xtmv,
|
||||||
struct xrt_frame_sink **out_sink)
|
struct xrt_frame_sink **out_sink)
|
||||||
{
|
{
|
||||||
|
XRT_TRACE_MARKER();
|
||||||
|
|
||||||
U_LOG_D("Creating PSMV tracker.");
|
U_LOG_D("Creating PSMV tracker.");
|
||||||
|
|
||||||
auto &t = *(new TrackerPSMV());
|
auto &t = *(new TrackerPSMV());
|
||||||
|
|
Loading…
Reference in a new issue