Image interpolation with a sample image

I am trying out image interpolation on Matlab, with the following sample image.
I'm not exactly sure why my code isn't working.
%Interpolation
figure
imagesc(V);
colormap gray;
axis image;
axis off;
title("Original");
grayImage = rgb2gray(V);
Vn = interp2(grayImage,3);
imagesc(Vn);
title("Modified");

답변 (2개)

Image Analyst
Image Analyst 2017년 7월 28일

1 개 추천

Try using imresize() instead of interp2().

댓글 수: 2

nika mong
nika mong 2020년 5월 28일
Hello, dear ser, I have problems writing code, which method can increase the resolution of a sub-pixel offset image, can you help please
Image Analyst
Image Analyst 2020년 5월 28일
nika, I don't know what that is. To learn MATLAB, try MATLAB Academy - free 2 hour training.

댓글을 달려면 로그인하십시오.

Vipresh Gangwal
Vipresh Gangwal 2017년 7월 28일
편집: Vipresh Gangwal 2017년 7월 28일

0 개 추천

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.
https://www.mathworks.com/help/matlab/ref/interp2.html

댓글 수: 2

I did try the sample on the link. Here's my code:
figure
imagesc(cdata);
colormap gray;
axis image;
axis off;
title("Original");
%grayImage = rgb2gray(V);
%Vn = interp2(grayImage,3);
Vn = interp2(cdata);
imagesc(Vn);
title("Modified");
But I get an error when I perform it:
Error using .'
Transpose on ND array is not defined. Use PERMUTE instead.
Error in interp2 (line 96)
V = V.';
Error in Interpolation (line 14)
Vn = interp2(cdata);
Image Analyst
Image Analyst 2017년 7월 31일
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?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

질문:

2017년 7월 28일

댓글:

2020년 5월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by