Tone curve table

本文介绍了一种基于Asymmetry和SecondPole参数的音视频处理中色调曲线映射方法。通过数学公式计算出不同的输入输出值,实现对图像或视频色调的调整。该方法适用于多种音视频编辑软件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

function lut = Tone_curve_table(Asymmetry, SecondPole)
%%plot(Tone_curve_table(5, 100))
%hold on
%plot(Tone_curve_table(25, 200))
%Asymmetry:[1:255], SecondPole:[1:255]

x = (Asymmetry + 1)/257*2-1;
ai = floor(0.5 + 255*(1-1/(1000*x*x*x)) + x - ((x>=0).*2));
ii = (0:32)';

if ai >=0
    x = ii /32;
else
    x = (32 - ii) / 32;
end

as = abs(ai ./ 255);
dp = SecondPole ./ 255;
y = round((dp + (1-dp).*((abs(1-dp-x)./dp).^3)).*(x.*(as+1)./(as+x)).*65535);
y = max(0,min(y, 65535));
if ai < 0
    y = 65535 - y;
end
lut = round(y);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值