Есть ли способ рассчитать объем из данных глубины? с использованием глубинных камер
В настоящее время я получаю общую интенсивность кадра, добавляя все данные глубины. Могу ли я считать интенсивность объемом?
или есть другой способ получить громкость?
while(true)
{
// This call waits until a new coherent set of frames is available on a device
// Calls to get_frame_data(...) and get_frame_timestamp(...) on a device will return stable values until wait_for_frames(...) is called
dev->wait_for_frames();
// Retrieve depth data, which was previously configured as a 640 x 480 image of 16-bit depth values
const uint16_t * depth_frame = reinterpret_cast<const uint16_t *>(dev->get_frame_data(rs::stream::depth));
Mat depthData(Size(640, 480), CV_16UC1, (void*)dev->get_frame_data(rs::stream::depth), Mat::AUTO_STEP);
imshow( "WINDOW_DEPTH", depthData );
cvWaitKey( 1 );
// cout<<"\n\n\n\n\n\n\n\n\ndepthData:-------------------->"<<depthData;
//cal vol
int Totalintensity = 0;
for (int i=0; i < depthData.rows; ++i){
for (int j=0; j < depthData.cols; ++j){
Totalintensity += (int)depthData.at<uchar>(i, j);
}
}
cout<<"\ntotalVol:"<<Totalintensity;
}