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

Calculated Scales for ACF-Pyramid are wrong #62

Closed
JN-Jones opened this issue May 15, 2018 · 2 comments
Closed

Calculated Scales for ACF-Pyramid are wrong #62

JN-Jones opened this issue May 15, 2018 · 2 comments
Labels

Comments

@JN-Jones
Copy link

I noticed earlier that calculating the pyramid with the same parameters on the same image returns a different number of scales when using this library and when using the original matlab code. After some debugging I found that d0 and d1 are apparently the opposite of what they are in the original code:

My image is 500px in width and 375px in height, the original code is if(sz(1)<sz(2)), d0=sz(1); d1=sz(2); else d0=sz(2); d1=sz(1); end with sz = [375 500] which results in d0 = 375; d1 = 500 (or in general: d0 is the smaller dimension and d1 the larger).

However the code here is:

double d0 = sz.height, d1 = sz.width;
if (sz.height < sz.width)
{
    std::swap(d0, d1);
}

Which results in the d0/d1 swapping only happening when d0 is already the smaller value. In my case d0 = 500 and d1 = 375.

This resulted in 34 instead of 33 scales. Simply changing that if in a way that d0 is always the smaller value fixed the issue (either by changing the initialization or by using >=).

headupinclouds added a commit that referenced this issue May 15, 2018
Fix by @JN-Jones described in #62
@headupinclouds
Copy link
Contributor

Thanks again: #63

headupinclouds added a commit that referenced this issue May 15, 2018
* fix pyramid scales

Fix by @JN-Jones described in #62

* bump version
@headupinclouds
Copy link
Contributor

merged

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

No branches or pull requests

2 participants