フィルターのクリア

I am using the inbuilt MATLAB code for a vector, can anyone please tell me how to use the same code for images?

2 ビュー (過去 30 日間)
code is at http://in.mathworks.com/help/comm/ug/source-coding.html#fp6485
predictor = [0 1]; % y(k)=x(k-1)
partition = [-1:.1:.9];
codebook = [-1:.1:1];
t = [0:pi/50:2*pi];
x = sawtooth(3*t); % Original signal
% Quantize x using DPCM.
encodedx = dpcmenco(x,codebook,partition,predictor);
% Try to recover x from the modulated signal.
decodedx = dpcmdeco(encodedx,codebook,predictor);
plot(t,x,t,decodedx,'--')
legend('Original signal','Decoded signal','Location','NorthOutside');
distor = sum((x-decodedx).^2)/length(x) % Mean square error
this code is used for a saw tooth wave , if i want to apply the same on any image...then changes should be in?
  2 件のコメント
B.k Sumedha
B.k Sumedha 2015 年 5 月 23 日
What are u trying to achieve through that image?
tina jain
tina jain 2015 年 5 月 23 日
DPCM is basically a lossless image compression algorithm... I will use it to calculate compression ratio and PSNR.

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

採用された回答

Walter Roberson
Walter Roberson 2015 年 5 月 23 日
編集済み: Walter Roberson 2015 年 5 月 23 日
Replace
t = [0:pi/50:2*pi];
x = sawtooth(3*t); % Original signal
with
x = YourImage(:);
t = linspace(1, 2*Pi, length(x));
where YourImage is the name of the variable that holds your RGB image.

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by