-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fix DSPSIFT color pick #36
Conversation
Hey @originlake thanks for looking into this; have you found a test case (test images) where this error happens? Can you share it/them? I'd be curious to look into it as well. |
The datasets I have are under NDA, but let me see if I can pull some reproducible image data or find a public dataset has such issue. |
I read the source code of VLFeat. There is no pixel center issue related.
I can tell the issue will only happen at octave level -1 and reaches the max width( Lines 636 to 638 in 097ef20
Let me know your thoughts. |
I think the clipping solution is probably OK, but I don't fully understand why other detectors don't suffer from this issue. |
From what I can tell from SIFT implementation in OpenCV, it will ignore the keypoints on the border, the width of border is defined to 5 here |
We could implement the same border filter, but I don't know if it has good or bad effect. |
Ah, interesting! If other detectors ignore keypoints near the border, we should probably do something similar with DSP SIFT. |
I implemented the filter to remove border keypoints, also added one additional argument to control the border size, default is 5 as given in OpenCV's SIFT implementation. I think the most optimized and identical to OpenCV's logic way is to modify the VLfeat source code, but that's kind of out of my scope. Let me know if you plan to go that way, I'll close this PR. |
Awesome, thank you @originlake ! Modifying VLfeat is probably not needed for the scope of this. |
Hi, this PR tries to fix the issue for picking color of detected features.
The previous update #33 seems to make it easier to detect features at the edge. For example, assuming an image sized 1000x1000, vlfeat can produce feature point at [500, 999.65], rounding this coordinate will lead to out of bounds error when picking color with it.
I think this is related to pixel center, vlfeat might use (0.5, 0.5) as the center, maybe a better fix would be minus 0.5 before rounding? Not sure how other feature detectors deal with coordinates related pixel center, no such issue observed from other feature detectors.