// each image containing one 32Bit channel
zImage.create (Size (data->width, data->height), CV_32FC1);
grayImage.create (Size (data->width, data->height), CV_32FC1);
+ confidenceImage.create (Size (data->width, data->height), CV_8UC1);
// set the image to zero
zImage = Scalar::all (0);
{
float *zRowPtr = zImage.ptr<float> (y);
float *grayRowPtr = grayImage.ptr<float> (y);
+ uint8_t *confRowPtr = confidenceImage.ptr<uint8_t> (y);
for (int x = 0; x < zImage.cols; x++, k++)
{
auto curPoint = data->points.at (k);
+ confRowPtr[x] = curPoint.depthConfidence;
if (curPoint.depthConfidence > confidence_threshold_)
{
// if the point is valid, map the pixel from 3D world
}
// scale and display the gray image
- scaledGrayImage.create (Size (data->width * 4, data->height * 4), CV_8UC1);
- resize (grayImage8, scaledGrayImage, scaledGrayImage.size());
+ // scaledGrayImage.create (Size (data->width * 4, data->height * 4), CV_8UC1);
+ // resize (grayImage8, scaledGrayImage, scaledGrayImage.size());
+ // imshow ("Gray", scaledGrayImage);
- imshow ("Gray", scaledGrayImage);
+ imshow ("Confidence", confidenceImage);
}
void setLensParameters (const LensParameters &lensParameters)
// and for their 8Bit and scaled versions
Mat zImage, zImage8, scaledZImage;
Mat grayImage, grayImage8, scaledGrayImage;
+ Mat confidenceImage;
// lens matrices used for the undistortion of
// the image
// create two windows
namedWindow ("Depth", WINDOW_AUTOSIZE);
- namedWindow ("Gray", WINDOW_AUTOSIZE);
+ // namedWindow ("Gray", WINDOW_AUTOSIZE);
+ namedWindow ("Confidence", WINDOW_AUTOSIZE);
// namedWindow ("column", WINDOW_AUTOSIZE);
// start capture mode