What need to be input for S in ordfilt2?

9 vues (au cours des 30 derniers jours)
Kasy
Kasy le 10 Avr 2013
The coding are as follows:
>> I=imread('sample01.tif');
>> B = ordfilt2(I,1,ones(3,3),[3 3]);
??? Index exceeds matrix dimensions.
Error in ==> ordfilt2>ParseInputs at 132
s = s(find(domain));
Error in ==> ordfilt2 at 51
[A,order,domain,s,padopt,msg] = ParseInputs(varargin{:});
Do i need to input matrix dimension for S? (For references)
How do i know in terms of which parameter and value for ordfilt2 and other image enhancement method works besides the help section?

Réponses (1)

Jan
Jan le 10 Avr 2013
S must have the same size as the domain, see doc ordfilt2. So when your domain is ones(3,3), S must be a [3 x 3] matrix also.

Catégories

En savoir plus sur Image Filtering and Enhancement dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by