MATLAB: How to display mono16 images from an image topic

imshowmono16Robotics System Toolboxros

Hi, I am working with Robotics toolbox and struggling to display images from an image topic. I recorded a rosbag and would like to process images from an image topic. The images' encoding is mono16 (these images were captured by a thermal camera FLIR tau 2). I followed the example of reading images here: https://www.mathworks.com/help/robotics/ref/readimage.html. However, imshow returned a totally black picture. I don't know why imshow can't display mono16 images. A part of my code looks like this:
msgs = readMessages(color_select);
[imageFormatted,alpha]=readImage(msgs{5,1});
img=im2uint16(imageFormatted);
imshow(img); % show a black picture
imshow(imageFormatted); % show a black picture as well
I don't know what went wrong here. I appreciate any help!
[EDITED, Jan, Code formatted]

Best Answer

Perhaps the image contains black pixels only? Test this:
max(img(:))
min(img(:))
According to the documentation doc imshow , you can sepcify the black and white intensities:
imshow(img, [min(img(:), max(img(:))])
or
imshow(img, [intmin('uint16'), intmax('uint16')])
or as you like.