KlassenKlassenKlassenKlassen | | | | Operatoren

gamma_imagegamma_imageGammaImagegamma_imageGammaImageGammaImage (Operator)

Name

gamma_imagegamma_imageGammaImagegamma_imageGammaImageGammaImage — Berechnen der Gamma-Kodierung oder Gamma-Dekodierung eines Bildes.

Signatur

gamma_image(Image : GammaImage : Gamma, Offset, Threshold, MaxGray, Encode : )

Herror gamma_image(const Hobject Image, Hobject* GammaImage, double Gamma, double Offset, double Threshold, double MaxGray, const char* Encode)

Herror T_gamma_image(const Hobject Image, Hobject* GammaImage, const Htuple Gamma, const Htuple Offset, const Htuple Threshold, const Htuple MaxGray, const Htuple Encode)

Herror gamma_image(Hobject Image, Hobject* GammaImage, const HTuple& Gamma, const HTuple& Offset, const HTuple& Threshold, const HTuple& MaxGray, const HTuple& Encode)

HImage HImage::GammaImage(const HTuple& Gamma, const HTuple& Offset, const HTuple& Threshold, const HTuple& MaxGray, const HTuple& Encode) const

HImageArray HImageArray::GammaImage(const HTuple& Gamma, const HTuple& Offset, const HTuple& Threshold, const HTuple& MaxGray, const HTuple& Encode) const

void GammaImage(const HObject& Image, HObject* GammaImage, const HTuple& Gamma, const HTuple& Offset, const HTuple& Threshold, const HTuple& MaxGray, const HTuple& Encode)

HImage HImage::GammaImage(double Gamma, double Offset, double Threshold, const HTuple& MaxGray, const HString& Encode) const

HImage HImage::GammaImage(double Gamma, double Offset, double Threshold, double MaxGray, const HString& Encode) const

HImage HImage::GammaImage(double Gamma, double Offset, double Threshold, double MaxGray, const char* Encode) const

void HOperatorSetX.GammaImage(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*GammaImage, [in] VARIANT Gamma, [in] VARIANT Offset, [in] VARIANT Threshold, [in] VARIANT MaxGray, [in] VARIANT Encode)

IHImageX* HImageX.GammaImage(
[in] double Gamma, [in] double Offset, [in] double Threshold, [in] VARIANT MaxGray, [in] BSTR Encode)

static void HOperatorSet.GammaImage(HObject image, out HObject gammaImage, HTuple gamma, HTuple offset, HTuple threshold, HTuple maxGray, HTuple encode)

HImage HImage.GammaImage(double gamma, double offset, double threshold, HTuple maxGray, string encode)

HImage HImage.GammaImage(double gamma, double offset, double threshold, double maxGray, string encode)

Beschreibung

gamma_imagegamma_imageGammaImagegamma_imageGammaImageGammaImage führt eine allgemeine Gamma-Kodierung oder Gamma-Dekodierung des Eingabebildes ImageImageImageImageImageimage durch und liefert das Ergebnisbild in GammaImageGammaImageGammaImageGammaImageGammaImagegammaImage zurück. Eine allgemeine Gamma-Kodierung kann wie folgt beschrieben werden:

Hierbei ist G' der Gamma-kodierte Grauwert, G der lineare Grauwert, , o = OffsetOffsetOffsetOffsetOffsetoffset, m = MaxGrayMaxGrayMaxGrayMaxGrayMaxGraymaxGray, t = ThresholdThresholdThresholdThresholdThresholdthreshold und s ein Faktor, der aus GammaGammaGammaGammaGammagamma, OffsetOffsetOffsetOffsetOffsetoffset, ThresholdThresholdThresholdThresholdThresholdthreshold und MaxGrayMaxGrayMaxGrayMaxGrayMaxGraymaxGray so berechnet wird, dass der lineare und exponentielle Teil der Transformation stetig sind.

In analoger Weise kann eine allgemeine Gamma-Dekodierung wie folgt beschrieben werden:

Hierbei haben die Variablen dieselbe Bedeutung wie bei der Gamma-Kodierung und es gilt .

So kann zum Beispiel die Gamma-Kodierung oder Gamma-Dekodierung, die von der sRGB-Norm gefordert wird, durch GammaGammaGammaGammaGammagamma = 1.0/2.4, OffsetOffsetOffsetOffsetOffsetoffset = 0.055 und ThresholdThresholdThresholdThresholdThresholdthreshold = 0.0031308 erhalten werden, während die Gamma-Kodierung oder Gamma-Dekodierung, die von der HDTV-Videonorm gefordert wird, durch GammaGammaGammaGammaGammagamma = 0.45, OffsetOffsetOffsetOffsetOffsetoffset = 0.099 und ThresholdThresholdThresholdThresholdThresholdthreshold = 0.018 erhalten werden kann. In jedem Fall sollte MaxGrayMaxGrayMaxGrayMaxGrayMaxGraymaxGray auf einen Wert gesetzt werden, der zum Bildtyp von ImageImageImageImageImageimage passt (z.B. 255.0 für Byte-Bilder).

Achtung

gamma_imagegamma_imageGammaImagegamma_imageGammaImageGammaImage kann für byte-, uint2-, und real-Bilder auf OpenCL Geräten ausgeführt werden. Da die Operation in einfach statt wie auf der CPU doppelt genauer Fließkommadarstellung berechnet wird, kann das Ergebnis der OpenCL-Implementierung geringfügig von dem der CPU-Implementierung abweichen.

Parallelisierung

Parameter

ImageImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject (byte* / uint2* / real*) *erlaubt für Compute Devices

Eingabebild.

GammaImageGammaImageGammaImageGammaImageGammaImagegammaImage (output_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject * (byte / uint2 / real)

Ausgabebild.

GammaGammaGammaGammaGammagamma (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Gamma-Koeffizient des exponentiellen Teils der Transformation.

Defaultwert: 0.416666666667

Wertevorschläge: 0.416666666667, 0.45

OffsetOffsetOffsetOffsetOffsetoffset (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Versatz des exponentiellen Teils der Transformation.

Defaultwert: 0.055

Wertevorschläge: 0.055, 0.099

ThresholdThresholdThresholdThresholdThresholdthreshold (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Grauwert, für den die Transformation von linear nach exponentiell wechselt.

Defaultwert: 0.0031308

Wertevorschläge: 0.0031308, 0.018

MaxGrayMaxGrayMaxGrayMaxGrayMaxGraymaxGray (input_control)  number HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Maximaler Grauwert des Eingabebildtyps.

Defaultwert: 255.0

Wertevorschläge: 1.0, 255.0, 511.0, 1023.0, 4095.0, 16383.0, 65535.0

EncodeEncodeEncodeEncodeEncodeencode (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Berechnung einer Gamma-Kodierung, falls 'true'"true""true""true""true""true", ansonsten einer Gamma-Dekodierung.

Defaultwert: 'true' "true" "true" "true" "true" "true"

Werteliste: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

Alternativen

pow_imagepow_imagePowImagepow_imagePowImagePowImage

Siehe auch

sqrt_imagesqrt_imageSqrtImagesqrt_imageSqrtImageSqrtImage, exp_imageexp_imageExpImageexp_imageExpImageExpImage, log_imagelog_imageLogImagelog_imageLogImageLogImage

Literatur

Erik Reinhard, Erum Arif Khan, Ahmet Oguz Akyüz, Garret M. Johnson: „Color Imaging: Fundamentals and Applications.“ A K Peters, Ltd., 2008.
CEI/IEC 61966-2-1:1999: „Colour management -- Default RGB colour space -- sRGB.“
ITU-R BT.709-5: „Parameter values for the HDTV standards for production and international programme exchange.“

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren