Undefined function 'dyaddown' for input arguments of type 'uint8'.

Getting the error:
Undefined function 'dyaddown' for input arguments of type 'uint8'.
Code is:
%Clear command window.
clc;
%Clear workspace.
clear;
%Load the Lena file.
RGB = imread ('Lena.tiff');
%Display the result of the conversion.
figure, imshow(RGB);
%Convert RGB image to YCbCr Components.
YCbCr = rgb2ycbcr(RGB);
%Isolate Y.
Y = YCbCr(:,:,1);
%Isolate Cb.
Cb = YCbCr(:,:,2);
%Isolate Cr.
Cr= YCbCr(:,:,3);
%downsample
dem = dyaddown(Cb,1,'m') % Downsample rows and columns
% with odd indices.
Why is this? How to I fix it?
Many thanks.

 採用された回答

Image Analyst
Image Analyst 2015 年 4 月 7 日

0 投票

I've never heard of dyaddown(). If you want to subsample Cb to get only the odd indexes and end up with an image 1/4 as big, do this:
dem = Cb(1:2:end, 1:2:end); % Extract only odd indexes.
For even indices, do this:
dem = Cb(2:2:end, 2:2:end); % Extract only even indexes.

6 件のコメント

Alexander De-Ville
Alexander De-Ville 2015 年 4 月 7 日
Thank you very much, this works perfectly.
This is where I found dyaddown:
There is also dyadup, but this does not work either for the same reason.
What would be the best way to upsample?
This exists:
But it only works in one dimension instead of x and y.
Thank you again!
Image Analyst
Image Analyst 2015 年 4 月 7 日
編集済み: Image Analyst 2015 年 4 月 8 日
It's in the Wavelet Toolbox. Do you have that? Type ver on the command line to check.
Alexander De-Ville
Alexander De-Ville 2015 年 4 月 8 日
Marked as accepted!
I have:
  • MATLAB Version 7.14 (R2012a)
  • Simulink Version 7.9 (R2012a)
  • Control System Toolbox Version 9.3 (R2012a)
  • Curve Fitting Toolbox Version 3.2.1 (R2012a)
  • DSP System Toolbox Version 8.2 (R2012a)
  • Image Processing Toolbox Version 8.0 (R2012a)
  • Optimization Toolbox Version 6.2 (R2012a)
  • Signal Processing Toolbox Version 6.17 (R2012a)
  • Simulink Control Design Version 3.5 (R2012a)
  • Statistics Toolbox Version 8.0 (R2012a)
  • Symbolic Math Toolbox Version 5.8 (R2012a)
Image Analyst
Image Analyst 2015 年 4 月 8 日
So it looks like you don't have the wavelet toolbox so you can't run that particular function.
Alexander De-Ville
Alexander De-Ville 2015 年 4 月 8 日
Silly me. Any hints on the upsampling issue?
What would be the best way to upsample?
This exists:
But it only works in one dimension instead of x and y. So cant undo 4:2:2 encoding.
Thank you again!
Image Analyst
Image Analyst 2015 年 4 月 9 日
You can use imresize() to specify the size of the output image you'd rather have.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeWavelet Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by