Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to extract a 2D vector from 4D Mat and get maximum value

Hi to all, I am playing a bit with dnn to improve my know how. I pass a camera frame through a network. Based on documentation at the official link

(http://docs.openvinotoolkit.org/2019_R1/_age_gender_recognition_retail_0013_description_age_gender_recognition_retail_0013.html)

the output is a Mat with this shape

"shape: [1, 2, 1, 1] - Softmax output across 2 type classes".

So I would extract automatically the values at the indexes (0,0,0,0) and (0,1,0,0), store them in a vector<float> and get the maximum value between them. Is there a way to do it automatically? Thank in advance Franco

How to extract a 2D vector from 4D Mat and get maximum value

Hi to all, I am playing a bit with dnn to improve my know how. I pass a camera frame through a network. Based on documentation at the official link

(http://docs.openvinotoolkit.org/2019_R1/_age_gender_recognition_retail_0013_description_age_gender_recognition_retail_0013.html)

the output is a Mat with this shape

"shape: [1, 2, 1, 1] - Softmax output across 2 type classes".

So I would extract automatically the values at the indexes (0,0,0,0) and (0,1,0,0), store them in a vector<float> and get the maximum value between them. Is there a way to do it automatically? automatically in C++? Thank in advance Franco