Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
isp:hue_rotation [2019/05/08 17:00] – created Igor Yefmov | isp:hue_rotation [2023/09/05 04:53] – Igor Yefmov | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Hue rotation ====== | ====== Hue rotation ====== | ||
+ | "Hue rotation" | ||
- | Really, no magic here, once you process the image in HSL color space. The operation is as trivial as adding or subtracting a specified value from the pixel' | + | To rotate the color vector by an angle \(\Theta\) the following matrix multiplication is done: |
+ | |||
+ | \[ | ||
+ | \begin{bmatrix} | ||
+ | R \\ | ||
+ | G \\ | ||
+ | B | ||
+ | \end{bmatrix} | ||
+ | \times | ||
+ | \begin{bmatrix} | ||
+ | cox(\Theta) & sin(\Theta) & 0 \\ | ||
+ | -sin(\Theta) & cos(\Theta) & 0 \\ | ||
+ | 0 & 0 & 1 | ||
+ | \end{bmatrix} | ||
+ | \] | ||
+ | |||
+ | ===== In RGB color space ===== | ||
+ | |||
+ | |||
+ | ===== In HSL color space ===== | ||
+ | Really, no magic here, once you process the image in HSL color space. The operation is as trivial as adding or subtracting a specified value from the pixel' | ||
<code c++>// pseudo-code | <code c++>// pseudo-code | ||
void hue_rotation(/ | void hue_rotation(/ |