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

Add ellipse fitting example #3895

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

langestefan
Copy link

@langestefan langestefan commented Nov 27, 2024

Draft PR for the ellipse fitting example, will add code.

For this demo I took an image of the cartwheel galaxy captured by the James Webb space telescope:
James Webb Space Telescope images

It's a very general setup and multiple ellipse model definitions, optimization criteria and demo images can be defined.

To efficiently fit the ellipses I need to do some image preprocessing, some filtering and some clustering. For these tasks I used Clustering.jl, Images.jl and DSP.jl. Would it be okay to use these dependencies? I can come up with alternative implementations but it will be more messy.

After fitting the ellipses the final result looks like this:

afbeelding

@odow
Copy link
Member

odow commented Nov 27, 2024

This looks like a super cool (and visual) example.

No problem adding the extra packages. Just ensure they have a compat:

[compat]

Also: we need to make sure that the image we use can be redistributed. If possible, find the original source, instead of new scientist?

@langestefan
Copy link
Author

Yeah JWST really creates some breathtaking images!

Also: we need to make sure that the image we use can be redistributed. If possible, find the original source, instead of new scientist?

Found the source: https://webbtelescope.org/contents/media/images/2022/039/01G8JXN0K2VBQP112RNSQWTCTH

Unless otherwise stated, all material on the site was produced by NASA and the Space Telescope Science Institute (STScI). Material on this site produced by STScI was created, authored, and/or prepared for NASA under Contract NAS5-03127. Unless otherwise specifically stated, no claim to copyright is being asserted by STScI and material on this site may be freely used as in the public domain in accordance with NASA's contract. However, it is requested that in any subsequent use of this work NASA and STScI be given appropriate acknowledgement.

I'll make sure we add the acknowledgment.

@langestefan langestefan marked this pull request as ready for review December 12, 2024 02:40
@langestefan
Copy link
Author

langestefan commented Dec 12, 2024

@odow I tested it locally, it should run.

I have tried to follow the style guide based on other examples but might have missed something.

Maybe good to check if all the MOI calls are correct, and you will probably spot some improvements in JuMP syntax as well.

The final output should look like:
afbeelding

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.58%. Comparing base (00c3b35) to head (19d7678).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3895   +/-   ##
=======================================
  Coverage   99.58%   99.58%           
=======================================
  Files          43       43           
  Lines        6043     6043           
=======================================
  Hits         6018     6018           
  Misses         25       25           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@langestefan
Copy link
Author

All comments should be addressed now.

docs/Project.toml Outdated Show resolved Hide resolved
docs/src/tutorials/conic/ellipse_fitting.jl Outdated Show resolved Hide resolved
docs/src/tutorials/conic/ellipse_fitting.jl Outdated Show resolved Hide resolved
docs/src/tutorials/conic/ellipse_fitting.jl Outdated Show resolved Hide resolved
docs/src/tutorials/conic/ellipse_fitting.jl Show resolved Hide resolved
docs/src/tutorials/conic/ellipse_fitting.jl Outdated Show resolved Hide resolved
docs/src/tutorials/conic/ellipse_fitting.jl Outdated Show resolved Hide resolved
docs/Project.toml Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants