Ask Your Question

Revision history [back]

Accessing the data of a multidimensional blob from dnn module

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 ?