PySIFT icon indicating copy to clipboard operation
PySIFT copied to clipboard

Mikhail

Open MikhailMashukov opened this issue 5 years ago • 2 comments

Hello Sam!

I have optimized your PySift, rewrote through numpy candidates searching and filtering. The former one speeded up like 100x :) This was more out of curiosity, generally I only need to understand SIFT and maybe try to tune/change a bit. I am experimenting with features matching on 3D images in meshroom.

I have added some debug plotting and left old code (but some of it is useful for correctness checking). So you'll apparently want to clean up in your style before merging.

Did you sorted out this? # These 2 lines aren't specified in the paper but it makes it so the extrema # are found within the entire octave. They are always found in the first or # last layer so I probably have something wrong with my DoG pyramid construction. ... Now I see that your algorithm behaves differently than meshroom's one. It likes edges very much, filtering out 99.9% of candidates by t_c. We can discuss if you are interested, e.g. by Sk ype, my login is mmashukov.

Regards, Mikhail

MikhailMashukov avatar Jun 30 '20 13:06 MikhailMashukov

First of all, thank you for the contributions. That speedup is amazing! I'm interested to see what you did but I'll definitely need some time to go through the changes. In the meantime, do you think you could clean up the code a bit (remove commented-out, fix some indentation, etc.)?

SamL98 avatar Jun 30 '20 15:06 SamL98

Thank you!

There is no much code actually. I suppose generally you don’t need to investigate separated commits, it’s enough to compare all changes at once. I have left some old code so you could see the process of changing. I didn’t make bad indentations intentionally, maybe we simply have different styles

Main trick is with candidates searching. We have a 333 cube for each pixel for which we want get maximum. By collapsing 3 subarrays, starting e.g. from different k, 0, 1, 2, we get width 3 by k axis instead of 5, but each element contains maximum of 3 source elements. Then we unite similarly by j and get maximum of 9 pixels in each element. But since we also need maximum of some pairs instead of triades (when the center element falls into them), I use some intermediate results too. And surprisingly this way we can finally get maximums of all surrounding 26 pixels in one element.

From: SamL98 Sent: Tuesday, June 30, 2020 10:37 PM To: SamL98/PySIFT Cc: MikhailMashukov ; Author Subject: Re: [SamL98/PySIFT] Mikhail (#6)

First of all, thank you for the contributions. That speedup is amazing! I'm interested to see what you did but I'll definitely need some time to go through the changes. In the meantime, do you think you could clean up the code a bit (remove commented-out, fix some indentation, etc.)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

MikhailMashukov avatar Jul 01 '20 05:07 MikhailMashukov