Hi, currently I’m working on the medical imaging project and I’m trying to use the recordIO .rec files to pack the data. In this field it is common to have grayscale images with a pretty high dynamic range, therefore most of the data are encoded with 12 or 16 bits per pixel. It would be nice, of course, to preserve the original image bit-depth for certain U-Net applications.
It is possible in general to pack the 16-bit PNG files in the .rec container. The problem is that mxnet ImageRecordIter seems to convert all data into 8-bit format internally throwing away the information I want to preserve. Changing dtype parameter value does not help (does it only affect labels data format?).
At the first glance at
it seems like the problem arises from the hardcoded specification of CV_8U format (equivalent of unsigned int 8) in the line 544:
cv::Mat buf(1, rec.content_size, CV_8U, rec.content);
My questions are:
- Am I missing some way of loading 16-bit data from .rec files?
- If not, will it be possible to add a support for higher bit-depths into ImageRecordIter?
Thank you in advance.