summaryrefslogtreecommitdiffhomepage
path: root/tracker-kinect-face/camera_kinect_ir.cpp
diff options
context:
space:
mode:
authorStéphane Lenclud <github@lenclud.com>2019-04-13 00:19:18 +0200
committerStéphane Lenclud <github@lenclud.com>2019-04-24 18:46:12 +0200
commit12e7ec5bdac206a3072f24577e897c79d6b0189f (patch)
treea7a83eaf731b6850cc902b34670c91908f9528be /tracker-kinect-face/camera_kinect_ir.cpp
parent3e36ce6985399c74676d46beef73a282eacf4109 (diff)
Easy Tracker: Support for single channel camera frames.
Diffstat (limited to 'tracker-kinect-face/camera_kinect_ir.cpp')
-rw-r--r--tracker-kinect-face/camera_kinect_ir.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/tracker-kinect-face/camera_kinect_ir.cpp b/tracker-kinect-face/camera_kinect_ir.cpp
index 8499003b..b1856f47 100644
--- a/tracker-kinect-face/camera_kinect_ir.cpp
+++ b/tracker-kinect-face/camera_kinect_ir.cpp
@@ -99,7 +99,7 @@ std::tuple<const video::impl::frame&, bool> CameraKinectIr::get_frame()
iFrame.width = 512;
iFrame.height = 424;
iFrame.stride = cv::Mat::AUTO_STEP;
- iFrame.channels = 3;
+ iFrame.channels = iMatFrame.channels();
return { iFrame, new_frame };
}
@@ -280,9 +280,7 @@ bool CameraKinectIr::get_frame_(cv::Mat& frame)
// For scalling to have more precission in the range we are interrested in
min = max - 255;
// See: https://stackoverflow.com/questions/14539498/change-type-of-mat-object-from-cv-32f-to-cv-8u/14539652
- raw.convertTo(iRaw8, CV_8U, 255.0 / (max - min), -255.0*min / (max - min));
- // Second convert to RGB
- cv::cvtColor(iRaw8, frame, cv::COLOR_GRAY2BGR);
+ raw.convertTo(frame, CV_8U, 255.0 / (max - min), -255.0*min / (max - min));
//
success = true;
}