ginga icon indicating copy to clipboard operation
ginga copied to clipboard

Add precise image warping to Mosaic plugin

Open ejeschke opened this issue 2 years ago • 12 comments

This adds an option to the Mosaic plugin to warp images precisely according to the WCS of the reference image. This option is slower than the standard rotate/flip mosaicing, but can produce more accurate mosaics, especially when there is some distortion near the edge of the field.

The same functionality was previously added to the Collage plugin.

ejeschke avatar May 05 '22 05:05 ejeschke

Left todo: tile labelling

ejeschke avatar May 07 '22 02:05 ejeschke

labeling fixed

ejeschke avatar May 10 '22 20:05 ejeschke

@pllim, it should be in good enough shape for you to test now. I think your org has a plugin that is a subclass of this, right?

Probably there are some more things to fix or work out for backward compatibility. For example, it now creates an alpha mask in the mosaic image so that the empty space between the tiles does not show. But we might need to strip it off for saving the result mosaic? Let me know how it breaks things for you! :smile_cat:

ejeschke avatar May 14 '22 03:05 ejeschke

Rebased

ejeschke avatar May 17 '22 02:05 ejeschke

Thanks, I'll put this in my queue to review. 😸

pllim avatar May 18 '22 13:05 pllim

Thanks, I'll put this in my queue to review. smile_cat

Take your time. I propose to bump this forward for release 4.0 in the fall.

ejeschke avatar May 19 '22 23:05 ejeschke

@ejeschke , sorry this slipped through. Are you still waiting for my review? Would you mind rebasing? Thanks!

pllim avatar Aug 11 '22 21:08 pllim

Rebased. No hurry on this one, @pllim!

ejeschke avatar Aug 12 '22 00:08 ejeschke

This should still be considered a draft PR.

ejeschke avatar Aug 12 '22 00:08 ejeschke

I checked out this branch, using dev version of stginga, and dev version of wss_tools. I loaded over 300 small images. Then I used MosaicAuto plugin for this workflow: https://wss-tools.readthedocs.io/en/latest/wss_tools/quip/usage_thumbs.html

https://wss-tools.readthedocs.io/en/latest/wss_tools/quip/mosaicauto.html

I get this error:

AssertionError
Non-GUI thread (...) is executing GUI (...) code!  File ".../ginga/ginga/rv/Control.py", line 424, in error_wrap
    return method(*args, **kwargs)

  File ".../ginga/rv/plugins/Mosaic.py", line 484, in mosaic
    self.fv.assert_gui_thread()

  File ".../ginga/ginga/gw/GwMain.py", line 224, in assert_gui_thread
    assert my_id == self.gui_thread_id, \

There is no error with the same images using dev version of Ginga instead of this branch.

pllim avatar Aug 22 '22 21:08 pllim

Kicked down the road to release 4.1

ejeschke avatar Aug 26 '22 04:08 ejeschke

Rebased

ejeschke avatar Feb 22 '24 00:02 ejeschke