How to store 4D mat of dimension [1*224*224*1*CV_32FC1] to Bitmap Image


the DNN model is giving the output in mat [1*224*224*1*CV_32FC1] format how do we convert mat type to bitmap .

i am trying :

Mat resultBitmap = detections.reshape(1,224,224);
Bitmap bitmap = Bitmap.createBitmap(mat3D.cols(), mat3D.rows(),Bitmap.Config.ARGB_8888);
Utils.matToBitmap(mat3D, bitmap);

and what is the result / problem ?

simply, detections.reshape(1,224); ?
does Bitmap accept float data ? you probably need a

detections.convertTo(detections, CV_8U, 255); 
// what is the scale / value range of it ?

also, please explain, what your network is doing, what’s actually inside the result, etc ! (something called detections would rarely return an image, so confusing)

detections is a variable for storing the output from the model. the model gives output images of detected hairs regions in Mat format [1 * 224 * 224 * 1 * CV_32FC1] . i need to store this mat as bitmap image(greyscale).