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识别图像中的颜色强度_Matlab_Image Processing - Fatal编程技术网

如何用matlab识别图像中的颜色强度

如何用matlab识别图像中的颜色强度,matlab,image-processing,Matlab,Image Processing,从给定的图像中,我想知道它是否包含更多的绿色、红色或蓝色成分 以及它们之间的比例。 它的输出应该像-一个给定的图像有更多的绿色成分和比例=== 红色和蓝色 下面是一个简单的脚本,用于查找图像中的平均红色、绿色和蓝色信号: img = imread('image_name.jpg') red_mean = mean(mean(img(:,:,1))) %the first channel is red green_mean = mean(mean(img(:,:,2))) %the sec

从给定的图像中,我想知道它是否包含更多的绿色、红色或蓝色成分 以及它们之间的比例。 它的输出应该像-一个给定的图像有更多的绿色成分和比例===
红色和蓝色

下面是一个简单的脚本,用于查找图像中的平均红色、绿色和蓝色信号:

img = imread('image_name.jpg')
red_mean = mean(mean(img(:,:,1)))   %the first channel is red
green_mean = mean(mean(img(:,:,2)))   %the second channel is green
blue_mean = mean(mean(img(:,:,2)))   %the third channel is blue
从这里开始,确定比例应该很简单

注意:我只用JPG测试过这个。TIF将有所不同,因为它们存储多层图像