??? 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 个)

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 Exchange 中查找有关 Geometric Transformation and Image Registration 的更多信息

回答:

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