Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Mosaic help please


Recommended Posts

I am intending to put together a mosaic this summer, probably using ImageJ. 

Is the correct procedure to process the images first and then stick them together, or do you stick them together and then process the resulting mosaic image?

Link to comment
Share on other sites

Only done one deep sky mosaic so far, with APP.

Was fairly straightforward, put all the subs and the calibration frames in and APP stitches them together into a single stack. Takes forever though as APP is quite slow for some reason.

  • Like 1
Link to comment
Share on other sites

20 minutes ago, Astro Noodles said:

Is the correct procedure to process the images first and then stick them together, or do you stick them together and then process the resulting mosaic image?

I have no experience of doing this in ImageJ but I have done a lot of mosaics in AstroPixelProcessor.

I've tried both approaches in APP and have found the best results are obtained by stacking, registering and integrating the individual panes and performing any light pollution correction and then combining the individual panes into the finished mosaic. APP does an amazing job of not only registering the individual panes (even from different camera/optics combinations) but also blending the background of the individual panes seemlessly.

P.S. This is the approach recommended in the Sara Wager tutorials using APP.

 

Edited by Adreneline
  • Like 4
Link to comment
Share on other sites

@Astro Noodles

Look at this page:

https://imagej.net/plugins/image-stitching

I know I've done mosaics before and it was rather easy to do, but I don't remember which exact plugin I used for that. Try out any of those listed on the page or do search for further plugins - like

http://bigwww.epfl.ch/thevenaz/mosaicj/

@Elp

Extract_Background.class

Above is plugin that I wrote for background extraction. Apparently, I don't have source code for it any more so above is compiled version - you should put it plugins folder of ImageJ/Fiji installation. It expects 32bit float point image (single channel - do each channel separately).

In principle - you should not use compiled code from untrusted sources, so it is up to you to decide if you want to use it.

Here is how it works:

image.png.0a2f8afad6e11c56632ae664cd41af16.png

It will open dialog with some basic parameters (which you can leave at default values - 99% of time these are good). You can uncheck "produce background map" if you don't need it - it is more debug feature to show what plugin determined to be background of the image.

After you run it - it will create two additional images - gradient and background map (or not - depending on what you checked).

image.png.1f57dba86cd090bf8b6d0cbd096ede91.png

Here is example performed on data from SGL (someone posted data for processing, can't remember which thread that was in).

Now you have to manually subtract gradient map from original image by using Process / image calculator like this:

image.png.b6dfc499ddf26725da69b495312da69b.png

(don't check new window to do it in place and check 32bit result).

After this - you can close gradient and background map and run this procedure few more times on the image. In each iteration background will be better defined and gradient residual will be smaller (and even change direction):

image.png.8a216926f8f52ede2d729dcc562fe5ab.png

(hover cursor over bright and dark parts of gradient map to see actual value of gradient - it should be fairly small compared to pixel values in the image I often stop when I reach ~1.0E-7 or E-8 (for data in 0-1 range. It usually takes only 3-4 rounds of this).

Do be careful when doing color images like this - this will make background have value of 0 and due to noise this means that some pixel values will actually be less then zero.

When processing RGB images - I measure all three and make values all positive by adding small offset (you can measure each image and determine what is the least value to add to all three to make all pixel values positive).

 

  • Thanks 2
Link to comment
Share on other sites

Hi @vlaiv and @Elp

I have got the ImageJ Fiji version downloaded and everything seems to be working fine.

I am trying to use the stitching function to create a mosaic image out of two images. but it just overlays them one on top of the other.

Can you let me know what I am doing wrong?

 

Link to comment
Share on other sites

8 minutes ago, Astro Noodles said:

I am trying to use the stitching function to create a mosaic image out of two images. but it just overlays them one on top of the other.

Can you let me know what I am doing wrong?

Can you be more specific of what you mean by overlying?

Does it create a stack with two slices - one having first image, and second slice -  being second image?

If so - what is the value of "missing" pixels in each image? Is it 0? If so - just do Image / Stacks / Z project and select sum.

This will add all images in stack to form single image.

  • Like 1
Link to comment
Share on other sites

 

So I have these two images which I want to combine into a single, larger image. As you can see, there is some overlap. I have selected Jpeg images so that I can see what I am doing.image.thumb.png.ea85cf3926a1395a6d951297f18db5cd.png

I have selected Pairwise stitching.

image.thumb.png.420b0f74e31c51888ef444269b4b2393.png

And then this box comes up - the files are correct. So I press ok.

image.thumb.png.b843852c213b416cf9e06ca2c217edc7.png

Then this box. I press ok.

image.png.0ad7c17dd0336ba8261149ce85b5669e.png

And this is the rather peculiar image which results.

image.png.d03b37762589b4feb35f8837015b02f4.png
 

Any chance you can let me know what I am doing wrong ?

Link to comment
Share on other sites

Can you post those two images, and I'll stitch them for you and post how I did that.

It is easier for me to work with actual data.

By the way - it looks like above stitching plugins don't handle rotation, so that is not very good. Maybe plugins for registration should be used instead.

 

  • Thanks 1
Link to comment
Share on other sites

Ok, so here is how it is done (but I'm not sure you'll like the result):

2022-05-26_16-03.png.2f3d0eb56cd726360064c23fcd99adb2.png

Select Descriptor based registration plugin

2022-05-26_16-03_1.png.ae631cca8e98b57d878a493a18fa5eac.png

select your images.

Now you want to adjust parameters. Here is problem with already stretched images (this big) as you get many stars - or rather many features (and noise) identified as maxima:

2022-05-26_16-05.png.b22e967bcefcd4d90b7ef793cf39c9c9.png

You want to bring those to reasonable measure. Select maxima only, select sigma 1 and sigma 2 and threshold until you get reasonable amount of stars. More stars means better precision - but much longer computation time. Usually 100 or so stars is best compromise.

2022-05-26_16-11.thumb.png.d9632b54351b404371ece070f4f57410.png

These plugins don't work well with color data and transform color data into RGB stack (where first slice is R, second is G, third is B). After registration is done - you get 6 slices - first three are channels of first image, and second three are channels of second image.

You now need to split those and manually combine each channel by using Image / Calculator and for example doing max method.

Alternative is to do this with each channel separately (process first red, then green then blue and compose in the end).

result.thumb.jpg.7e68ef40e4ac0658a456acfc2447d5a7.jpg

Above image is result.

Now there are few things wrong with the image. First is - subs are already stretched and are not normalized. This can be seen as difference in intensity. This is why you should do it on linear data instead.

Second is lens distortion. These images are very wide field and ImageJ stitching / registering can't handle lens distortion.

If we look at 100% zoom of overlapped region - you will see that some stars are aligned properly - but when you start approaching edge of the field - lens distortion kicks in and stars can't be aligned properly any more.

image.png.aaa6474acf48b33d95e38020866ad7e5.png

If you want to handle above case - you should really use Microsoft Ice for that. It handles already processed images and lens distortion.

 

  • Thanks 1
Link to comment
Share on other sites

Thanks very much Vlaiv - I will play around with it a bit.

Distortion is better than stacking in DSS:

image.thumb.jpeg.6646aa5c86dacf3c784771b49fb12db2.jpeg

Do you think it would work better if I cropped the images a bit first?

Edited by Astro Noodles
Link to comment
Share on other sites

37 minutes ago, Astro Noodles said:

Do you think it would work better if I cropped the images a bit first?

Definitively.

Distortion grows as a function of distance to the center.

This is actually normal thing - you can't map sphere to a plane without distortion. For small angles there is hardly any distortion - but when angles increase - distortion becomes apparent. If you keep only central region of your subs - then it will be minimal (this strictly depends on size of FOV - with large FOV you simply can't avoid distortion).

  • Like 1
Link to comment
Share on other sites

1 hour ago, vlaiv said:

By the way Microsoft Ice does wonders:

ice_stitch.thumb.jpg.edd8ed8abb27a7aeec66be8e270c1de6.jpg

That is the sort of result I would like. As far as I can tell, Microsoft ICE is no longer available (retired).

This is my best result with cropping and stacking in DSS

image.thumb.jpeg.7c533c770948d4dac91e679e2b05fbf2.jpeg

  • Like 1
Link to comment
Share on other sites

1 hour ago, Astro Noodles said:

Microsoft ICE is no longer available (retired).

I just got a copy from here: https://www.downloadcrew.com/download/9789/microsoft_image_composite_editor_64-bit

And stitched up the Moon https://stargazerslounge.com/topic/395271-moon-in-colour-stitched/#comment-4248205

 

Edited by Laurieast
Updated link for version 2.0.3.0
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, Astro Noodles said:

What does this mean I'm doing wrong please? 

You need to help it a bit

Select structured panorama option, and approximately align images your self.

image.png.31ca741f074884d614ab869e7b15f804.png

  • Thanks 1
Link to comment
Share on other sites

FWIW I used "New Panorama" on the Moon with four images. I'm guessing it found that an easy thing to do, and "Structured" as Vlaiv has shown is when it needs some help. 

What version of ICE did you get? I ask because yours looks different to mine in that yours has a dark background and mine is very light grey. Version 1.4.4.0

Edited by Laurieast
Link to comment
Share on other sites

7 minutes ago, Laurieast said:

FWIW I used "New Panorama" on the Moon with four images. I'm guessing it found that an easy thing to do, and "Structured" as Vlaiv has shown is when it needs some help. 

What version of ICE did you get? I ask because yours looks different to mine in that yours has a dark background and mine is very light grey. Version 1.4.4.0

Hi Laurence. It is version 1.4.4-for-64bit-Windows.

I am planning to add additional images to my Cygnus mosaic, so I might be back to ask for more help. Thanks for the tip re 'New Panorama.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.