??? Error using ==> size Not enough input arguments.

Hi,
I am using this code and getting size not enough input arguments can any one help me please. below is the code
im = imread('cow.jpg');
im = rgb2gray(im);
dx = [-1, 0, 1; -2, 0, 2; -1, 0, 1];
Ix = filter2(dx,im);
dy = [1, 2, 1; 0, 0, 0; -1, -2, -1];
Ix = filter2(dy,im);
Ix = conv2(double(im), dx, 'same');
Iy = conv2(double(im), dx, 'same');
g=fspecial('gaussian',[1 5],1.5);
% Step 2: Smooth space image derivatives (gaussian filtering)
Ix2 = conv2(Ix .^ 2, g, 'same');
Iy2 = conv2(Iy .^ 2, g, 'same');
Ixy = conv2(Ix .* Iy, g, 'same');
% Step 3: Harris corner measure
harris = (Ix2 .* Iy2 - Ixy .^ 2) ./ (Ix2 + Iy2);
% Step 4: Find local maxima (non maximum suppression)
mx = ordfilt2(harris, size.^ 2, ones(size));
% Step 5: Thresholding
harris = (harris == mx) & (harris >1000);
imshow(im);

回答 (1 件)

Jan
Jan 2017 年 4 月 26 日

0 投票

The line
mx = ordfilt2(harris, size.^ 2, ones(size));
must fail, because "size" is not a defined variable. Then Matlab tries to call the function size() and the input argument is missing.
What do you expect "size" to be here?

カテゴリ

ヘルプ センター および File ExchangeGeometric Transformation and Image Registration についてさらに検索

質問済み:

2017 年 4 月 26 日

回答済み:

Jan
2017 年 4 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by