Skip to content
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

Image moments tutorial #58

Open
lmmx opened this issue Jun 23, 2021 · 3 comments
Open

Image moments tutorial #58

lmmx opened this issue Jun 23, 2021 · 3 comments

Comments

@lmmx
Copy link
Contributor

lmmx commented Jun 23, 2021

As discussed a couple months back I've put together a tutorial on image moments from some notes for a particular project. I've put it in its own repo here for now and can submit a PR when it's improved and meets the format for this repo.

Tutorial outline

  • The tutorial gives a background introducing what image moments are and then shows how to calculate them in scikit-image.
    • Since it's reasonable(?) to assume images are going to be discrete when working with scikit-image, I quickly dropped the integral notation for summation
  • After the technical intro, there's a practical extension on drawing a "clock" and showing how it's possible to "tell the time" (or not quite!) by using the orientation obtained from SVD on the covariance matrix formed from the 2nd order central moments matrix.
  • Lastly there's a brief note on some further reading where the topic can be explained in greater depth

Interactivity

I used ipywidgets to make an interactive slider so the "clock hand" could be moved around and the effect on the image moment-derived orientation could be observed directly by the reader, however all the web platforms I've looked at seem to remove this functionality and I've saved the widget state so it's now viewable on nbviewer

Screenshot from 2021-06-23 15-33-37
Screenshot from 2021-06-23 15-33-16

The interactive widgets are usable in Binder (I used f strings so it requires 3.8 and binder default is 3.7 so I had to specify that in an environment.yml file) after a bit of investigation!

It's just a first draft and I'll take a look at the style guides for how to clean this up for publishing, thoughts welcome! 😃

@stefanv
Copy link
Member

stefanv commented Jun 23, 2021

Very nice, thanks @lmmx!

Perhaps @alexdesiqueira would be interested too. Alex, how far are we from porting notebooks like these to markdown for inclusion in the tutorials repo?

@alexdesiqueira
Copy link
Member

Thank you @lmmx, it's a great tutorial already!
@stefanv not that far, according to what we discussed last week. It would require a couple of hands-on hours, though; I'll schedule a couple of hours for that tomorrow.

@jni
Copy link
Member

jni commented Jun 29, 2021

So cool! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants