Home access 3D Mat cell position uting pointer
Reply: 1

access 3D Mat cell position uting pointer

F. DE VIVO
1#
F. DE VIVO Published in 2017-12-07 18:36:04Z

I am trying to access a 3D Mat object, but I don't know how to do it.

In the 2D case i can access any matrix position in a double for cycle over "i" and "j" simply with the following command:

float a = M.ptr<float>(i)[j];

Do you know how I can do it in the case I have a 3D matrix? I have tried with

float a = M.ptr<float>(i)(j)[k];

and

float a = M.ptr<float>(i)[j][k];   

but they are not working. I don't want to use .at(i,j,k) because it is very slow.

F. DE VIVO
2#
F. DE VIVO Reply to 2017-12-07 18:56:59Z

I have solved it this way:

float a = M.ptr<float>(i)[j,k];
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.312038 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO