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

access 3D Mat cell position uting pointer

user601
1#
user601 Published in July 23, 2018, 1:11 pm

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.

You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO