验证 Single Image Haze Rem…
2014-01-15 12:19
218 查看
原文地址:Single Image Haze Removal Using Dark Channel Prior先验的MATLAB代码">验证 Single Image Haze Removal Using Dark Channel Prior先验的MATLAB代码作者:bikey
16:27:10 阅读101 评论0 字号:大中小 订阅
注:代码内容引自zixu1986 (Euro) 北邮人论坛
这个先验是:没有haze干扰自然景像中local
patches(除了蓝天)总有一些像素的某个通道值非常低。
引起的原因是
1)局部阴影
2)很多彩色在rgb3个通道中有些通道的值很低
3)暗的物体或者表面
% a script to see the dark
channels of each image
input_dir = 'banff';
block_size = 25;
file_ext = '.jpg';
% getting the filenames of the images
files = dir(input_dir);
filenames = {files.name};
for i = 1:length(filenames)
if
isempty(strfind(lower(filenames{i}), file_ext))
continue
end
disp('.')
read_filename = [input_dir filesep
filenames{i}];
I =
imread(read_filename);
img_size = size(I);
% must
be 3-channel color image
if
length(img_size) ~= 3 || img_size(3) ~= 3
% warning('Should be color
image!')
continue
end
% min
of each channel
tmp =
[];
for j =
1:3
tmp(:,:,j) =
uint8(colfilt(I(:,:,j), [block_size block_size], 'sliding',
@min));
end
dark_channel = uint8(min(tmp,[],3));
k =
strfind(lower(filenames{i}), file_ext);
orig_name = filenames{i};
orig_name = orig_name(1:k-1);
save_filename = [input_dir filesep orig_name 'dc'
int2str(block_size) file_ext];
imwrite(dark_channel, save_filename);
end
图像处理 2010-07-02
16:27:10 阅读101 评论0 字号:大中小 订阅
注:代码内容引自zixu1986 (Euro) 北邮人论坛
这个先验是:没有haze干扰自然景像中local
patches(除了蓝天)总有一些像素的某个通道值非常低。
引起的原因是
1)局部阴影
2)很多彩色在rgb3个通道中有些通道的值很低
3)暗的物体或者表面
% a script to see the dark
channels of each image
input_dir = 'banff';
block_size = 25;
file_ext = '.jpg';
% getting the filenames of the images
files = dir(input_dir);
filenames = {files.name};
for i = 1:length(filenames)
if
isempty(strfind(lower(filenames{i}), file_ext))
continue
end
disp('.')
read_filename = [input_dir filesep
filenames{i}];
I =
imread(read_filename);
img_size = size(I);
% must
be 3-channel color image
if
length(img_size) ~= 3 || img_size(3) ~= 3
% warning('Should be color
image!')
continue
end
% min
of each channel
tmp =
[];
for j =
1:3
tmp(:,:,j) =
uint8(colfilt(I(:,:,j), [block_size block_size], 'sliding',
@min));
end
dark_channel = uint8(min(tmp,[],3));
k =
strfind(lower(filenames{i}), file_ext);
orig_name = filenames{i};
orig_name = orig_name(1:k-1);
save_filename = [input_dir filesep orig_name 'dc'
int2str(block_size) file_ext];
imwrite(dark_channel, save_filename);
end
相关文章推荐
- Android开发 利用imageview显…
- 《Single Image Haze Removal Using Dark Channel Prior》一文中图像去雾算法的原理、实现、效果(速度可实时)
- A requirement that almost every single application has is "I want to scale up an ImageView proportio
- 【转】Single Image Haze Removal(图像去雾)-CVPR'09 Best Paper- 什么是被看好的idea
- Single Image Haze Removal Using Dark Channel Prior翻译
- 图像分割(Image Segmentatio…
- Single Image Haze Removal Using Dark Channel Prior翻译
- 何凯明 Single Image Haze Removal Using Dark Channel Prior
- Single Image Haze Removal(图像去雾)-CVPR’09 Best Paper
- Single Image Haze Removal Based On Guided Filter
- Geometric Context from a Single …
- Single Image Haze Removal Using Dark Channel Prior翻译
- Single Image Haze Removal(图像去雾)-CVPR’09 Best Paper
- Single Image Haze Removal(图像去雾)-CVPR’09 Best Paper
- flex image组件 得到 BitmapData …
- 何恺明经典去雾算法之 Single Image Haze Removal
- Acronis True Image进行…
- Single Image Haze Removal Using Dark Channel Prior翻译
- 《Single Image Haze Removal Using Dark Channel Prior》图像去雾算法的原理(速度可实时)
- Single Image Haze Removal Using Dark Channel Prior翻译