0%

调整亮度和对比度

$g(x)=\alpha \times f(x) + \beta$

• $g(x)$ 输出像素
• $f(x)$ 输入像素
• $\alpha$ 对比度
• $\beta$ 亮度
• x 像素位置

RGB转灰度

• $Gray = (R + G + B) \div 3$
• $Gray = R \times 0.3 + G \times 0.59 + B \times 0.11$
• $Gray = R \times 0.2126 + G \times 0.7152 + B \times 0.0722$
• $Gray = R \times 0.299 + G \times 0.587 + B \times 0.114$
• $Gray = ( \max (R, G, B) + \min (R, G, B) ) \div 2$
• $Gray = \max (Red, Green, Blue)$
• $Gray = \min (Red, Green, Blue)$