How to create image from a matrix?
조회 수: 114 (최근 30일)
이전 댓글 표시
Hello, I have an matrix whose dimension is 101x4032 double. Now how can I see the image using imshow function? Please help me.
댓글 수: 0
답변 (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
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().
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!