Start Kurzfassung Formelsammlung Visual Computing Als erledigt markieren Merken Notiz Drucken
Kompakte Sammlung aller wichtigen Formeln des Kurses, nach Themen geordnet. Ergänzend zu den Spickzetteln. Verweise auf das jeweilige Kapitel in Klammern.
Punkt als Spaltenvektor, homogene Koordinate w = 1 w=1 w = 1 . Verkettung ist nicht kommutativ ; zuerst angewandte Transformation steht rechts.
T ( t x , t y , t z ) = ( 1 0 0 t x 0 1 0 t y 0 0 1 t z 0 0 0 1 ) S ( s x , s y , s z ) = ( s x 0 0 0 0 s y 0 0 0 0 s z 0 0 0 0 1 ) T(t_x,t_y,t_z)=\begin{pmatrix}1&0&0&t_x\\0&1&0&t_y\\0&0&1&t_z\\0&0&0&1\end{pmatrix}\quad S(s_x,s_y,s_z)=\begin{pmatrix}s_x&0&0&0\\0&s_y&0&0\\0&0&s_z&0\\0&0&0&1\end{pmatrix} T ( t x , t y , t z ) = 1 0 0 0 0 1 0 0 0 0 1 0 t x t y t z 1 S ( s x , s y , s z ) = s x 0 0 0 0 s y 0 0 0 0 s z 0 0 0 0 1
R x ( α ) = ( 1 0 0 0 0 cos α − sin α 0 0 sin α cos α 0 0 0 0 1 ) R y ( α ) = ( cos α 0 sin α 0 0 1 0 0 − sin α 0 cos α 0 0 0 0 1 ) R z ( α ) = ( cos α − sin α 0 0 sin α cos α 0 0 0 0 1 0 0 0 0 1 ) R_x(\alpha)=\begin{pmatrix}1&0&0&0\\0&\cos\alpha&-\sin\alpha&0\\0&\sin\alpha&\cos\alpha&0\\0&0&0&1\end{pmatrix}\ R_y(\alpha)=\begin{pmatrix}\cos\alpha&0&\sin\alpha&0\\0&1&0&0\\-\sin\alpha&0&\cos\alpha&0\\0&0&0&1\end{pmatrix}\ R_z(\alpha)=\begin{pmatrix}\cos\alpha&-\sin\alpha&0&0\\\sin\alpha&\cos\alpha&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix} R x ( α ) = 1 0 0 0 0 cos α sin α 0 0 − sin α cos α 0 0 0 0 1 R y ( α ) = cos α 0 − sin α 0 0 1 0 0 sin α 0 cos α 0 0 0 0 1 R z ( α ) = cos α sin α 0 0 − sin α cos α 0 0 0 0 1 0 0 0 0 1
Drehung/Skalierung um Referenzpunkt p ⃗ \vec{p} p : M = T ( + p ⃗ ) ⋅ R ⋅ T ( − p ⃗ ) M = T(+\vec{p})\cdot R\cdot T(-\vec{p}) M = T ( + p ) ⋅ R ⋅ T ( − p ) .
Homogenisierung (perspective divide): ( X , Y , Z , W ) → ( X / W , Y / W , Z / W ) (X,Y,Z,W)\to(X/W,\,Y/W,\,Z/W) ( X , Y , Z , W ) → ( X / W , Y / W , Z / W ) , W ≠ 0 W\neq 0 W = 0 .
Szenegraph: Kette von der Wurzel zum Blatt, Wurzel-Transformation steht links, z.B. T 1 ⋅ T 3 ⋅ T 6 ⋅ P T_1\cdot T_3\cdot T_6\cdot P T 1 ⋅ T 3 ⋅ T 6 ⋅ P .
View-Matrix: V = R K a m e r a ⋅ T ( − c ⃗ ) V = R_{Kamera}\cdot T(-\vec{c}) V = R K am er a ⋅ T ( − c ) (Rotation der Kameraachsen, dann Translation um − - − Kameraposition).
gluLookAt(eye, center, up): Augpunkt, Blickpunkt, Up-Vektor.
glm::perspective(fovy, aspect, zNear, zFar).
Strahlensatz (perspektivische Projektion auf near-Ebene n n n ): p y ′ = n ⋅ p y p z \displaystyle p'_y = \frac{n\cdot p_y}{p_z} p y ′ = p z n ⋅ p y (analog p x ′ p'_x p x ′ ).
Transformationskette: p ′ = M P r o j ⋅ V ⋅ M M o d e l ⋅ p p' = M_{Proj}\cdot V \cdot M_{Model}\cdot p p ′ = M P r o j ⋅ V ⋅ M M o d e l ⋅ p . NDC-Würfel: [ − 1 , 1 ] 3 [-1,1]^3 [ − 1 , 1 ] 3 .
Hinweis: Die vollständige perspektivische Projektionsmatrix ist laut Vorlesung nicht klausurrelevant.
Koordinatenräume: Local → \to → (ModelMatrix) → \to → World → \to → (ViewMatrix) → \to → Camera → \to → (ProjectionMatrix) → \to → Clip → \to → (Homogenisierung) → \to → NDC → \to → (Viewport) → \to → Fenster.
Lineare Interpolation (Kante): F ( t ) = ( 1 − t ) F ( 0 ) + t F ( 1 ) F(t) = (1-t)\,F(0) + t\,F(1) F ( t ) = ( 1 − t ) F ( 0 ) + t F ( 1 ) .
Baryzentrische Interpolation im Dreieck: c ⃗ ( p ) = w 1 c ⃗ 1 + w 2 c ⃗ 2 + w 3 c ⃗ 3 \vec{c}(p)=w_1\vec{c}_1+w_2\vec{c}_2+w_3\vec{c}_3 c ( p ) = w 1 c 1 + w 2 c 2 + w 3 c 3 mit w i = A i / A g e s w_i=A_i/A_{ges} w i = A i / A g es und w 1 + w 2 + w 3 = 1 w_1+w_2+w_3=1 w 1 + w 2 + w 3 = 1 .
Dreiecksfläche: A = 1 2 ∣ x 1 ( y 2 − y 3 ) + x 2 ( y 3 − y 1 ) + x 3 ( y 1 − y 2 ) ∣ A=\tfrac12\,|x_1(y_2-y_3)+x_2(y_3-y_1)+x_3(y_1-y_2)| A = 2 1 ∣ x 1 ( y 2 − y 3 ) + x 2 ( y 3 − y 1 ) + x 3 ( y 1 − y 2 ) ∣ .
Tiefentest: glEnable(GL_DEPTH_TEST), glDepthFunc(GL_LESS) (kleinerer z gewinnt), glClearDepth(1.0).
Vektoren am Punkt P (normiert): N ⃗ \vec{N} N Normale, L ⃗ \vec{L} L Licht, R ⃗ \vec{R} R Reflexion, V ⃗ \vec{V} V Blick. α = ∠ ( N ⃗ , L ⃗ ) \alpha=\angle(\vec N,\vec L) α = ∠ ( N , L ) , β = ∠ ( R ⃗ , V ⃗ ) \beta=\angle(\vec R,\vec V) β = ∠ ( R , V ) .
L o = M a L a ⏟ ambient + M d L i cos α ⏟ diffus + M s L i cos k β ⏟ spekular + M e ⏟ emission L_o = \underbrace{M_a L_a}_{\text{ambient}} + \underbrace{M_d\,L_i\,\cos\alpha}_{\text{diffus}} + \underbrace{M_s\,L_i\,\cos^{k}\beta}_{\text{spekular}} + \underbrace{M_e}_{\text{emission}} L o = ambient M a L a + diffus M d L i cos α + spekular M s L i cos k β + emission M e
Diffus (Lambert): ∝ cos α = max ( 0 , N ⃗ ⋅ L ⃗ ) \propto \cos\alpha = \max(0,\ \vec N\cdot\vec L) ∝ cos α = max ( 0 , N ⋅ L ) .
Spekular: ∝ cos k β = max ( 0 , R ⃗ ⋅ V ⃗ ) k \propto \cos^{k}\beta = \max(0,\ \vec R\cdot\vec V)^{k} ∝ cos k β = max ( 0 , R ⋅ V ) k ; großes k k k = kleiner, harter Glanzpunkt.
RGB additiv; CMY subtraktiv; CMY = 1 − RGB \text{CMY}=1-\text{RGB} CMY = 1 − RGB .
HSV aus RGB (Werte in [ 0 , 1 ] [0,1] [ 0 , 1 ] ): V = max ( R , G , B ) V=\max(R,G,B) V = max ( R , G , B ) , S = max − min max \displaystyle S=\frac{\max-\min}{\max} S = max max − min (bzw. 0 0 0 falls max = 0 \max=0 max = 0 ), H H H = Winkel auf dem Farbkreis (0 ∘ 0^\circ 0 ∘ Rot, 120 ∘ 120^\circ 12 0 ∘ Grün, 240 ∘ 240^\circ 24 0 ∘ Blau).
Grauwert-/Luma-Gewichtung ca. 0,3 R + 0,6 G + 0,1 B 0{,}3\,R + 0{,}6\,G + 0{,}1\,B 0 , 3 R + 0 , 6 G + 0 , 1 B .
Hinweis: Die konkreten YCbCr-Matrixkoeffizienten sind laut Vorlesung nicht klausurrelevant.
Lineare Grauwerttransformation: g ′ ( i , j ) = e ( i , j ) ⋅ mult + add g'(i,j) = e(i,j)\cdot \text{mult} + \text{add} g ′ ( i , j ) = e ( i , j ) ⋅ mult + add .
Kontrastspreizung von [ e m i n , e m a x ] [e_{min},e_{max}] [ e min , e ma x ] auf [ g m i n ′ , g m a x ′ ] [g'_{min},g'_{max}] [ g min ′ , g ma x ′ ] : mult = g m a x ′ − g m i n ′ e m a x − e m i n \displaystyle \text{mult}=\frac{g'_{max}-g'_{min}}{e_{max}-e_{min}} mult = e ma x − e min g ma x ′ − g min ′ , dann add = g m i n ′ − mult ⋅ e m i n \text{add}=g'_{min}-\text{mult}\cdot e_{min} add = g min ′ − mult ⋅ e min .
mult > 1 \text{mult}>1 mult > 1 = kontrastreicher (Histogramm gespreizt, Lücken); mult < 1 \text{mult}<1 mult < 1 = kontrastärmer.
Inversion: g ′ = g m a x − g g'=g_{max}-g g ′ = g ma x − g . Gammakorrektur: g ′ = g m a x ( g / g m a x ) 1 / γ g'=g_{max}\,(g/g_{max})^{1/\gamma} g ′ = g ma x ( g / g ma x ) 1/ γ .
Faltung (3x3): g ′ ( i , j ) = ∑ u , v K ( u , v ) ⋅ g ( i + u , j + v ) \displaystyle g'(i,j)=\sum_{u,v} K(u,v)\cdot g(i+u,\,j+v) g ′ ( i , j ) = u , v ∑ K ( u , v ) ⋅ g ( i + u , j + v ) . Kerngröße ungerade (eindeutiges Zentrum).
Mittelwert = 1 9 ( 1 1 1 1 1 1 1 1 1 ) Gauss = 1 16 ( 1 2 1 2 4 2 1 2 1 ) Laplace = ( 0 − 1 0 − 1 4 − 1 0 − 1 0 ) \text{Mittelwert}=\frac19\begin{pmatrix}1&1&1\\1&1&1\\1&1&1\end{pmatrix}\quad \text{Gauss}=\frac{1}{16}\begin{pmatrix}1&2&1\\2&4&2\\1&2&1\end{pmatrix}\quad \text{Laplace}=\begin{pmatrix}0&-1&0\\-1&4&-1\\0&-1&0\end{pmatrix} Mittelwert = 9 1 1 1 1 1 1 1 1 1 1 Gauss = 16 1 1 2 1 2 4 2 1 2 1 Laplace = 0 − 1 0 − 1 4 − 1 0 − 1 0
Sobel x = ( − 1 0 1 − 2 0 2 − 1 0 1 ) Sobel y = ( − 1 − 2 − 1 0 0 0 1 2 1 ) \text{Sobel}_x=\begin{pmatrix}-1&0&1\\-2&0&2\\-1&0&1\end{pmatrix}\quad \text{Sobel}_y=\begin{pmatrix}-1&-2&-1\\0&0&0\\1&2&1\end{pmatrix} Sobel x = − 1 − 2 − 1 0 0 0 1 2 1 Sobel y = − 1 0 1 − 2 0 2 − 1 0 1
Median (Rangordnung, nichtlinear): mittlerer Wert der sortierten Nachbarschaft; erzeugt keine neuen Grauwerte, erhält Kanten, entfernt Ausreißer.
ZHK (Zusammenhangskomponenten): N4 (4 direkte Nachbarn) vs N8 (zusätzlich Diagonalen). N8 verschmilzt diagonal berührende Pixel, ergibt also gleich viele oder weniger Komponenten als N4. Flood Fill = rekursives Fluten.
Siehe auch die kompakten Spickzettel (A4) und die vollständigen Kapitel.