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

22 visualizaciones (últimos 30 días)
abid rashid
abid rashid el 26 de Abr. de 2017
Respondida: Jan el 26 de Abr. de 2017
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);

Respuestas (1)

Jan
Jan el 26 de Abr. de 2017
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?

Community Treasure Hunt

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

Start Hunting!

Translated by