clear all;%clear the values
clc;%clear the command window
strhead = '5';%the name of file
strtail = '.bmp' ;% the format of the file
str = strcat(strhead,strtail);
img = im2double(imread(str));%read the image and convert to double.
N = 15;%the size of filter
sigma = [100 , 0.3];%the parameters of bilateral filter
retimg = bialteral(img , N , sigma );%get the illumination image
subplot(1,3,1);imshow(img);title('the original image');
subplot(1,3,2);imshow(retimg);title('the illumination image');
%% s-l
img_copy = rgb2hsv(img);
img_copy3 = log(img_copy(:,:,3));
retimg_copy = rgb2hsv(retimg);
retimg_copy3 = log(retimg_copy(:,:,3));%only to v layer
r_img = img_copy3 - retimg_copy3;
r_img = exp(r_img);
N = 4;
sigma = [100,0.3];
retinex_img(:,:,3) = bialteral2(r_img,N,sigma);%get reflect image
dim = size(img);
for i = 1:dim(1)
for j = 1:dim(2)
img_copy(i,j,3) = img_copy(i,j,3)^(1/3);
end
end
retinex_img(:,:,3) = retinex_img(:,:,3).*(img_copy(:,:,3));
retinex_img(:,:,1) = img_copy(:,:,1);
retinex_img(:,:,2) = img_copy(:,:,2);
retinex_img = hsv2rgb(retinex_img);
%% Gamma-correction
% dim = size(img);
% for i = 1:dim(1)
% for j = 1:dim(2)
% for c=1:3
% img(i,j,c) = img(i,j,c)^(1/3);
% end
% end
% end
% retinex_img(:,:,1) = retinex_img(:,:,1).*(img(:,:,1));
% retinex_img(:,:,2) = retinex_img(:,:,2).*(img(:,:,2));
% retinex_img(:,:,3) = retinex_img(:,:,3).*(img(:,:,3));
subplot(1,3,3);imshow(retinex_img);title('the retinex image');
string=strcat(strhead,'_retinex.bmp');
imwrite(retinex_img,string,'bmp');

hfwf37
- 粉丝: 1
最新资源
- 基于python编写的appium自动化框架,采用PO模式,并集成了日志以及测试报告通过邮件发送的功能.zip
- 基于Python的ATM和购物商城的联合应用,商品结算调用ATM接口.zip
- 基于Python并调用百度智能云API所实现的简单人脸对比.zip
- 基于Python编写的中国城市轨道交通数据可视化分析项目。应用技术:网络编程、多线程、文件操作、数据库编程、GUI界面、数据分析。Python课程设计、大作业、实验、实践.zip
- 基于python的bilibili网页登录二维码输出到控制台的小工具.zip
- 基于python的discuz!论坛签到脚本.zip
- 基于python的django框架写的学生信息管理系统.zip
- 基于Python的Django模型,利用Bootstrap3前端框架,实现常用的基本功能,如增删改查、批量删除以及分页等,数据库使用Django自带的轻量级SQLite.zip
- 基于python的dtw算法,实现实时语音识别。.zip
- 基于Python的flask框架的疫情可视化网站.zip
- 基于python的linux系统资源监控,包括磁盘,cpu,内存,进程监控。通过钉钉群发送告警.zip
- 基于Python的NuitkaGUI.zip
- 基于python的PLUMED的可视化界面开发.zip
- 基于Python的flask网络爬虫web项目.zip
- 基于Python的numpy实现的简易深度学习框架,包括自动求导、优化器、layer等的实现。.zip
- 基于python的socket的Udp链接,模拟路灯.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



- 1
- 2
前往页