Not enough input arguments?

조회 수: 2 (최근 30일)
Andrew Killian
Andrew Killian . 2021년 10월 4일
답변: Walter Roberson . 2021년 10월 5일
The documentation for imresize has only two/three arguments at most. But when I run this code I get "error not enough input arguments" for line 6.
function [scores, result_image] = chamfer_search(edge_image, template, scale, number_of_results)
% occurrence = size(template) * scale;
edge_image = read_gray('clutter1_edges.gif');
template = read_gray('template.gif');
template = imresize(template, scale, 'bilinear');
% tsize = size(template);
[r, c] = size(template);
% trows = tsize(1);
% tcols = tsize(2);
% imshow(edge_image);
D1 = bwdist(edge_image);
D2 = bwdist(template);
% imshow(D1, []);
i = 10; j = 30;
window = D1(i:(i+r-1), j:(j+c-1));
sum(sum(t1 .* window));
% ---
% image = read_gray('clutter1.bmp');
% figure(1); imshow(image, []);
% e1 = canny(image, 7);
% figure(2); imshow(e1);
  댓글 수: 1
Image Analyst
Image Analyst 2021년 10월 5일
What does this show
whos template
whos scale
whos imresize

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

답변 (1개)

Walter Roberson
Walter Roberson 2021년 10월 5일
Are you possibly using a fairly old version of MATLAB? If you were using a version that is too old to know about the 'bilinear' method, then MATLAB would think that you have put an option name but not a corresponding option value, and so would complain about needing more arguments.
'bilinear' appears to be defined as far back as R2016b, which is the earliest version I have handy to check.

Community Treasure Hunt

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

Start Hunting!

Translated by