How can i read and show a image (64*64), 2 byte integer format, and plot a profile across mid section of it?
3 次查看(过去 30 天)
显示 更早的评论
How can i read and show a image (64*64), 2 byte integer format, and plot a profile across mid section of it?
1 个评论
Guillaume
2015-4-17
编辑:Guillaume
2015-4-17
What do you mean by " image (64*64), 2 byte integer format"? Your image is a file of just the raw byte values of the pixels? In that case, you also need to know the number of colour channels (1 = monochrome, 3 = RGB).
Or is your image in a standard image format (PNG, BMP, or other)?
回答(1 个)
Guillaume
2015-4-17
Possibly, the following may work to read the file:
img = multibandread('somefile', [64 64 1], 'uint16=>uint16', 0, 'bsq', 'ieee-le');
Replace the 1 by 3 if a colour image. You may also need to change the byteorder or the interleave option of multibandread.
Once loaded, displaying the image is just
imshow(img)
1 个评论
Guillaume
2015-4-17
编辑:Guillaume
2015-4-17
Akshit comment moved here: yes, i have a raw data and it's color, i used the multiband read, but it did not work.
As mentioned for a colour image replace the 1 in [64 64 1] by a 3, so [64 64 3].
As also mentioned you may need to try a different option for interleave (most likely bip) and / or for the endianness.
Without more information about your file, I can't help you more.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!