
ich benötige eine speziell für meine Kamera angepasste Entfernung der Vignetierung.
Normalerweise reicht eine radiale Aufhellung der Ränder, aber meine Kamera hat zusätzlich eine hellen Spot in der Mitte.
Wenn die Bilder zu einem Panorama zusammengestetzt werden, fällt das erst richtig auf:

Zur Bearbeitung (RAW Entwicklung) meiner Aufnahmen, verwende ich Luminar Neo. Damit kann ich nur die Randbereiche aufhellen.
Deshalb habe ich mir von einer rein weissen Fläche eine Aufnahme erstellt.

Und möchte nun die Helligkeitsabweichungen mit einer Aufnahme verrechnen.

Das komplette Projekt findet Ihr hier: https://u.pcloud.link/publink/show?code ... UMhVo2lD9k
Wie würdet Ihr, das Bild aufhellen, anhand der "Lightmap" Aufnahme?
Ich habe es wie folgt probiert, bin damit aber nicht zufrieden.
Insbesondere, wenn man die LightMap mit sich selbst verrechnet, müsste doch eine homogene Fläche
entstehen. Klappt aber nicht.
Code: Alles auswählen
UseJPEGImageDecoder()
Global G_Lumo, G_Scale
Macro ColorLimit(Color, Minimum, Maximum)
If Color > Maximum
Color = Maximum
ElseIf Color < Minimum
Color = Minimum
EndIf
EndMacro
Procedure.l Luminosity(Color.l, Scale.f)
Red.l = (Color & $FF) * Scale
Green.l = (Color >> 8 & $FF) * Scale
Blue.l = (Color >> 16 & $FF) * Scale
ColorLimit(Red, 0, 255)
ColorLimit(Green, 0, 255)
ColorLimit(Blue, 0, 255)
ProcedureReturn (((Blue << 8 + Green) << 8) + Red)
EndProcedure
Procedure.l GrayCol ( rgb.l )
Protected b, r, g
rgb = Red(rgb) * 0.2989 + Green(rgb) * 0.5870 + Blue(rgb) * 0.1140
rgb = RGB(rgb, rgb, rgb)
ProcedureReturn rgb
EndProcedure
Procedure FilterCallback(x, y, QuellFarbe, ZielFarbe)
Protected Abw.f, f.f
; Quellfarbe = Brightness Map
; ZielFarbe = Drone Footage
QuellFarbe = Green(GrayCol(QuellFarbe))
Abw = G_Lumo - QuellFarbe
If QuellFarbe = 0
QuellFarbe = 1
EndIf
f = (G_Lumo / QuellFarbe)
ZielFarbe = Luminosity(ZielFarbe, f)
ProcedureReturn ZielFarbe
EndProcedure
file.s = "brightness_map.jpg"
foto.s = "Drone_footage.jpg"
;foto.s = "brightness_map.jpg"
LoadImage(1, foto)
LoadImage(0, file)
w = ImageWidth(0)
h = ImageHeight(0)
OpenWindow(0, 0, 0, 800, 600, "")
CanvasGadget(0, 0, 0, 800, 600)
If StartDrawing(ImageOutput(0))
; Get Reference Color
G_Lumo = Green(GrayCol(Point(w/3, h/2)))
min = 255
max = 0
For y = 0 To h - 1
For x = 0 To w - 1
c = Green(GrayCol(Point(x, y)))
If c > max
max = c
EndIf
If c < min
min = c
EndIf
Next
Next
Debug "Min: " + Str(min) + " - Max: " + Str(Max) + " Ref: " + Str(G_Lumo)
G_Scale = max - min
StopDrawing()
EndIf
If StartDrawing(CanvasOutput(0))
DrawImage(ImageID(1), 0, 0)
DrawingMode(#PB_2DDrawing_CustomFilter)
CustomFilterCallback(@FilterCallback())
DrawImage(ImageID(0), 0, 0)
StopDrawing()
EndIf
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow