资源简介
图像增强,彩色图像增强,matlab源码。
代码片段和文件信息
function res = grs2rgb(img map)
%%Convert grayscale images to RGB using specified colormap.
% IMG is the grayscale image. Must be specified as a name of the image
% including the directory or the matrix.
% MAP is the M-by-3 matrix of colors.
%
% RES = GRS2RGB(IMG) produces the RGB image RES from the grayscale image IMG
% using the colormap HOT with 64 colors.
%
% RES = GRS2RGB(IMGMAP) produces the RGB image RES from the grayscale image
% IMG using the colormap matrix MAP. MAP must contain 3 columns for Red
% Green and Blue components.
%
% Example 1:
% open ‘image.tif‘;
% res = grs2rgb(image);
%
% Example 2:
% cmap = colormap(summer);
% res = grs2rgb(‘image.tif‘cmap);
%
% See also COLORMAP HOT
%
% Written by
% Valeriy R. Korostyshevskiy PhD
% Georgetown University Medical Center
% Washington D.C.
% December 2006
%
% vrk@georgetown.edu
% Check the arguments
if nargin<1
error(‘grs2rgb:missingImage‘‘Specify the name or the matrix of the image‘);
end;
if ~exist(‘map‘‘var‘) || isempty(map)
map = hot(64);
end;
[lw] = size(map);
if w~=3
error(‘grs2rgb:wrongColormap‘‘Colormap matrix must contain 3 columns‘);
end;
if ischar(img)
a = imread(img);
elseif isnumeric(img)
a = img;
else
error(‘grs2rgb:wrongImageFormat‘‘Image format: must be name or matrix‘);
end;
% Calculate the indices of the colormap matrix
a = double(a);
a(a==0) = 1; % Needed to produce nonzero index of the colormap matrix
ci = ceil(l*a/max(a(:)));
% Colors in the new image
[iliw] = size(a);
r = zeros(iliw);
g = zeros(iliw);
b = zeros(iliw);
r(:) = map(ci1);
g(:) = map(ci2);
b(:) = map(ci3);
% New image
res = zeros(iliw3);
res(::1) = r;
res(::2) = g;
res(::3) = b;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4539 2006-12-09 19:27 grs2rgb.html
文件 1705 2006-12-09 19:48 grs2rgb.m
文件 5027 2006-12-09 19:27 grs2rgbh.png
文件 78995 2006-12-09 19:27 grs2rgbh_01.png
文件 94510 2006-12-09 19:27 grs2rgbh_02.png
文件 81857 2006-12-09 19:27 grs2rgbh_03.png
文件 1344 2009-07-28 15:22 license.txt
- 上一篇:轮廓波变换及其去噪的程序
- 下一篇:MIMO信道容量仿真matlab代码
相关资源
- 用matlab-实现基于直方图均衡化的彩色
- 数字图像处理空间域图像增强
- Retinex in matlab图像增强、HDR图像压缩
- Matlab数字图像处理技术论文27篇主要关
- NSCT 图像增强
- Matlab空域频域图像增强.rar
- retinex 算法matlab仿真
- 双边滤波 图像增强
- 基于matlab的图像增强教学演示系统的
- Multi-Scale Retinex with Color Restore 多尺度
- 图像增强Matlab代码总结6种
- MATLAB图像增强程序举例
- 运用偏微分方程(PDE)方法进行图像
- PCNN分割,边缘提取,图像增强等mat
- 红外图像的处理及其MATLAB实现.zip
- 数字图像处理图像增强MATLAB程序及仿
- gabor滤波器的matlab源代码
- 基于matlab的图像增强设计
- 彩色图像增强matlab代码
- 三种图像增强算法的matlab源代码
- 多尺度retinex算法,图像增强
- 模糊集图像增强matlab实现
- 用于彩色图像增强的CLAHE算法的MATLA
- 将二进小波变换用于图像增强的MATL
- MATLAB实现彩色图像增强-其它文档类资
- 基于小波变换的图像增强
- 基于MATLAB的图像增强处理
- MATLAB频域图像增强技术
- 图像增强源代码Matlab实现
- 小波图像增强matlab源代码
评论
共有 条评论