How to create image from a matrix?
显示 更早的评论
Hello, I have an matrix whose dimension is 101x4032 double. Now how can I see the image using imshow function? Please help me.
回答(2 个)
Image Analyst
2019-8-30
If m is your double matrix, use
imshow(m, []);
This works for any range of m - it doesn't have to be in the 0-1 range. Though if it already is in the 0-1 range, then you can omit the [] input argument to imshow().
2 个评论
Boni_Pl
2019-8-31
Image Analyst
2019-8-31
You can use imresize():
resizedImage = imresize(originalImage, [500, 500]);
though be aware that there will be a different number of pixels in the new matrix and they won't have exactly the same values though they may be close.
Star Strider
2019-8-30
2 个评论
Image Analyst
2019-8-30
Why might those be likely to be better? I never use those instead of imshow().
Star Strider
2019-8-31
You cannot reshape your matrix into a square matrix.
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!