Image interpolation with a sample image

86 views (last 30 days)
MX Zhang
MX Zhang on 28 Jul 2017
Commented: Image Analyst on 28 May 2020
I am trying out image interpolation on Matlab, with the following sample image.
I'm not exactly sure why my code isn't working.
colormap gray;
axis image;
axis off;
grayImage = rgb2gray(V);
Vn = interp2(grayImage,3);

Answers (2)

Image Analyst
Image Analyst on 28 Jul 2017
Try using imresize() instead of interp2().

Sign in to comment.

Vipresh Gangwal
Vipresh Gangwal on 28 Jul 2017
Edited: Vipresh Gangwal on 28 Jul 2017
what do you mean it is not working? Also there seems to be a lot of salt and pepper noise in your image . That might be impacting the interpolation.
There is an example on the interp2 doc page. Try replicating same steps for your data.
Image Analyst
Image Analyst on 31 Jul 2017
cdata is a color image, which is a 3-D image. You can't use interp2() on a color image.
Any reason why you didn't like my solution?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!