Thanks,
Troy
% IMPORTANT: The newsreader may break long lines into multiple lines.
% Be sure to join any long lines that got split into multiple single
lines.
% These can be found by the red lines on the left side of your
% text editor, which indicate syntax errors, or else just run the
% code and it will stop at the split lines with an error.
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
imtool close all; % Close all imtool figures.
clear; % Erase all existing variables.
workspace; % Make sure the workspace panel is showing.
fontSize = 20;
% Change the current folder to the folder of this m-file.
if(~isdeployed)
cd(fileparts(which(mfilename)));
end
% Read in a standard MATLAB color demo image.
folder = 'C:\Program Files\MATLAB\R2010a\toolbox\images\imdemos';
baseFileName = 'peppers.png';
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
if ~exist(fullFileName, 'file')
% Didn't find it there. Check the search path for it.
fullFileName = baseFileName; % No path this time.
if ~exist(fullFileName, 'file')
% Still didn't find it. Alert user.
errorMessage = sprintf('Error: %s does not exist.', fullFileName);
uiwait(warndlg(errorMessage));
return;
end
end
rgbImage = imread(fullFileName);
[indexedImage, map] = rgb2ind(rgbImage, 256);
imshow(indexedImage);
% Enlarge figure to full screen.
set(gcf, 'Position', get(0,'Screensize'));
set(gcf,'name','Demo by ImageAnalyst','numbertitle','off')
% Set up the jet colormap.
colormap(map);
colorbar;
title('Gray Image with Custom Color Map', ...
'FontSize', fontSize);
RGB = imread('peppers.png');
[X,map] = rgb2ind(RGB,256);
figure, imshow(X,map);
J = ind2gray(X,map);
figure, imshow(J,jet);
imcontour(J,6);
This still seems to assign the most intense colors to the lighter regions of the grayscale image, the onions in this case. I'd like the contours to show the most intense regions as red from the original RGB image, i.e. the red bell peppers.
Thanks
ImageAnalyst <imagea...@mailinator.com> wrote in message <7da5817b-e425-48c1...@k30g2000vbn.googlegroups.com>...
Can you upload (somewhere) an actual thermal image?