MATLAB: How to obtain a composite of two grayscale images Image Processing Toolboximfuse image composite I want to make a composite of two images with "imfuse" function as follow: imfuse(A,RA,B,RB,'ColorChannels',[1 2 0]) Is there anyway to make the Colorchannels "off" Best Answer Have you tried this:[C,RC] = imfuse(A,RA,B,RB,'blend'); Related SolutionsMATLAB: Put color to a gray image gray_as_RGB = repmat(YourGrayImage, [1 1 3]);now gray_as_RGB is the RGB equivalent of the grayscale image and you can write color information into it. MATLAB: How to code image types Try this:grayImage = imread(fullFileName);% Get the dimensions of the image.% numberOfColorChannels should be = 1 for a gray scale image, and 3 for an RGB color image.[rows, columns, numberOfColorChannels] = size(grayImage);if numberOfColorChannels > 1 % It's not really gray scale like we expected - it's color. % Use weighted sum of ALL channels to create a gray scale image.% grayImage = rgb2gray(grayImage); % ALTERNATE METHOD: Convert it to gray scale by taking only the green channel, % which in a typical snapshot will be the least noisy channel. grayImage = grayImage(:, :, 1); % Take red channel.endif max(grayImage(:)) == 1 && length(unique(grayImage(:))) == 2 % It's binary because it has only two values: 0 and 1else % It's grayscaleendYou can also use isa(grayImage, 'logical') or similar to identify what class it is. Related QuestionHow can an color image can be changed have only four color in desire area.
Best Answer