Use of square brackets
5 次查看(过去 30 天)
显示 更早的评论
I know this sounds a silly question, but what is the difference between using imshow(X); and using imshow(X,[]); ? For some images, I'm unable to display them using the first command.
0 个评论
回答(1 个)
Image Analyst
2012-11-25
You use [] to scale the image to the range 0-255. This will maximize the contrast. If you have a double or single image, then it expects the range to be 0-1. If your image is not in that range, then it will show as all white or all black depending on if it's more than 1 or less than 1. For example, if your image goes from -242.99 to +5782.123, then it will set -242.99 to 0, and 5782.123 to 255 and linearly scale everything in between.
2 个评论
另请参阅
类别
在 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!