I am trying to display multiple images from RGBD sensor in one window using OpenCV in C++. I can display each channel individually in its own window, but unsuccessful In displaying all in one. I am following a solution for Show multiple (2,3,4,…) images in the same window in OpenCV (proposed by Vinvinod down the page).
The solution copies all images into a region in the output image, then scales the output image. As each image stems from different image type (color is CV_8UC4, Depth is CV_8UC1, infrared is CV_16U) this fails. How could I force / cast / converTo all images into a common format that will display the multiple channels in the one image?
I have tried:
if (img0.type() != CV_8UC4)
{
cv::Mat tempImg = cv::Mat(depthFrameWidth, depthFrameHeight, CV_8UC4);
tempImg.convertTo(img0, CV_8UC4);
vecImg.push_back(tempImg);
}