Show depth if new in get_from_callbacks
This commit is contained in:
parent
8b7e43d76d
commit
76d12ccec7
|
@ -91,6 +91,7 @@ int main(int argc, char *argv[]) {
|
||||||
cv::namedWindow("frame");
|
cv::namedWindow("frame");
|
||||||
cv::namedWindow("depth");
|
cv::namedWindow("depth");
|
||||||
|
|
||||||
|
unsigned int depth_num = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
api->WaitForStreams();
|
api->WaitForStreams();
|
||||||
|
|
||||||
|
@ -121,12 +122,17 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
// Show depth
|
// Show depth
|
||||||
if (!depth.empty()) {
|
if (!depth.empty()) {
|
||||||
std::lock_guard<std::mutex> _(depth_mtx);
|
// Is the depth a new one?
|
||||||
ss.str("");
|
if (depth_num != depth_count || depth_num == 0) {
|
||||||
ss.clear();
|
std::lock_guard<std::mutex> _(depth_mtx);
|
||||||
ss << "depth: " << depth_count;
|
depth_num = depth_count;
|
||||||
painter.DrawText(depth, ss.str());
|
// LOG(INFO) << "depth_num: " << depth_num;
|
||||||
cv::imshow("depth", depth); // CV_16UC1
|
ss.str("");
|
||||||
|
ss.clear();
|
||||||
|
ss << "depth: " << depth_count;
|
||||||
|
painter.DrawText(depth, ss.str());
|
||||||
|
cv::imshow("depth", depth); // CV_16UC1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char key = static_cast<char>(cv::waitKey(1));
|
char key = static_cast<char>(cv::waitKey(1));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user