フィルターのクリア

Matrix dimensions must agree error when using DCT2?

1 回表示 (過去 30 日間)
Harry West
Harry West 2020 年 12 月 8 日
回答済み: Abhishek Gupta 2020 年 12 月 14 日
Hi I am trying to use the dct2 function on some images. When I try to use the following code, I get the error "Matrix dimensions must agree," any ideas? Here's my code:
A = imread('IC1.png');
imshow(A);
D = dct2(A);
I am aware that I can get this to work if I use rgb2gray however I want to compress rgb images, is this not possible?

回答 (1 件)

Abhishek Gupta
Abhishek Gupta 2020 年 12 月 14 日
Hi Harry,
The 'dct2' function takes only a 2-D numeric matrix as input. Please see the documentation for more details: -
I am referring you to the following File Exchange link, which might resolve your issue: -

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by