Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
有人能帮我用一个MATLAB函数将颜色空间从RBG更改为ych1tch2吗?_Matlab_Image Processing - Fatal编程技术网

有人能帮我用一个MATLAB函数将颜色空间从RBG更改为ych1tch2吗?

有人能帮我用一个MATLAB函数将颜色空间从RBG更改为ych1tch2吗?,matlab,image-processing,Matlab,Image Processing,我需要编写一个MATLAB函数,将RBG转换为ych1ych2 Y = 0.299\*R + 0.587\*G +0.114\*B Ch1 = R - (G+B)/2 Ch2 = (√(3)/2) \* (B-G) 要将RGB转换为卡伦(YCh1Ch2)的亮度、色青红、色绿蓝系统,您需要的转换矩阵是 rgb2ych1ch2=[0.299 0.587 0.114;1-0.5-0.5;0-sqrt(3)/2 sqrt(3)/2]; (这只是您介绍的三个直接转换为矩阵形式的方程式。) 然

我需要编写一个MATLAB函数,将RBG转换为ych1ych2

Y = 0.299\*R + 0.587\*G +0.114\*B  
Ch1 = R - (G+B)/2  
Ch2 = (√(3)/2) \* (B-G) 

要将RGB转换为卡伦(YCh1Ch2)的亮度、色青红、色绿蓝系统,您需要的转换矩阵是

rgb2ych1ch2=[0.299 0.587 0.114;1-0.5-0.5;0-sqrt(3)/2 sqrt(3)/2];
(这只是您介绍的三个直接转换为矩阵形式的方程式。)

然后,您可以将该矩阵乘以rgb值进行转换:

ych1ch2=rgb2ych1ch2*rgb;

什么是ych1ych2?!你有公式,所以。。。。应用公式?但是matlab应该如何解释负像素值呢?这个网站是问一些关于编程的问题。“有人能帮我吗?”不是关于编程的问题。还有其他地方打算找人为你工作。