RGB和RYB颜色空间之间的转换 [英] Conversion between RGB and RYB color spaces

查看:740
本文介绍了RGB和RYB颜色空间之间的转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试在RGB(红色,绿色,蓝色)颜色空间和RYB(红色,黄色,蓝色)颜色空间之间转换颜色,然后再次转换.

I am currently trying to convert colours between RGB (red, green, blue) colour space and RYB (red, yellow, blue) colour space and back again.

基于下面的详细信息,我能够使用三线性插值将RYB转换为RGB-其中参数权重(s,t,u)是RYB颜色,而立方体的顶点是3d点在RGB空间中.

Based on the details in the following paper, I am able to convert from RYB to RGB using trilinear interpolation - where the parametric weightings (s,t,u) are the RYB colors, and the vertices of the cube are 3d points in RGB space.

绘画启发的颜色混合和合成以实现可视化-Gossett和Chen -第2.1节-实现细节

Paint Inspired Color Mixing and Compositing for Visualisation - Gossett and Chen - Section 2.1 - Realization Details

我的困难在于逆转转换过程.

My difficulties are in reversing the conversion process.

第二篇论文引用了此技术的使用,并且还指出使用牛顿法实现了逆转换.但没有提供进一步的细节.这可能表明在求解三线性插值方程式时找到了根.

A second paper references the use of this technique and also indicates that the reverse conversion was achieved using Newton's Method. But provides no further details. This would probably indicate root finding in solving the trilinear interpolation equations.

通过关注色彩对比度将绘画风格转移到摄影图像上-Xiaoyan张警官,M.应和;

在用方程式扩展这个问题之前,是否有人用Java/C/C ++/C#这样的语言来查看或解决此问题?

Before I expand on this question with the equations, has anybody seen or solved this in a language such as Java/C/C++/C# ?

我目前的方法是采用三线性插值(RYB到RGB)的正向方程,展开和重新排列以提供3个未知数的3个联立方程(参数权重:s,t和u),然后找出如何查找使用牛顿-拉夫森(Newton-Raphson)方法绘制根.我会以正确的方式解决这个问题吗?

My current approach is to take the forward equations of the trilinear interpolation (RYB to RGB), expand and rearrange to provide 3 simultaneous equations for 3 unknowns (the parametric weightings: s,t and u) then work out how to find the roots using the Newton-Raphson method. Am I going about this in the right way?

我将很快编辑此问题以提供方程式.

I will edit this question shortly to provide the equations.

非常感谢您的宝贵时间,

Many thanks for your time,

推荐答案

我最终解决了这个问题.

I managed to solve it in the end.

采用三线性插值的方程式: 维基百科

Take the equations for a trilinear interpolation: wikipedia

将第一个方程式代入最后一个方程式,展开并收集以下系数: Xd,Yd,Zd,XdYd,XdZd,YdZd,ZdYdZd和常数.

Substitute the first equations into the last, the expand and collect the coefficients for: Xd, Yd, Zd, XdYd, XdZd, YdZd, ZdYdZd and the constant.

然后找到方程相对于Xd,Yd和Zd在3维中的每一个的偏微分.使用这些新方程式填充(3x3)Jacobian矩阵,然后使用牛顿法在软件中求解.

Then find the partial differentiation of the equation in each of the 3 dimensions each in respect to Xd, Yd and Zd. Use these new equations to populate the (3x3) Jacobian matrix and then use Newton's method to solve in software.

牛顿-拉夫森法

这篇关于RGB和RYB颜色空间之间的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆