dattalab / moseq2-pca

Code for computing pcs from extracted data to submit for modeling
Other
0 stars 1 forks source link

adding a command-line function for motion correction #41

Open wingillis opened 5 years ago

wingillis commented 5 years ago

I've found that even with the extraction smoothing parameters, sometimes there is a significant amount of mouse jitter between frames.

I propose an enhancement using opencv's findTransformECC function to perform image registration. 3 conditions must be met with this registration:

  1. code must correctly handle errors if the registration cannot converge
  2. a registration template must be applied to an entire dataset, so that each mouse is centered to the same reference point
  3. code must be able to handle cable masks, and apply the registration transformation to the cable mask as well, if it exists.

Please look here: https://github.com/wingillis/dls-net/blob/master/dls_net/cli.py#L120 for implementation ideas

wingillis commented 5 years ago

The current implementation runs at 200fps using translation-based registration, and much slower using euclidean-based registration (includes rotations)

jmarkow commented 5 years ago

This looks great. I'll incorporate this after merging the latest development version into master.

jmarkow commented 4 years ago

@wingillis do you want to make a PR for this?

wingillis commented 4 years ago

This needs to be tested in other use cases before it gets added, but I can take charge of implementing this feature