hi sir in this matlab code the gray image is not converting into color image ?showing error in 10th line please say what is the error and make it correct the code and help me

1 次查看(过去 30 天)
clc;
clear all;
close all;
imt=imread('flowers.jpg');
figure(1)
imshow(imt);
ims=imread('flower2.jpg');
figure(2)
imshow(ims);
colorIm = gray2rgb('flowers.jpg','flower2.jpg');
figure(3)
imshow(colorIm);

回答(1 个)

Walter Roberson
Walter Roberson 2016-1-31
gray2rgb() is not a Mathworks provided function.
It appears you might be wanting to use the File Exchange contribution http://www.mathworks.com/matlabcentral/fileexchange/8214-gray-image-to-color-image-conversion . You will need to download that .zip file, unzip it into a convenient directory that is not underneath the MATLAB installation directory, and then use pathtool to add that directory to the MATLAB path.
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by