Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A question about the source code #9

Open
hgpvision opened this issue Feb 7, 2018 · 2 comments
Open

A question about the source code #9

hgpvision opened this issue Feb 7, 2018 · 2 comments

Comments

@hgpvision
Copy link

Hi, I have a question about the source code, and that is about the struct Normalize2D in which the function getTransform try to make mean zero and unit variance 2D points:
inline void getTransform(double T[3][3]) const { ... double stddevX = sqrt(mXX / N + eX*eX); //sf: this has to be done! double stddevY = sqrt(mYY / N + eY*eY); ... }
The way to compute the standard deviation looks a bit of strange to me. Should not it be:
double stddevX = sqrt(mXX / N - eX*eX); double stddevY = sqrt(mYY / N - eY*eY);
I changed and executed but I got a totally wrong result. I don't know why. Are there any skills? Thanks!!

@simbaforrest
Copy link
Owner

Thanks for the good catch. I believe this bug is inherited from the original Java code. In fact, according to experiments, setting the scaleX (1./stddevX) to 1 won't affect much of the performance. I'll fix this later.

As about your wrong results, I think it might be due to the fact that you only changed this part but didn't change the getInverseTransform function accordingly.

@hgpvision
Copy link
Author

I get it. Thanks so much. It's exactly that I didn't change the inverse one.^_^#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants