Say I have an image I read in and feed it through neural network so I get 4D output, i.e
Mat img = imread(filepath);
cv::Mat inputBlob = cv::dnn::blobFromImage(resized_img, 1.0 / 255.0);
inputNet.setInput(inputBlob);
cv::Mat netOutput = inputNet.forward();
now netOutput has the following shape [1,n,H,W] how do I iterate over this object to extract the matrix of size [H,W] for each i in {1,…,n}?
Please login or Register to submit your answer