Ask Your Question

Revision history [back]

XYZ Data to Mat

Hi,

i have a 3D picture, with x,y,z data for each point in a struct. Now i want to save this data into a Mat. But don't know how.

Mat depthimage
depthimage.create(data->with, data->height),CV_32F...) // do I need 3 channels for xyz  or is that only for RGB values ? 

int c = 0;
for( int y; y< depthimage.rows, y++)
{...

for(int x; x< depthimage.cols; x++, c++)
{
auto currentpoint = data->points.at(c);
//Here i have to fill the matrix, i think, but how? I only see examples for 2D matrizes
...
}}

I want a 3D PointCloud