0

我正在尝试制作一种称为 Sigma 的色调曲线。

不幸的是,我不知道 Sigma 的公式,我不知何故找不到它的公式。谁能帮我?谢谢

基于图表 x 和 y 轴以及本网站:第三个链接: http ://www.mediachance.com/pseam/help/curves.html

使用 Windows Visual Studio 2010

for(int y=0; y<bih.biHeight; y++)
            {                       
                for(int x=0; x<bih.biWidth; x++)
                {   
                SetPixel(hdc, ((double)x/(double)(x+20))*bih.biWidth, bih.biHeight-x, red);
                }
4

1 回答 1

1

看起来像 sigmoid 曲线http://en.wikipedia.org/wiki/Logistic_curve

y = 1 / ( 1 + e^-x ) 调整 x 以改变陡度并缩放到输出范围 (0-255)。

提示:您可能想要预先计算函数并为每个可能的像素级别制作一个包含 256 个输入的查找表

于 2012-01-30T04:44:18.430 回答