ドキュメントに書かれているのを見たことがありませんが ( onhelp colfilt
も on もありません)、 、 as 、モノチャンネル イメージでdocs colfilt
のみ使用できると思います。で提供されているサンプル コードを 3 チャネル イメージで実行しようとする場合は、次のように言います。colfilt
nlfilter
help colfilt
I = imread('peppers.png'); % 'peppers.png' is just a demo color image usually provided with matblab
figure, imshow(I)
I2 = uint8(colfilt(I,[5 5],'sliding',@mean));
figure, imshow(I2)
投稿した種類のエラーが表示されます。
>= マトリックスの次元は一致する必要があります。
colfilt のエラー (135 行目) if all(block>=size(a)), % 一度に行列全体を処理します。
代わりにこれを実行すると、最初のチャネル (またはチャネルの他の組み合わせ) のみが使用されます。
% which is one of the example images usually provided with matlab
J = imread('peppers.png');
I = J(:,:,1);
figure, imshow(I)
I2 = uint8(colfilt(I,[5 5],'sliding',@mean));
figure, imshow(I2)
これが役立つことを願っています