Clear Filters
Clear Filters

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 view (last 30 days)
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);

Answers (1)

Walter Roberson
Walter Roberson on 31 Jan 2016
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 Comments

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!