필터 지우기
필터 지우기

How can i use interp1 to enlarge the photo 'lena'

조회 수: 1 (최근 30일)
Dingbang Liang
Dingbang Liang 2018년 5월 24일
댓글: Image Analyst 2018년 5월 24일
I have a image which is lena_half, 256*256*3, how can I use interp1 to enlarge it?
What I have done so far, but not working: %%
lena = double(imread('lena.tif'));
figure(6);
imshow(lena)
y_LenaHalf = double(imread('lena_half.tif'));
figure(7);
imshow(y_LenaHalf)
x2 = 1:256;
xi_2 = 1:(255/511):256;
yi_2 = interp1(x2, y_LenaHalf, xi_2);
yi2_2 = interp1(x2, yi_2.', xi_2).';
yii_2 = interp1(yi2_2, yi2.', xi_2);
figure(8);
imshow(uint8(yii_2))
SE2 = (lena - yii_2).^2;
MSE2 = mean(mean(SE2));
Also, there is an error: Error using .' Transpose on ND array is not defined. Use PERMUTE instead.

채택된 답변

KSSV
KSSV 2018년 5월 24일
  댓글 수: 5
KSSV
KSSV 2018년 5월 24일
I already mentioned there...it does interpolation along one dimension..you need to run another loop along column.....also...
Image Analyst
Image Analyst 2018년 5월 24일
Why? What are you not simply using imresize()? Why do it the hard way? Is it your homework that's forcing you to do it the least convenient way?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by