Accessing the data of a multidimensional blob from dnn module

asked 2017-08-25 05:08:43 -0500

harman gravatar image

I'm using opencv's dnn module to interpret the output of a trained model.

The details of the blob are as follows:

cv::Mat output;
net.forward(output, "output_blob_name");

Now, I do the following:

std::cout << output.dims << "\n";

// output is 4

for (size_t i = 0; i < output.dims;++i) {  
    std::cout << output.size[i] << ", "; 
}

// output is: 1, 23, 23, 9

How do I access the data from this blob ?

edit retag flag offensive close merge delete