Two dimensional discrete cosine transform
B = dct2(A) B = dct2(A, m, n)
Real or complex vector/matrix/array.
Real or complex vector/matrix/array.
positive integer (number of rows).
positive integer (number of columns).
B = dct2(A) returns the two dimensional discrete cosine transform of a. Size of b and a are same. B = dct2(A, m, n) returns the two dimensional discrete cosine transform of a having size m-by-n by padding or truncating the size of a before transformation.
<p class="para">Besides the usage of the 2-D DCT as part of image compression algorithms, it is widely used as feature extraction or dimensionality reduction method in pattern recognition applications, in image watermarking and data hiding and in various image processing applications.</p> Image_RGB = imread('image.tif'); Image_I = im2gray(Image_RGB); Image_J = dct2(Image_I); imshow(Image_J); | ![]() | ![]() |