float data[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
CvMat a, b, c;
a = cvMat(2,4,CV_32FC1,data);
b = cvMat(2,4,CV_32FC1,data); // or initialize b,c
c = cvMat(2,4,CV_32FC1,data);
cvDCT(&a, &b, CV_DXT_FORWARD);
cvDCT(&b, &c, CV_DXT_INVERSE);
original matrix:
1 2 3 4
5 6 7 8
after DCT:
12.728 -3.154 0.000 -0.224
-5.657 0.000 0.000 0.000
after IDCT:
1 2 3 4
5 6 7 8
This comment has been removed by the author.
ReplyDeletehi, can u teach me how to extract the coefficients of the DCT using openCV?? thanks alot!
ReplyDeletemy email is kentona7@yahoo.com
ReplyDeleteThanks!
well, aren't these values DCT coefficients ?
ReplyDeletei'm new to opencv but how did you display the values of the dct and it's inverse?
ReplyDelete