??? 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 Exchange에서 Geometric 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