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
Masked image translation registration #3330
Comments
@LaurentRDC cool package! You should present it at a SciPy conference! I would support inclusion of this if:
What do you think? |
Oh, another point: at scikit-image we use |
@jni Thank you for the feedback! I understand the need for n-dimensional operations and consistent mask definition. However, it seems you are advocating for including the masked image registration functionality inside of How would you feed about having a separate function? The masked normalized cross-correlation requires 6 FFTs and 6 IFFTs, while normalized cross-correlation requires 2 FFTs and 1 IFFTs. The performance difference is very noticeable, especially in my use case. I typically want to register ~3000 images to a reference, sometimes with masks and sometimes without. |
@LaurentRDC note that this is an API question, not an implementation question (though I would like to see as much code sharing as possible). But in the worst case you can do: def register_translation(src, target, ..., src_mask=None, target_mask=None):
if src_mask is None and target_mask is None):
result = register_translation_classic(src, target, ...)
else:
result = register_translation_masked(src, target, ...,
src_mask=src_mask, target_mask=target_mask)
return result |
Since #3334 has been merged, I'm closing this. |
I'd like to gauge interest in masked image translation registration.
I often have to register translation between diffraction patterns. However, there are static image elements that throw off standard approaches based on normalized cross-correlation, like
skimage.feature.register_translation
.I have implemented a normalized cross-correlation function that can take image masks as well, based on the following publication: D. Padfield. Masked object registration in the Fourier domain. IEEE Transactions on Image Processing (2012). The working principle is essentially the same as
skimage.feature.register_translation
, with the cross-correlation not taking into account the masked parts of images.You can find a successful registration example here.
I have already written a Python implementation that mimics
skimage.feature.register_translation
as much as possible:mnxc2
masked_register_translation
The function
masked_register_translation
above passes the exact same tests as the MATLAB implementation from the original author. It also gives the same results asskimage.feature.register_translation
in the case of trivial masks.I'd like to get some feedback regarding including this functionality directly in Scikit-image. The source code linked above provides a working starting point.
The text was updated successfully, but these errors were encountered: