error in dct transform for ycbcr color image
2 次查看(过去 30 天)
显示 更早的评论
when i perform dct2 for an image in ycbcr color space i get the following error.. i dunno wat i should define before takin transform..pls help me..
??? Error using ==> unknown Matrix dimensions must agree.
Error in ==> images\private\dct at 79 b = W .* fft(y);
Error in ==> dct2 at 50 b = dct(dct(arg1).').';
0 个评论
采纳的回答
Walter Roberson
2011-3-4
If you read the documentation for dct2 carefully, it all implies that the image must be 2D rather than 3D. That is, you cannot use dct2 on an RGB or YCrCb image, except perhaps color plane by color plane.
Notice how the example uses rgb2gray() on the sample image, which should correspond to the luminosity information in the Y channel. You could do something like locate the dct2 Y, Cr, and Cb separately, but figure out based upon the Y channel which locations to zero out, and zero those locations out in all 3 dct2 results. Then idct2 each back and splice together the results to get the new YCrCb matrix.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!