Ask Your Question
0

mulSpectrums

asked 2016-07-12 13:59:32 -0600

HiHello gravatar image

what is the result of mulSpectrums? if input A = a+bi input B = c+di mulSpectrums(A, B, result, CV_DXT_MUL_CONJ, true)

then, result = (a+bi)(c-di)?? or just result = bi(-ci)??

Also what type of input is better? InputArray can be IplImage? CvMat? Mat? Also for the function mulSpectrums, input should be 2 channels? for real part and imaginary part??

if you dont mind, could you explain about the differences of those three data types?(IplImage, CvMat, Mat)

i also read this, but im not an English speaker. so it is hard tho. image description

I started just 1 week ago.

Please explain it as much as you can. Thanks a lot.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-07-12 14:21:26 -0600

LBerger gravatar image

with this program

Mat z1(1,2,CV_32FC2),z2(1,2,CV_32FC2),z3;

z1.at<Vec2f>(0, 0) = Vec2f(1,1);//1+i
z1.at<Vec2f>(0, 1) = Vec2f(2,3);//2+3i
z2.at<Vec2f>(0, 0) = Vec2f(2,1);//2+i
z2.at<Vec2f>(0, 1) = Vec2f(3, 3);//3+3i

mulSpectrums(z1,z2,z3,0);
cout<<z3;//(1+i)*(2+i) and (2+i)*(3+3i)
waitKey();

result is

*

[1, 3, -3, 15] //(1+i)(2+i) and (2+i)(3+3i)

*

edit flag offensive delete link more

Comments

Thanks! then, how can i change IplImage* to that form?

do i have to use "for loop"?

CvMat* freq;

For example, (R0, I0), (R1, I1), (R2, I2), (R3, I3)..(Rn,In)

freq->data.db[0] means R0,freq->data.db[1] means I0,

freq->data.db[2] means R1,freq->data.db[3] means I1,

freq->data.db[4] means R2,freq->data.db[5] means I2, ...

something like this. i dont know how to convers that data to Vec form.

HiHello gravatar imageHiHello ( 2016-07-12 16:44:34 -0600 )edit

In opencv doc 3.1 : CvMat is now obsolete; consider using Mat instead.

I never use lpImage in Opencv 3.1 because I never need it use Mat (or UMat when you know what you want)

inputArray

LBerger gravatar imageLBerger ( 2016-07-13 02:02:28 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-07-12 13:59:32 -0600

Seen: 4,352 times

Last updated: Jul 12 '16