how i can do sub-sampling for an image with factor 4

 採用された回答

Youssef  Khmou
Youssef Khmou 2013 年 2 月 26 日
編集済み: Youssef Khmou 2013 年 2 月 26 日

0 投票

hi ,
you can use the function " downsample" twice ,
example :
I=imread('circuit.tif');
J=downsample(I,4);
J=downsample(J',4)';
whos I J
imshow(J)
figure, imshow(I)
Size(I)= 4² * Size(J) .

2 件のコメント

Wayne King
Wayne King 2013 年 2 月 26 日
編集済み: Wayne King 2013 年 2 月 26 日
keep in mind that downsample() in the Signal Processing Toolbox only downsamples the matrix along the row dimension.
Youssef  Khmou
Youssef Khmou 2013 年 2 月 26 日
yes Wayne, thanks for reminding , i edited the code .

サインインしてコメントする。

その他の回答 (1 件)

Wayne King
Wayne King 2013 年 2 月 26 日

0 投票

Do you want to downsample along the row dimension, along the column dimension, or both?
X = randn(24,24);
% Along row only
Im = X(1:4:end,:);
% Along column dim only
Im = X(:,1:4:end);
% Along both
Im = X(1:4:end,1:4:end);
Keep in mind that the above gives only one "phase" of the downsampling. When downsampling by M, there are M such phases. To see an illustration of this for a 1-D signal, see

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by