t/hand: warn when rectification matrix doesn't match image matrix

This commit is contained in:
Christoph Haag 2020-12-01 00:34:50 +01:00 committed by Jakob Bornecrantz
parent 693cd77ca3
commit 7b4ac89a8f

View file

@ -155,16 +155,29 @@ process(TrackerHand &t, struct xrt_frame *xf)
return;
}
int cols = xf->width / 2;
int rows = xf->height;
int stride = xf->stride;
int rect_cols = t.view[0].undistort_rectify_map_x.cols;
int rect_rows = t.view[0].undistort_rectify_map_x.rows;
if (cols != rect_cols || rows != rect_rows) {
fprintf(stderr,
"Error: %dx%d rectification matrix does not fit %dx%d "
"Image\n",
rect_cols, rect_rows, cols, rows);
return;
}
// Create the debug frame if needed.
t.debug.refresh(xf);
t.view[0].keypoints.clear();
t.view[1].keypoints.clear();
int cols = xf->width / 2;
int rows = xf->height;
int stride = xf->stride;
#if 0
cv::Mat l_grey(rows, cols, CV_8UC1, xf->data, stride);
cv::Mat r_grey(rows, cols, CV_8UC1, xf->data + cols, stride);