seddik
seddik

Reputation: 229

how to use cvDCT() in opencv?

i'm trying to use the cvDCT function in opencv that make the descrete cosine transforme , but i don't know how can I use it ! plz give me an example in c++/opencv ??

Upvotes: 0

Views: 1592

Answers (1)

Ferguzz
Ferguzz

Reputation: 6087

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);

Upvotes: 1

Related Questions