gradientmergemosaic · 2 / wer bin ich? 52 jahre pixinsight seit 2007 astronomie seit 2005 software...

94
GradientMergeMosaic Georg Viehöver 28.4.2017 PixInsight Österreich VII

Upload: others

Post on 26-Oct-2019

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

GradientMergeMosaic

Georg Viehöver

28.4.2017

PixInsight Österreich VII

Page 2: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

2 /

Wer bin ich?

●52 Jahre

●PixInsight seit 2007

●Astronomie seit 2005

●Software Entwickler

–C++, HPC

●Please tell me if I switch

to English...

Page 3: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

3 /

Who am I?

●52 years old

●PixInsight since 2007

●Astronomy since 2005

●Software Developer

–C++, HPC

Page 4: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

4 /

„Low-Tech“ Astronomie

Zentrieren den Polsuchers, Lagunennebel, Pluto

Page 5: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

5 /

„Low-Tech“ Astronomy

Centering the Polar Finder, Laguna nebula, Pluto

Page 6: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

6 /

Agenda

●Gradient Merge Mosaic

–Grundlagen

–Ein paar Experimente

●(Mittagspause)

●Praxis

–Umgehen mit Artefakten

●GradientHDRComposition/Compression

Page 7: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

7 /

Agenda

●Gradient Merge Mosaic

–Foundations

–Some experiments

●(lunch break)

●Hands-on

–Managing Artifacts

●GradientHDRComposition/Compression

Page 8: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

8 /

Die Theorie

….ist nicht so schwer

Page 9: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

9 /

The Theory

….is not that difficult

Page 10: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

10 /

Bilder Zusammenfügen

Page 11: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

11 /

Merging Pictures

Page 12: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

12 /

GradientMergeMosaic

●Astrophotos sind leichter

–Keine Perspektive

–Keine Vordergrundobjekte

–Keine Bewegung

●Astrophotos sind schwieriger

–Punktförmige Lichtquellen

–>=14 bit Kontrast

–Bewahren von Signalen <=1 bit

–Rauschen

–Projektionen

Page 13: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

13 /

GradientMergeMosaic

●Astrophotos are easy:

–No perspective

–No foreground

–No movement

●Astrophotos are difficult:

–Point light sources

–>=14 bit contrast

–Preserve low signals<=1 bit

–Noise

–Projections

Page 14: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

14 /

Beispiele für GMM

●Links: M31, heutiges Beispiel

●Rechts: Rogelio Bernal Andreo

http://deepskycolors.com/deepspace.html,

http://www.deepskycolors.com/archivo/2011/10/29/the-

making-of-Clouds-of-Perseus--Part-.html

Page 15: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

15 /

Examples of GMM

●Left: M31, today‘s hands-on example

●Right: Rogelio Bernal Andreo

http://deepskycolors.com/deepspace.html,

http://www.deepskycolors.com/archivo/2011/10/29/the-

making-of-Clouds-of-Perseus--Part-.html

Page 16: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

16 /

Nähte sind immer da

●Unvollkommene

Kalibrierung

●Wolken

●Mond

●Beleuchtung

●Temperatur

●…

●Das Auge sieht besonders

Helligkeitsübergänge

Page 17: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

17 /

Seams are always there

●Imperfect calibrations

●Clouds

●Moon

●Artifical light

●Temperature

●…

●The eye is sensitive to

brightness changes

Page 18: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

18 /

Arbeite mit Gradienten

●Idee: Betrachte die Helligkeitsänderungen

●Füge diese „Gradienten“ zusammen

●Rekonstruiere das Bild

●https://en.wikipedia.org/wiki/Gradient-domain_image_processing, CC BY-SA 4.0

Page 19: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

19 /

Work on Gradients

●Idea: consider only changes in brightness

●Assemble those „Gradienten“ into one picture

●Reconstruct picture from gradients

●https://en.wikipedia.org/wiki/Gradient-domain_image_processing, CC BY-SA 4.0

Page 20: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

20 /

Gradientenbild+Lösung

Page 21: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

21 /

Gradients and Reconstruction

Page 22: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

22 /

Die Theorie in 1D

●Eine Funktion f(x)=3-2x-x2+0.5*x3

●Die Ableitung zeigt wie „steil“ es auf

und abwärts geht

●Bei den Minimal- und Maximalwerten

ist die Ableitung =0

●Aus der Ableitung kann ich die

Orginalfunktion bestimmen

–„Integral“

–Bis auf konstanten Offset

–hier: 3

Page 23: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

23 /

The Theory in 1D

●Function f(x)=3-2x-x2+0.5*x3

●The Gradient=Derivative=Slope

shows the slope of the graph

●At extrema, slope is =0

●Can reconstruct original function from

gradients

–Also called „integration“

–Same as original except for offset

–Offset here: 3

Page 24: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

24 /

Noch eine Funktion

●Eine Funktion f(x)=sin(x2)

●Die Ableitung zeigt wie „steil“ es auf

und abwärts geht

●Bei den Minimal- und Maximalwerten

ist die Ableitung =0

●Aus der Ableitung kann ich die

Orginalfunktion bestimmen

–Integral

–Bis auf konstanten Offset

–Hier: -0.5

Page 25: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

25 /

Another Function

●Chirp function f(x)=sin(x2)

●Again, derivative shows directions

and degree of slope

●Again, at extrema slope=0

●Reconstruct original function from

slopes

–Integration

–Except for constant offset

–Offset here: -0.5

Page 26: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

26 /

Durchschnittsfunktion●Durchschnittliche Funktion

aus Ableitung

●Einfach Ableitungen

addieren

●Rekonstruktion über

Integrieren

Page 27: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

27 /

Build „Average“ Function●„Average“ Function from

slopes

●Simply add derivatives

●Reconstruct via joined

integral

Page 28: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

28 /

Überblenden von Funktionen●Polynomial und Chirp-Funtion

werden bei x=2 verbunden

●Ableitung bei x=2 hart

umschalten

●Rekonstruierte Funktion hat

keinen plötzlichen

Helligkeitsprung!

Page 29: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

29 /

Blending of funtions●Polynomial and Chirp are

merged at x=2

●Switch derivative at x=2

●Reconstructed function has no

sudden „brightness“ jump!

Page 30: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

30 /

●Funktioniert in 2D genauso

●Bilder sind 2D Funktionen z=f(x,y)

●Überblenden der Ableitungen da wo

–Helligkeitswert im anderen Bild=0,

–Ein Bild über dem anderen liegt (overlay), oder

–Durchschnitt der Ableitungen (average), und/oder

–Langsamer Übergang (abwedeln, „feathern“)

Page 31: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

31 /

●Works just like that also in 2D

●Images are 2D functions z=f(x,y)

●Blend derivates where

–Brightness in one image =0,

–Where one image lies on top of the other (overlay), or

–Compute average derivative(average), and/or

–If necessary, blend derivatives smoothly(„feathern“)

Page 32: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

●Gradienten sind die Differenzen zwischen Pixeln:

●Gradientenbild:

●Kann Bild wiederherstellen, bis auf ersten Wert:

●Das ist die konstante Differenz in den Integralen

●Möglich mit beliebigen Delta-Werten

32 /

Perfekte 1D Lösung

Wert Delta Wert Delta Wert

1 2 3 -5 -2

Wert Delta Wert Delta Wert

0 2 2 -5 -3

Wert Delta Wert Delta Wert

? 2 ? -5 -?

Page 33: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

●Gradients are the differences between pixels:

●Gradient image:

●Reconstruct image except for first value:

●We also have the constant offset as seen with integration

●Exact solution for any combination of Delta-Values

33 /

Perfect 1D Solutions

Value Delta Value Delta Value

1 2 3 -5 -2

Value Delta Value Delta Value

0 2 2 -5 -3

Value Delta Value Delta Value

? 2 ? -5 -?

Page 34: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

34 /

Widersprüchliche 2D Solutions

●Gradientenbild:

●Lösung mit 0 oben links: Ausgleich:

●Seifenblaseneffekt. Ähnliche Formeln!

Wert DeltaX Wert

Wert 0 2 2

DeltaY 4 --- 0

Wert 4 -1 3 o. 2

Wert DeltaX Wert

Wert ? 2 ?

DeltaY 4 --- 0

Wert ? -1 ?

Wert DeltaX Wert

Wert 0 2 2

DeltaY 4 --- 0

Wert 4 -1 2.5

Page 35: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

35 /

Imperfect 2D Solutions

●Gradient image:

●Solution with 0 as top left value Regression:

●Soap bubble effect. Actually, the mathematics are similar

Value DeltaX Value

Value 0 2 2

DeltaY 4 --- 0

Value 4 -1 3 o. 2

Value DeltaX Value

Value ? 2 ?

DeltaY 4 --- 0

Value ? -1 ?

Value DeltaX Value

Value 0 2 2

DeltaY 4 --- 0

Value 4 -1 2.5

Page 36: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

36 /

Rechentechnik

●Bilder sind Funktionen mit x*y~10 Mio. Stützstellen

●Gradienten werden numerisch durch Differenzen zu

Nachbarpixeln gebildet

●Integral=Lösung einer Poisson-Gleichung

●Diskrete Cosinus Transformation (DCT)

●Es gibt mitunter keine perfekte Lösung => Ausgleich

●Details:

http://www.amitkagrawal.com/ICCV2007Course/ ,

Download the slides

Page 37: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

37 /

Computation

●Images are functions with x*y~10 Mio. supporting

points

●Gradients are the differences to neighboring pixels

●Integral=Solution of „Poisson equation“

●Discrete Cosinus Transform (DCT)

●Sometimes no perfect solution=>regression

●Details:

http://www.amitkagrawal.com/ICCV2007Course/ ,

Download the slides

Page 38: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

38 /

GradientMergeMosaic GUI

●Target Frames:

–Registrierte Teilbilder

–Reihenfolge nur bei „Type Of Combination“=Overlay wichtig. Spätere Bilder „gewinnen“

●Type of Combination

●Shrink Radius: Anzahl Pixel die am

Rand der Teilbilder weggenommen

werden (Aliasing)

●Feather Radius: Übergangsgröße, hilft

manchmal bei Artefakten

●Blackpoint: Pixel <=Wert sind

„durchsichtig“

●Generate Mask: Diagnostic

Hat Dokumentation !

Page 39: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

39 /

GradientMergeMosaic GUI

●Target Frames:

–Registered mosaic frames

–Order only important for „Type Of Combination=Overlay“. Later images overlay others

●Type of Combination

●Shrink Radius: Number of pixels

removed from border (Aliasing)

●Feather Radius: Featering between

images, sometimes helps with artifacts

●Blackpoint: Pixel <=blackpoint are

considered „transparent“

●Generate Mask: Diagnostic

Has Documentation !

Page 40: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

40 /

Ein paar Experimente

●X/Y-Bilder erzeugt mit

Pixelmath

„iif(X()>0.5,0.0,Y())“+Rot

ation

–...\Data\

Experiments

●Wichtig:

–Shrink radius=0

–Feather radius=0

Page 41: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

41 /

Some Experiments

●X/Y-Images produced

with Pixelmath

„iif(X()>0.5,0.0,Y())“+Rot

ation

–...\Data\

Experiments

●Important:

–Shrink radius=0

–Feather radius=0

Page 42: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

42 /

Versuche mit Sibylle

●Auffüllen des

Schwarzen

Quadrants

●Beachte Wirkung

von Reihenfolge

bei Overlay

Page 43: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

43 /

Experiments with Sibylle

●Filling of black

quadrant

●Watch influence of

order in Overlay

mode

Page 44: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

44 /

Shrinken

●Entfernen von

Aliasing-

Treppenstufen

●Entstehen bei

Rotation,

StarAlignment

und anderen

Operationen

●Wird durch

Erosion entfernt

Page 45: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

45 /

Shrinken

●Removes

Aliasing-Pixels

●Created during

StarAlignment,

Rotation and

other operations

●Removed via

Erosion(=shrink)

Page 46: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

46 /

Was noch fehlt

●Das Ergebnis von GMM ist (mehr oder weniger) linear

●Arbeitet „Additiv“, passt also keine Kontraste an

●Bei Farbbildern: Jeder Kanal wird einzeln behandelt

●Es gibt Probleme mit Artefakten an Kachelrändern

●Kann nicht ausgleichen:

–Skalenunterschiede (Kontraste)

–Texturen (Rauschen, Fixed Pattern Noise, … )→vorher z.B. CanonBandingReduction

Page 47: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

47 /

Final Remarks

●GMM result is (more or less) linear

●Works „Additiv“, i.e. does not match contrasts

●For color images: Every channel is handelt separately by

GMM

●We have an artifact issue at mosaic tile borders

●GMM cannot help with:

–Scale differences (contrast)

–Textures (Noise, Fixed Pattern Noise,...)->Preprocessing (CanonBandingReduction, ABE, ..)

Page 48: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

48 /

Die Praxis

Beispieldaten und Arbeitschritte

Page 49: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

49 /

Hands-On

Example Data and Processing Steps

Page 50: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

50 /

Die Daten●Bob‘s (KuriousGeorge) Andromeda

Mosaik

–...\Data\Andromeda

●Kalibrierte Luminanz-TIFFs

●Dateien „Andromeda Galaxy 2-X“

●Im Workshop beschränkt Euch auf

zentrale 6 Bilder:

–Speicherplatz, Rechenzeit

–Arbeitszeit

–...\Data\Andromeda_SubSet

26 27 28 29 30

21 22 23 24 25

16 17 18 19 20

11 12 13 14 15

6 7 8 9 10

1 2 3 4 5

Page 51: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

51 /

The Data●Bob‘s (KuriousGeorge) Andromeda

Mosaic

–...\Data\Andromeda

●Calibrated Luminance-TIFFs

●Files „Andromeda Galaxy 2-X“

●Workshop: Limited to 6 central

images:

–RAM, Computing Time

–Manual work time

–...\Data\Andromeda_SubSet

26 27 28 29 30

21 22 23 24 25

16 17 18 19 20

11 12 13 14 15

6 7 8 9 10

1 2 3 4 5

Page 52: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

52 /

Überblick1)Bilder nach Float wandeln

2)Basis-Mosaik für Alignment bauen (StarAlignment

Register Union)

3)Registrieren auf Basis Mosaik (StarAlignment Match

Images)

4)Optional: Maske zur Orientierung (ImageIntegration

Rejection Low)

5)GradientMergeMosaic (endlich!)

6)Artefakte bekämpfen (CloneStamp), zeitaufwendig

7)Weiter mit 5) (typischerweise 4-8 mal)

8)(Normale Bearbeitung eines Lineare Bildes)

Page 53: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

53 /

Overview1)Translate images to float32

2)Build Base Mosaic (StarAlignment Register Union)

3)Register to Base Mosaic (StarAlignment Match Images)

4)Optional: Mask for orientation (ImageIntegration

Rejection Low)

5)GradientMergeMosaic (finally!)

6)Artefakte bekämpfen (CloneStamp), time consuming

7)Continue with 5) (typical 4-8 times)

8)(Usual processing of linear image)

Page 54: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

54 /

Bilder nach Float wandeln

●Scripts/Batch Processing/Batch Format Conversion

Page 55: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

55 /

Translate Images to Float

●Scripts/Batch Processing/Batch Format Conversion

Page 56: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

56 /

Basis-Mosaik 1●Empfohlene Einstellungen:

–Projective Transformation oder 2D Surface Splines

–Distortion Correction

–Register/Union-Mosaic

–Frame Adaption

●Jeweils ein neues Bild

hinzufügen:

–Vorheriges als Referenz

–Neues hinzufügen mit Drag+Drop Triangle

Page 57: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

57 /

Base-Mosaic 1●Recommended:

–Projective Transformation or 2D Surface Splines

–Distortion Correction

–Register/Union-Mosaic

–Frame Adaption

●Jeweils ein neues Bild

hinzufügen:

–Vorheriges als Referenz

–Add new with Drag+DropTriangle/Local apply

Page 58: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

58 /

Basis-Mosaik 2

●Erster Schritt: Bild 13+18

●Danach jeweils ein Bild zu

entstandenem Mosaik

hinzufügen

●Bei Problemen:

–Nachhelfen mit Previews

Page 59: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

59 /

Base-Mosaic 2

●First Step: tile 13+18

●Then stepwise add another

image to just created

mosaic

●Problems: Help with

Previews

Page 60: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

60 /

Basis-Mosaik 3

●Mit weiteren Bildern fortsetzen

●Bevorzuge Spiralmuster

–Hoffnung auf minimierte Verzerrungen

●Bei Problemen:

–Einfach mit nächstem weitermachen

–Schwierige Bilder später nochmal probieren

–Nachhelfen mit Previews

–(hier: 7,10,26,21,1,5)

●(Zentrale 6 reichen für Demo)

26 27 28 29 30

21 22 23 24 25

16 17 18 19 20

11 12 13 14 15

6 7 8 9 10

1 2 3 4 5

Page 61: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

61 /

Base-Mosaic 3

●Continue with other images

●I prefer spiral pattern

–Hoping for reduced distortions

●On problems:

–Continue with next and try again later, or

–Help with Previews

●(Zentral 6 images are enough for workshop)

26 27 28 29 30

21 22 23 24 25

16 17 18 19 20

11 12 13 14 15

6 7 8 9 10

1 2 3 4 5

Page 62: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

62 /

Basis-Mosaik Resultat

●Hat Schwächen

●Eignet sich

aber die zu

mergenden

Bilder

auszurichten

Page 63: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

63 /

Base-Mosaic Result

●Visible seams

●Suitable to

create tiles for

GMM

Page 64: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

64 /

Registrieren auf Basis-Mosaik

●Empfohlene Einstellungen:

–Distortion Correction

–Register/Match Images

–(Descriptor Type: Triangle Similarity)

–Compute Intersections: Always

–Global apply

●Notfalls für einzelne Bilder mit

Preview nachhelfen

●(hier: 5, 21)

Page 65: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

65 /

Register to Base Mosaic

●Recommended Settings:

–Distortion Correction

–Register/Match Images

–(Descriptor Type: Triangle Similarity)

–Compute Intersections: Always

–Global Apply

●If necessary: Help with

Previews

●(hier: 5, 21)

Page 66: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

66 /

Registrierte Bilder

●Resultat ist Satz

von registrierten

Bildern

●Hintergrund

jeweils schwarz

Page 67: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

67 /

Registered Tiles

●Result is set of

files with registered

tiles

●Black=Transparent

Background

Page 68: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

68 /

Optional: Maske zur Orientierung

●Per normaler

ImageIntegration

●Rejection Low

●Später per

Drag&Drop auf GMM

Resultat als Maske

nutzen

●Hilft bei Orientierung

Page 69: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

69 /

Optional: Mask for Orientation

●Per standard

ImageIntegration

●Rejection Low

Image

●Later set as mask

via Drag&Drop on

GMM Resultat

●Helps identify

source of artifacts

Page 70: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

70 /

GradientMergeMosaic

●Braucht viel

Speicher (10GB für

das vollständige

Bild)

●Sieht schon

ziemlich gut aus

●Abgesehen von

Artefakten

Page 71: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

71 /

GradientMergeMosaic

●Needs lots of RAM

(>10GB for complete

Mosaic)

●Looking pretty good

●Except for artifacts

Page 72: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

72 /

Artefakte 1

●Liegen bei hellen

Sternen auf den

Kachelrändern

●Einige

verschwinden

durch „Feathern“,

aber nicht alle

Page 73: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

73 /

Artefacts 1

●Located at borders

of tiles

●Some go away

with „feather“, but

not all

Page 74: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

74 /

Artefakts 2●Entstehen bei hellen Sternen an

Kachelrand

●Seifenblasen Effekt

–Deutlich unterschiedliche Helligkeiten des gleichen Sterns in 2 Bildern (trotz Frame Adaption)

–Alignment-Probleme (auch <1 Pixel!)

●Workarounds:

–Feathern (tut‘s manchmal)

–Nicht-Lineare Bilder (nicht empfohlen)

–Ausstempeln

Page 75: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

75 /

Artefacts 2●Located at bright stars at tile borders.

●Soap Bubble Effect

–Different brightness of same star in 2 images (despite Frame Adaption)

–Alignment-Problems (even <1 Pixel!)

●Workarounds:

–Feathern (sometimes helps)

–Non-lineart images (non-recommended)

–Remove one star image via CloneStamo

Page 76: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

76 /

Randsterne entfernen

●Für alle Artefakte:

●Kritische

Randsterne

reichlich

wegnehmen

●CloneStamp

● Radius<=5

● Softness=0.0

● Opacity=1.0

●Und wieder GMM

●Wiederholen wie

notwendig !

Page 77: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

77 /

Remove Border Stars

●For all Artefacts:

●Remove critical star

●CloneStamp

● Radius<=5

● Softness=0.0

● Opacity=1.0

●Store patched

image

●Repeat GMM

●Repeat as often as

necesarry !

Page 78: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

78 /

GMM Ergebnis

Page 79: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

79 /

GMM Result

Page 80: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

80 /

Was bleibt?●Artefakte am Rand: Wegschneiden

●Textur-Unterschiede (Rauschen, Fixed

Pattern Noise): Kriegt man nicht weg

●Alignment-Fehler: Nochmal von Vorne

für diese Kachel

–DynamicAlignment

–StarAlignment mit 2D-Surface Splines

–MosaicByCoordinates

●DynamicBackgroundExtraction

●Dann weiter wie mit üblichen linearen

Bildern

Page 81: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

81 /

What else?●Other border artifacts: Cut away

●Textur-Differences (Noise, Fixed Pattern

Noise): GMM cannot help. Maybe add

noise?

●Alignment-Errors: Try again for this tile

–DynamicAlignment

–StarAlignment mit 2D-Surface Splines

–MosaicByCoordinates

●DynamicBackgroundExtraction

●Continue as with usual Linear images

Page 82: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

Registration und Frame Adaption

- Viele Alternativen

- Im Workshop: Alles selbst-referentiell, keine

äußeren Daten

- Viele Alternativen mit externen Daten

- Alignment zu „gemaltem“ Bild, z.B. CatalogStarGenerator, StarGenerator, Stellarium, ...- Plate solve to this data(ImageSolver, Blind Solver,

ManualImageSolver)

- MosaicByCoordinates (especially for wide fields)

- Frame Adaption- AperturePhotometry, Fluxx, G2V

- ...

Page 83: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

Registration and Frame Adaption

- Many alternatives

- In Hands-on: All data was self registered, no foreign

data

- Many alternatives with help of other data

- Align to rendered image, for instance with CatalogStarGenerator, StarGenerator, Stellarium, ...- Solve via plate solver (ImageSolver, Blind Solver,

ManualImageSolver)

- MosaicByCoordinates (especially for wide fields)

- Frame Adaption- AperturePhotometry, Fluxx, G2V

- ...

Page 84: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

84 /

Und noch 2 Werkzeuge

Verwandte von GMM:

GradientHDRCompression

GradientHDRComposition

Page 85: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

85 /

Two more Tools

Relatives of Gradient Merge Mosaic:

GradientHDRCompression

GradientHDRComposition

Page 86: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

86 /

GradientHDRCompression

●Feine Details

hervorheben

●Arbeitet mit

Abschneiden starker

Gradienten

–Max log10(Gradient)

–Feinstruktur bleibt übrig

●Artefakte?

Page 87: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

87 /

GradientHDRCompression

●Enhance fine detail

●Reduces strong

contrasts

–Max log10(Gradient)

–Delicate strukture remains

●Unclear if supported

by data

Page 88: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

88 /

GradientHDRComposition

●Ähnlich HDRComposition

●Aber ganz anderes

Verfahren

–Nutze die stärksten Gradienten

–Idee: Über- oder unterbelichtete Regionen sind Gradienten-„flach“

Page 89: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

89 /

GradientHDRComposition

●Similar to HDRComposition

●Entirely different approach

–Use the strongest graident

–In over- or under-exposed regions gradients are „flat“

Page 90: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

90 /

Zusammenfassung

●GMM ermöglicht nahtlose Mosaike

–Aufwändig: Artefakte bekämpfen

–Kenne den Algorithmus, dann kennst Du auch die Gegenmaßnahmen

–Super Ergebnisse!

●GradientHDRComposition und

GradientHDRCompression lohnen einen Blick

●Viel Spaß!

Page 91: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

91 /

Conclusion

●GMM enables seamless mosaics

–Fighting artifacts is work intensive

–Know the algorithm, then fight artefacts

–Can produce great results!

●GradientHDRComposition and

GradientHDRCompression may be useful

●Enjoy!

Page 92: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

92 /

Backup

●Anybody here who wants to write anti-artifact script?

●Idea:

● Identify stars with StarMask

● Identify tile area with Binarize

● Shrink area with MorphologicalTransform/Erosion and Radius<0.5*tile overlap

● Combine shrinked area, original area, star mask into mask limited to border regions with PixelMath

● Resulting Mask stamps out stars at border in tile

● Apply to many tiles with ImageContainer

Page 93: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

Handout

26 27 28 29 30

21 22 23 24 25

16 17 18 19 20

11 12 13 14 15

6 7 8 9 10

1 2 3 4 5

Page 94: GradientMergeMosaic · 2 / Wer bin ich? 52 Jahre PixInsight seit 2007 Astronomie seit 2005 Software Entwickler –C++, HPC Please tell me if I switch to English

Handout 2

Frame Adaption

Projective or

Spline

Distortion

Correction

Base Mosaic:

Union-Mosaic,

local apply

Final Mosaic:

Match Images,

global apply