Author Topic: Adding high resolution data to lowere resolution image  (Read 1780 times)

Offline rdryfoos

  • PixInsight Old Hand
  • ****
  • Posts: 377
Adding high resolution data to lowere resolution image
« on: 2019 August 21 19:25:04 »
I Pixinsight how does one add higher resolution data to widefield images without losing the FOV?  I can add lowere resolution data to higher resolution data--but that is not what I want to do.  When ever I try it, I am left with an image that has the smaller images FOV.  Here is an example--these are only JPEGS so a demsonstration is not required.  I want to add the higher resolution TOA 130 data into the wider field lowere resolution FSQ data.

I know it can be done in photoshop--its done all the time.  I am sure it can be done in Pixinsight--but I have no idea how to do it

I have included liks to the two images--the size restriction of the web page is really a PITA

Wide field--I want to add the second image to this one

https://cdn.astrobin.com/thumbs/tzXaYGsDOqYb_16536x16536_wmhqkGbg.jpg

Higher resolution data--I want to add this data to teh first image

https://cdn.astrobin.com/thumbs/i7dzrQHIQSTB_16536x16536_wmhqkGbg.jpg

Please--anyone.....eveal the magic!!!!
Rodd

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Adding high resolution data to lowere resolution image
« Reply #1 on: 2019 August 21 20:35:28 »
start by registering the high-res image to the wider field image.

after that, well, maybe GradientsMergeMosaic would work, or at the very least pixelmath, to add the two images together.

rob

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Adding high resolution data to lowere resolution image
« Reply #2 on: 2019 August 21 21:00:49 »
ok what i did was register the high-res image to the low-res image, by drawing a preview approximately covering the area of the higher res image on the low-res image, then running staralignment with the low-res image as the reference.

then i made a mask with pixelmath : iif($T,1,0) to the registered image and applied the mask. this protects the black background for the next step: i used LinearFit to fit the registered high res image to the wide-field, with the mask applied.

then i saved the registered hi-res image to disk and ran gradientsmergemosaic against the wide-field and registered hi-res image. i then boosted the saturation in the resultant image thru an L mask.

https://cdn.astrobin.com/thumbs/HG8rmiT1otMF_16536x16536_wmhqkGbg.jpg

if you look real carefully you will see the seams - the high-res data has a higher SNR than the widefield.

rob

Offline rdryfoos

  • PixInsight Old Hand
  • ****
  • Posts: 377
Re: Adding high resolution data to lowere resolution image
« Reply #3 on: 2019 August 22 05:19:46 »
ok what i did was register the high-res image to the low-res image, by drawing a preview approximately covering the area of the higher res image on the low-res image, then running staralignment with the low-res image as the reference.

then i made a mask with pixelmath : iif($T,1,0) to the registered image and applied the mask. this protects the black background for the next step: i used LinearFit to fit the registered high res image to the wide-field, with the mask applied.

then i saved the registered hi-res image to disk and ran gradientsmergemosaic against the wide-field and registered hi-res image. i then boosted the saturation in the resultant image thru an L mask.

https://cdn.astrobin.com/thumbs/HG8rmiT1otMF_16536x16536_wmhqkGbg.jpg

if you look real carefully you will see the seams - the high-res data has a higher SNR than the widefield.

rob
  Thanks Rob-is this the normal way its done in PI?  It seems overly complicated and experimental.  I know this technique is employed very commonly.  I will try and remember what you said--but how about the settings for star alignment?  Would they be similar to registering for a mosaic?  What is the difference between creating a mask with pixel math (didn't even know that was possible) and creating a mask with the range selection tool?  Are there tutorials for Pixel Math usage?  There seems to be a very deep well of Pixel math potential, but I have never seen it documented anywhere.  A manual would be nice.  I don't think the supporting documentation for Pixel Math in PI contains very much beyond the simple use (if that).  I find that the supporting document tool is pretty lacking--most of the time there is none.
Thanks,
Rodd

Offline rdryfoos

  • PixInsight Old Hand
  • ****
  • Posts: 377
Re: Adding high resolution data to lowere resolution image
« Reply #4 on: 2019 August 22 06:48:16 »
ok what i did was register the high-res image to the low-res image, by drawing a preview approximately covering the area of the higher res image on the low-res image, then running staralignment with the low-res image as the reference.

then i made a mask with pixelmath : iif($T,1,0) to the registered image and applied the mask. this protects the black background for the next step: i used LinearFit to fit the registered high res image to the wide-field, with the mask applied.

then i saved the registered hi-res image to disk and ran gradientsmergemosaic against the wide-field and registered hi-res image. i then boosted the saturation in the resultant image thru an L mask.

https://cdn.astrobin.com/thumbs/HG8rmiT1otMF_16536x16536_wmhqkGbg.jpg

if you look real carefully you will see the seams - the high-res data has a higher SNR than the widefield.

rob
  Thanks Rob-is this the normal way its done in PI?  It seems overly complicated and experimental.  I know this technique is employed very commonly.  I will try and remember what you said--but how about the settings for star alignment?  Would they be similar to registering for a mosaic?  What is the difference between creating a mask with pixel math (didn't even know that was possible) and creating a mask with the range selection tool?  Are there tutorials for Pixel Math usage?  There seems to be a very deep well of Pixel math potential, but I have never seen it documented anywhere.  A manual would be nice.  I don't think the supporting documentation for Pixel Math in PI contains very much beyond the simple use (if that).  I find that the supporting document tool is pretty lacking--most of the time there is none.
Thanks,
Rodd
  One more thing--I would obvious want to do this in teh linear state prior to stretching.  Will the Pixel Math approach you describe work for linear data?  I probably should not have used JPEGS for example--but I do not have any suitable data at present
Rodd

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Adding high resolution data to lowere resolution image
« Reply #5 on: 2019 August 22 07:43:29 »
so in answer to your questions -

i don't know if this is the normal way to do it in PI; i just reasoned that gradientsmergemosaic could probably blend two datasets together nicely.

for star alignment - you don't need to do anything special, by default SA will create a new image that's as big as the reference image. in this case it will be mostly black with the higher-res image embedded where it belongs relative to the wide-field image.

you can pretty much do anything with pixelmath - i just noticed that when i did the linear fit, the black background of the registered image got shifted to some non-black color. this won't work right with GradientsMergeMosaic, so i knew i had to protect the black area. if you used rangemask most likely the mask would have soft edges or blurred edges and i wanted an exact mask, so i just told pixelmath to make a new image which is white wherever the target image is nonzero.

there are probably some pages out on the web with a lot of pixelmath stuff. you can google "david ault pixelmath" and you'll find some presentations he made. there are also a bunch of formulas floating around that give the same operations as that other program - dodge/burn, hard light, etc. for image combination.

this would all probably work better with linear data - linear fit will probably work better and also GMM was designed to run on linear data so the results will probably be better.

i just had another thought - it might make sense to use the mask to punch a black hole in the widefield image so that when GMM assembles the images that it's not blending the data. maybe it would make sense to reduce the size of the masked area a bit so that GMM has something to blend at the edges. you can most easily modify the mask with clonestamp, i would think.

rob


rob

Offline rdryfoos

  • PixInsight Old Hand
  • ****
  • Posts: 377
Re: Adding high resolution data to lowere resolution image
« Reply #6 on: 2019 August 22 07:51:01 »
so in answer to your questions -

i don't know if this is the normal way to do it in PI; i just reasoned that gradientsmergemosaic could probably blend two datasets together nicely.

for star alignment - you don't need to do anything special, by default SA will create a new image that's as big as the reference image. in this case it will be mostly black with the higher-res image embedded where it belongs relative to the wide-field image.

you can pretty much do anything with pixelmath - i just noticed that when i did the linear fit, the black background of the registered image got shifted to some non-black color. this won't work right with GradientsMergeMosaic, so i knew i had to protect the black area. if you used rangemask most likely the mask would have soft edges or blurred edges and i wanted an exact mask, so i just told pixelmath to make a new image which is white wherever the target image is nonzero.

there are probably some pages out on the web with a lot of pixelmath stuff. you can google "david ault pixelmath" and you'll find some presentations he made. there are also a bunch of formulas floating around that give the same operations as that other program - dodge/burn, hard light, etc. for image combination.

this would all probably work better with linear data - linear fit will probably work better and also GMM was designed to run on linear data so the results will probably be better.

i just had another thought - it might make sense to use the mask to punch a black hole in the widefield image so that when GMM assembles the images that it's not blending the data. maybe it would make sense to reduce the size of the masked area a bit so that GMM has something to blend at the edges. you can most easily modify the mask with clonestamp, i would think.

rob


rob
  Thanks!  One more thing--I didn't think there should be any 0 pixels in the image--space is not black.  I always try to render my "background space" a value of 0.06-0.10 (out of....not sure, they are numbers at the bottom of the screen.  I think it would be 233 out of 65,560).  So how would this effect the mask generation.  Just the fact that I can make a mask using pixel math is amazing.  Can one make a perfectly fitting star mask that way?  Currently I use MMT with nothing in level 1, 0.1 in levels 2,3 and 4, and level 5 eliminated--but that does not cover the larger stars.  Could pixel math do it?
Thanks,
Rodd

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Adding high resolution data to lowere resolution image
« Reply #7 on: 2019 August 22 08:16:26 »
well if you try this you'll see that what StarAlignment does is create a black image with the same dimensions as the widefield image, with the high-res image rotated and scaled sitting by itself in the middle. so the black i'm referring to is 100% artificial and since as you say space is not black, tools like GMM and ImageIntegration know to ignore black pixels.

as far as star masks go, yeah you could probably identify all the brightest pixels in the image with iif($T>0.98,1,0) and get an image with just a bunch of stars, then use wavelets to smooth the mask... however i think the easiest way to get a starmask these days is to use Starnet++ to create a starless image and then subtract it from the original image. that gives you essentially an image with just the stars, which you can then extract the L* from and modify from there.

rob

Offline rdryfoos

  • PixInsight Old Hand
  • ****
  • Posts: 377
Re: Adding high resolution data to lowere resolution image
« Reply #8 on: 2019 August 22 08:19:48 »
well if you try this you'll see that what StarAlignment does is create a black image with the same dimensions as the widefield image, with the high-res image rotated and scaled sitting by itself in the middle. so the black i'm referring to is 100% artificial and since as you say space is not black, tools like GMM and ImageIntegration know to ignore black pixels.

as far as star masks go, yeah you could probably identify all the brightest pixels in the image with iif($T>0.98,1,0) and get an image with just a bunch of stars, then use wavelets to smooth the mask... however i think the easiest way to get a starmask these days is to use Starnet++ to create a starless image and then subtract it from the original image. that gives you essentially an image with just the stars, which you can then extract the L* from and modify from there.

rob
  I see--you were not referring to space--but to the mask blackness.  Regarding Starnet++--that requires the use of additional software--something I try to avoid per the philosophy of PI (and also because I HATE learning new software and I cant afford to purchase new software, and I am a computer dunce)
Rodd

Offline dave_galera

  • PixInsight Addict
  • ***
  • Posts: 261
    • QDigital Astro
Re: Adding high resolution data to lowere resolution image
« Reply #9 on: 2019 August 22 08:38:03 »
Quote
  I see--you were not referring to space--but to the mask blackness.  Regarding Starnet++--that requires the use of additional software--something I try to avoid per the philosophy of PI (and also because I HATE learning new software and I cant afford to purchase new software, and I am a computer dunce)
Rodd

If you are on windoooze there is a process module so you don't have to use additional software, its all integrated in PI, and as Rob has intimated StarNet is brilliant at creating star masks.

Can't wait until we get process module on the Mac, this does need using additional software :sad:
Dave

Offline rdryfoos

  • PixInsight Old Hand
  • ****
  • Posts: 377
Re: Adding high resolution data to lowere resolution image
« Reply #10 on: 2019 August 22 08:50:39 »

  I see--you were not referring to space--but to the mask blackness.  Regarding Starnet++--that requires the use of additional software--something I try to avoid per the philosophy of PI (and also because I HATE learning new software and I cant afford to purchase new software, and I am a computer dunce)
Rodd
[/quote]

If you are on windoooze there is a process module so you don't have to additional software, its all integrated in PI
[/quote]  I am a self confssed computer dunce..I have no clue what that is, or how to manifest its properties.  I am on Windooze--but I only use the computer for data acquisition (Maxim DL), Focusing (Starlight Instruments), Flat frames (OPTEC I believe), Mount control (Astro physics and Cartes du ceil), and image processing (Pixinsight)--even though my laptop is absolutely chalk full of things I do not use but cannot remove from teh system.  I think this hobby needs a dose of engineering revamping--for example, mounts should be designed with ports below the mount headand outlets/ports in the mount plate so all electronics can be plugged into the mount and run to the scope/focuser/camera through the mount plate eliminating all cables to the scope.  Likewise--there should be a computer designed for astrophotography.  At present there are so many kinds of laptops and there is no constancy.  Juan is fond of saying (or perhaps hates saying but MUST say) that he can't duplicate a condition or error and that it is mostlike cuased by eth computer.  Astro photogrpahy needs its own computer that is resistant to cold and dew and operates the software we need (AND ONLY THE SOFTWARE WE NEED to collect and process images.
Rant over
Riodd

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Adding high resolution data to lowere resolution image
« Reply #11 on: 2019 August 22 09:07:34 »
primalucia makes some nice ruggedized computers that are meant to be put on the OTA... but of course they are still windows computers...

rob

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Adding high resolution data to lowere resolution image
« Reply #12 on: 2019 August 22 09:20:02 »
blowing away the area covered by the high-res image in the low res image did not work too well. i think GMM did not have any overlap to work with. using clonestamp to feather the mask used to zero out that part of the image did not make GMM happy. so what i did was clone the mask and then apply morphological transformation set to erosion and a perfectly square structuring element, which shrank the mask area by a few pixels, then i used that to zero out the middle area. GMM was happier with that but the seam in the final image is more obvious now because of the SNR differences. it might be better to just let GMM average the high res and low res images together, meaning, don't remove the core of the low-res image.

rob

Offline rdryfoos

  • PixInsight Old Hand
  • ****
  • Posts: 377
Re: Adding high resolution data to lowere resolution image
« Reply #13 on: 2019 August 22 09:29:26 »
primalucia makes some nice ruggedized computers that are meant to be put on the OTA... but of course they are still windows computers...

rob
Yes but doesnt hace Cortana, or speakers, or APP stores, or on and on and on.  One still needs a laptop though right?  The Primaluce has no screen, so I don't see it eliminating the problem--it improves the rig no doubt, but I am pretty happy with my rig--Its the computer connection that is the problem.  The rig is only as strong a its weakest link--even if the HULK is one of the links
Rodd

Offline rdryfoos

  • PixInsight Old Hand
  • ****
  • Posts: 377
Re: Adding high resolution data to lowere resolution image
« Reply #14 on: 2019 August 22 09:31:04 »
blowing away the area covered by the high-res image in the low res image did not work too well. i think GMM did not have any overlap to work with. using clonestamp to feather the mask used to zero out that part of the image did not make GMM happy. so what i did was clone the mask and then apply morphological transformation set to erosion and a perfectly square structuring element, which shrank the mask area by a few pixels, then i used that to zero out the middle area. GMM was happier with that but the seam in the final image is more obvious now because of the SNR differences. it might be better to just let GMM average the high res and low res images together, meaning, don't remove the core of the low-res image.

rob
I think the problem will go away if working with Linear data that is stretched to the same degree.  These were JPEGS so you were limited.  BTW--a complete replacement of data may not be a bad idea.  After all, for those higher resolution areas its the higher resolution image we want to see.  In this case that was most of the image, which is a bit unusual.   I am still not getting a warm an d fuzzy feeling and shouting "Yes, I can now put high resolution data into my low res images!"  For such a commonly performed task, it sure seems like the secrets are locked behind closed doors.  Am I to infer that the blasphemous statement "PS is better for some things" to be acknowledged? Come now--refute that nonsense.....