-
Notifications
You must be signed in to change notification settings - Fork 33
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
Refactor intensity matching #200
base: newsolver
Are you sure you want to change the base?
Conversation
I finally got a chance to test my changes on a real example (a 2x7 two-layer honeycomb setup from the latest multi-sem project). As expected, the results are not that dramatic, but even in this example the time for matching and outlier removal decreased from 2.4s to 1.0s. In addition, I introduced an Nevertheless, introducing this class reduces the overhead in the concurrent optimizer (since the optimizer has to care about less tiles) and saves ~30% runtime there. My guess is that this effect will be even more pronounced with larger stacks. As a side effect, also the code looks much more readable to me, now. To check the validity of my optimizations, I compared the result before the optimizations with 1) after the introduction of |
I tested this on a full multi-sem stack (w60_s296_r00_d00_align). The results for 4 nodes (2x5+1 cores each, totaling 44 cores):
Neuroglancer links for the resulting stacks can be found here: before and after. They look the same to me. Do you think this is good to be merged @trautmane & @StephanPreibisch? |
I played around with the intensity match derivation process and introduced two optimizations:
nBins x nBins
bins (where I tentatively setnBins = 256
). All matches in one bin result in a single match with a weight that equals the sum of all original matches in that bin. I am aware that this introduces a discretization error, but since the number of bins is sufficiently large, the effect should be small. Reducing the number of bins further improves the runtime, trading off accuracy.Point
andPointMatch
for 1D points. Since there are a lot of static and final methods in the originalPoint
class, there's only so much that one can specialize, but all methods that are called in the intensity matching process make full use of the optimizations.I tested the impact of these changes on a randomly chosen neighboring pair of images from some fibsem stack, using the parameters that were specified in the alignment-prep files for that project.
For this tile pair, the matching process (including RANSAC filtering) took 2.36s with a single core on my local machine. Of this, the rendering accounted for 0.95s, while the RANSAC filtering took 1.38s. The optimizations described above resulted in the following runtime improvements for the RANSAC filtering:
My chosen example might not be a representative test case. Maybe @trautmane can help me set up a test case for multi-sem so that we can make sure the changes didn't introduce bugs and see how much we gain in this case. @StephanPreibisch