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

,

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).