30 Mart 2016 Çarşamba

Downsampling in Matlab

It seems easier algorithm instead of upsampling. here we are going to apply downsampling to our image in levels 0.5 , 0.25 , 0.12

subsamplerate=2 % for 0.5 we should use 2
Rim_sampled=Rim(1:subsamplerate:end,1:subsamplerate:end);
Gim_sampled=Gim(1:subsamplerate:end,1:subsamplerate:end);
Bim_sampled=Bim(1:subsamplerate:end,1:subsamplerate:end);
subsampledimage1=cat(3,Rim_sampled,Gim_sampled,Bim_sampled);

subsamplerate=4 % for 0.25 we should use 2
Rim_sampled=Rim(1:subsamplerate:end,1:subsamplerate:end);
Gim_sampled=Gim(1:subsamplerate:end,1:subsamplerate:end);
Bim_sampled=Bim(1:subsamplerate:end,1:subsamplerate:end);
subsampledimage2=cat(3,Rim_sampled,Gim_sampled,Bim_sampled);

subsamplerate=8 % for 0.12 we should use 2
Rim_sampled=Rim(1:subsamplerate:end,1:subsamplerate:end);
Gim_sampled=Gim(1:subsamplerate:end,1:subsamplerate:end);
Bim_sampled=Bim(1:subsamplerate:end,1:subsamplerate:end);
subsampledimage3=cat(3,Rim_sampled,Gim_sampled,Bim_sampled);

figure(49);imshow(im);
figure(50);imshow(subsampledimage1);
figure(51);imshow(subsampledimage2);
figure(52);imshow(subsampledimage3);

Hiç yorum yok:

Yorum Gönder

konuyla ilgili yorumlarınızı bu alana yazabilirsiniz.
you can write your comments to this area about the topic.
potete scrivere i vostri commenti a questa zona circa argomento

JAVA DIARY - 2

Class kodlarının içersinde ana fonksiyonumuzu public static void main olarak tanımlıyoruz. Parantezler içersinde görüldüğü gibi String[] ar...