图像的HSV拉伸增强对比度
2014-10-21 20:50
621 查看
图像的HSV拉伸增强对比度
HSV 和RGB颜色空间的相互转换
http://blog.csdn.net/cinmyheart/article/details/40348831
HSV的拉伸对比度增强就是对S V 两个域进行归一化,H保持不变即可
左侧是原图,右侧是经过处理的图片
转换代码:
%% *********************************************************
% code writer : EOF
% code file : HSV_enhance_filter.m
% code date : 2014.10.21
% e-mail : jasonleaster@gmail.com
%
% Code description :
% we translate RGB into HSV and normolize the
% S V channel and then translate HSV back to RGB.
%
% *********************************************************
function Output = HSV_enhance_filter(Image)
if size(Image,3) ~= 3
fprintf('ERROR Imput-Image must be three channel image\n');
return;
end
[H,S,V] = RGB2SHV(Image);
V_max = max(max(V));
V_min = min(min(V));
S_max = max(max(S));
S_min = min(min(S));
Height_Image = size(Image,1);
Width_Image = size(Image,2);
for row = 1:Height_Image
for col = 1:Width_Image
S(row,col) = (S(row,col) - S_min)/(S_max - S_min);
V(row,col) = (V(row,col) - V_min)/(V_max - V_min);
end
end
Output = HSV2RGB_Color(H,S,V);
end
HSV 和RGB颜色空间的相互转换
http://blog.csdn.net/cinmyheart/article/details/40348831
HSV的拉伸对比度增强就是对S V 两个域进行归一化,H保持不变即可
左侧是原图,右侧是经过处理的图片
转换代码:
%% *********************************************************
% code writer : EOF
% code file : HSV_enhance_filter.m
% code date : 2014.10.21
% e-mail : jasonleaster@gmail.com
%
% Code description :
% we translate RGB into HSV and normolize the
% S V channel and then translate HSV back to RGB.
%
% *********************************************************
function Output = HSV_enhance_filter(Image)
if size(Image,3) ~= 3
fprintf('ERROR Imput-Image must be three channel image\n');
return;
end
[H,S,V] = RGB2SHV(Image);
V_max = max(max(V));
V_min = min(min(V));
S_max = max(max(S));
S_min = min(min(S));
Height_Image = size(Image,1);
Width_Image = size(Image,2);
for row = 1:Height_Image
for col = 1:Width_Image
S(row,col) = (S(row,col) - S_min)/(S_max - S_min);
V(row,col) = (V(row,col) - V_min)/(V_max - V_min);
end
end
Output = HSV2RGB_Color(H,S,V);
end
相关文章推荐
- opencv 彩色图像对比度增强
- 基于多尺度对比度x射线图像增强算法
- 图像增强—限制对比度自适应直方图均衡化
- 基于局部均方差的图像局部对比度增强算法
- 用于图像去雾的优化对比度增强算法
- 使用局部标准差实现图像的局部对比度增强算法。
- 提高图像的对比度,图像拉伸
- 使用局部标准差实现图像的局部对比度增强算法。
- OpenCV下的图像对比度增强之完整代码
- matlab 实现图像的二值化、对比度拉伸变化
- 图像灰度直方图与对比度增强
- opencv 彩色图像对比度增强
- 图像的灰度变换——图像旋转、图像的反色处理、对比度拉伸
- 优化的对比度增强算法用于有雾图像的清晰化处理(算法效果是我目前看到最为稳定的,且对天空具有天然的免疫力,极力推荐有需要的朋友研究)。
- MUSICA(多尺度图像对比度增强)算法的简要原理及VC实现
- 图像局部对比度增强算法
- OpenCV图像增强:直方图拉伸和直方图均衡化
- opencv 彩色图像对比度增强
- 局部自适应自动色阶/对比度算法在图像增强上的应用。
- 顶帽、底帽变换用于图像对比度增强