Problem with imresize function

조회 수: 7 (최근 30일)
Elliot Wyllie
Elliot Wyllie 2021년 3월 1일
답변: Elliot Wyllie 2021년 3월 1일
Heres my code, I wasnt having an issue with this until i added the midterm function and all the parameters. When i hardcoded the pictures and numbers i needed it worked perfectly but now it keeps giving me an error on line 3. Im really new to matlab and I dont have an prior programming knowlege so im just generally confused here. Any help?
function [] = midterm(imageFile1,imageFile2, scale, margin)
IM2 = imresize(imageFile2, scale);
IM2(1:margin,:,:) = 255;
IM2(end-margin+1:end,:,:) = 255;
IM2(:,1:margin,:) = 255;
IM2(:,end-margin+1:end,:) = 255;
image(imageFile1)
hold on;
image(2337, 1000, IM2)
end
  댓글 수: 1
Elliot Wyllie
Elliot Wyllie 2021년 3월 1일
btw this is what i use to call the function
midterm('blue-lake.jpg', 'portrait.jpg', 2, 50)

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

채택된 답변

Elliot Wyllie
Elliot Wyllie 2021년 3월 1일
Figured it out, im passing the name of the picture instead of passing the image itself. Should be using imread!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by