You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @rockkingjy thx for your sharing great work. I have a question about the "complexDotDivision" function. In my opinion, if a and b are two complex,
a = a0 + a1i
b = b0 + b1i
then a/b = (a0 + a1i) / (b0 + b1i)
= [(a0 + a1i)(b0 - b1i)] / [(b0 + b1i) (b0 - b1i)]
=[(a0b0+a1b1)+(a1b0-a0b1)i] / (b0^2+b1^2)
and I look your code is: cv::Mat divisor = 1. / (pb[0].mul(pb[0]) + pb[1].mul(pb[1]));
std::vectorcv::Mat pres;
pres.push_back((pa[0].mul(pb[0]) + pa[1].mul(pb[1])).mul(divisor));
pres.push_back((pa[1].mul(pb[0]) + pa[0].mul(pb[1])).mul(divisor));
I think the last row code: pres.push_back((pa[1].mul(pb[0]) + pa[0].mul(pb[1])).mul(divisor));
should be: pres.push_back((pa[1].mul(pb[0]) - pa[0].mul(pb[1])).mul(divisor));
and I watch some realistic value about "pa[0].mul(pb[1])", they are nearly zeros, so the sign '+' or '-' doesn't matter. How do you think of it :)
The text was updated successfully, but these errors were encountered:
Hi @rockkingjy thx for your sharing great work. I have a question about the "complexDotDivision" function. In my opinion, if a and b are two complex,
a = a0 + a1i
b = b0 + b1i
then a/b = (a0 + a1i) / (b0 + b1i)
= [(a0 + a1i)(b0 - b1i)] / [(b0 + b1i) (b0 - b1i)]
=[(a0b0+a1b1)+(a1b0-a0b1)i] / (b0^2+b1^2)
and I look your code is:
cv::Mat divisor = 1. / (pb[0].mul(pb[0]) + pb[1].mul(pb[1]));
std::vectorcv::Mat pres;
pres.push_back((pa[0].mul(pb[0]) + pa[1].mul(pb[1])).mul(divisor));
pres.push_back((pa[1].mul(pb[0]) + pa[0].mul(pb[1])).mul(divisor));
I think the last row code:
pres.push_back((pa[1].mul(pb[0]) + pa[0].mul(pb[1])).mul(divisor));
should be:
pres.push_back((pa[1].mul(pb[0]) - pa[0].mul(pb[1])).mul(divisor));
and I watch some realistic value about "pa[0].mul(pb[1])", they are nearly zeros, so the sign '+' or '-' doesn't matter. How do you think of it :)
The text was updated successfully, but these errors were encountered: