Why can't MATLAB resize an image nicely?
古いコメントを表示
So I have an image with some text on it that I want to display in MATLAB for whatever reason, sounds easy enough, but it turns out that for some reason I hope to find out, MATLAB is apparently awful at rendering images to actually look nice.
I have a feeling there are performance reasons for this, but it seems like users should be able to resize an image with text on it and still actually read the image.
I have attached a sample image showing the original image, a highly distorted but still readable version of the image in Microsoft Word, and then an ever so slightly distorted version of the image in MATLAB which still looks awful.
If anyone can either explain how to fix this, or why its unfixable and why I should like it that way, I would really appreciate it!
採用された回答
その他の回答 (3 件)
Image Analyst
2013 年 5 月 16 日
0 投票
Try using the 'nearest' option in imresize(). Though if a line is just one pixel in your image, it's either going to be there or not if you use nearest. If you use bicubic then you'll get partial intensity depending on how much of the output pixel lands on your input pixel.
2 件のコメント
Shaun VanWeelden
2013 年 5 月 16 日
Image Analyst
2013 年 5 月 16 日
Using nearest will give you sharper edges than bicubic, though at the cost of having jaggies on your edges and lines. Alex is the expert here so he would be able to help you more than me.
DGM
2022 年 4 月 12 日
For passers-by:
Normally, imshow() displays images using nearest-neighbor interpolation. That leads to thin features disappearing completely.
It wasn't available at the time of this post, but imshow() also supports bilinear display interpolation:
imshow(myimg,'interpolation','bilinear')
カテゴリ
ヘルプ センター および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!