pout = imread(‘pout.tif’);%读取pout灰度图像
tire = imread(‘tire.tif’);%读取tire灰度图像
[X map] = imread(‘shadow.tif’);%读取索引图像
shadow = ind2rgb(X,map); % 转化为真彩色图像
width = 210;%转化为统一宽度,以便进行对比
images = {pout, tire, shadow};
for k = 1:3
dim = size(images{k});
images{k} = imresize(images{k},…
[widthdim(1)/dim(2) width],‘bicubic’);
end
pout = images{1};
tire = images{2};
shadow = images{3};
pout_imadjust = imadjust(pout);%使用imadjust函数对图像进行增强
pout_histeq = histeq(pout); %使用histeq函数对图像进行增强
pout_adapthisteq = adapthisteq(pout); %使用adapthisteq函数进行增强
figure; subplot(221);
imshow(pout);%显示原图像
title(‘Original’); subplot(222);
imshow(pout_imadjust); %显示imadjust函数增强的图像
title(‘Imadjust’); subplot(223);
imshow(pout_histeq); %显示histeq函数增强的图像
title(‘Histeq’); subplot(224);
imshow(pout_adapthisteq); %显示adapthisteq函数增强的图像
title(‘Adapthisteq’);
tire_imadjust = imadjust(tire); %使用imadjust函数对图像进行增强
tire_histeq = histeq(tire); %使用histeq函数对图像进行增强
tire_adapthisteq = adapthisteq(tire); %使用adapthisteq函数进行增强
figure, subplot(221)
imshow(tire);%显示原图像
title(‘Original’); subplot(222);
imshow(tire_imadjust);%显示imadjust函数增强的图像
title(‘Imadjust’); subplot(223);
imshow(tire_histeq);%显示histeq函数增强的图像
title(‘Histeq’); subplot(224),
imshow(tire_adapthisteq);%显示adapthisteq函数增强的图像
title(‘Adapthisteq’); figure; subplot(121);
imhist(pout), %显示pout图像的直方图
title(‘pout.tif’); subplot(122),
imhist(tire), %显示tire图像的直方图
title(‘tire.tif’);
srgb2lab = makecform(‘srgb2lab’);%rgb彩色空间变为L
ab空间结构
lab2srgb = makecform(‘lab2srgb’); %Lab变为rgb空间结构
shadow_lab = applycform(shadow, srgb2lab);%图像变换到L
ab空间
max_luminosity = 100;%规定最大的光照值
L = shadow_lab(:,:,1)/max_luminosity;%归一化
shadow_imadjust = shadow_lab;
shadow_imadjust(:,:,1) = imadjust(L)
max_luminosity; %使用imadjust函数进行增强
shadow_imadjust = applycform(shadow_imadjust, …
lab2srgb);%变换到rgb彩色空间
shadow_histeq = shadow_lab;
shadow_histeq(:,:,1) = histeq(L)

max_luminosity; %使用histeq函数进行增强
shadow_histeq = applycform(shadow_histeq, …
lab2srgb);%变换到rgb彩色空间
shadow_adapthisteq = shadow_lab;
shadow_adapthisteq(:,:,1) = adapthisteq(L)*…
max_luminosity; %使用adapthisteq函数进行增强
shadow_adapthisteq = applycform(shadow_adapthisteq, …
lab2srgb);%变换到rgb彩色空间
figure; subplot(221)
imshow(shadow);%显示原图像shadow
title(‘Original’); subplot(222),
imshow(shadow_imadjust); %显示imadjust函数增强的图像
title(‘Imadjust’); subplot(223),
imshow(shadow_histeq); %显示histeq函数增强的图像
title(‘Histeq’); subplot(224),
imshow(shadow_adapthisteq); %显示adapthisteq函数增强的图像
title(‘Adapthisteq’);
mypout = myhisteq(pout);%使用myhisteq函数对pout图像进行增强
mytire = myhisteq(tire); %使用myhisteq函数对tire图像进行增强
figure,
subplot(121)
imshow(mypout);%显示myhisteq函数对pout增强后的图像
subplot(122)
imshow(mytire);%显示myhisteq函数对tire增强后的图像




MATLAB图像处理之图像增强实战相关推荐

  1. MATLAB图像处理学习——图像增强技术(附图像增强方法代码)

    目录 1.概论 (1)图像增强技术简介 (2)图像质量评估 2.空间域内的图像增强 (1)显示灰度直方图 (2)图像灰度值调整 (3)图像亮度调节 (4)灰度图像的反转变换 3.直方图增强 (1)RG ...

  2. matlab图像处理命令(二)

    转自:http://blog.163.com/crazyzcs@126/blog/static/1297420502010229104452729/ (非原处) 图像增强 1. 直方图均衡化的 Mat ...

  3. matlab图像相加例子,MATLAB图像处理例子

    MATLAB图像处理例子 clc;clear all;close all; a = imread( railway_05.jpg ); b = rgb2gray(a); c = im2bw(b,240 ...

  4. Matlab图像处理创新实践-实验2【图像滤波基础(2)】

    Matlab图像处理创新实践-实验1[图像滤波基础(1)] Matlab图像处理创新实践-实验2[图像滤波基础(2)] Matlab图像处理创新实践-实验3[图像锐化] Matlab图像处理创新实践- ...

  5. matlab图像处理函数大全

    1.图像的变换   ① fft2:fft2函数用于数字图像的二维傅立叶变换,如:i=imread('104_8.tif'); j=fft2(i); ②ifft2::ifft2函数用于数字图像的二维傅立 ...

  6. matlab --- 图像处理基础

    MATLAB图像处理 1. 数字图像处理 参考 数字图像处理(Digital Image Processing)又称为计算机图像处理,是一种将图像信号数字化利用计算进行处理的过程.随着计算机科学.电子 ...

  7. matlab能力处理,书+程序《MATLAB图像处理:能力提高与应用案例》赵小川

    [实例简介] MATLAB图像处理能力提高与应用案例 [赵小川 编著] 2014年版,书+程序(仅供学习) [实例截图] [核心代码] c3c59b5e-16c1-4bda-938e-8fcfb2ff ...

  8. matlab icol,Matlab 图像处理相关函数命令大全

    Matlab 图像处理相关函数命令大全 一.通用函数: colorbar 显示彩色条 语法:colorbar \ colorbar('vert') \ colorbar('horiz') \ colo ...

  9. matlab实现均衡变换,MATLAB如何实现图像增强灰度变换直方图均衡匹配

    MATLAB如何实现图像增强灰度变换直方图均衡匹配 在MATLAB数字图像处理领域,如何实现空间域图像增强的灰度变换,以及图像直方图的均衡和匹配(配准)?本文通过大量的图片增强案例,从图像的显示效果和 ...

最新文章

  1. C语言与C++不得不说的那点事
  2. laravel 是怎么做到运行 composer dump-autoload 不清空 classmap 映射关系的呢?
  3. ubuntu下安装java和tomcat安装
  4. mysql数据迁移数据一致性检教6_如何在数据库迁移中保证数据一致性?
  5. 信息系统项目管理师-知识、变更、战略管理核心知识点思维脑图
  6. Asp.Net Core 2.1+的视图缓存(响应缓存)
  7. php项目私有化部署保护代码,ThinkPHP项目安全配置解决方案
  8. [CareerCup] 4.4 Create List at Each Depth of Binary Tree 二叉树的各层创建链表
  9. ik分词器 分词原理_ElasticSearch 集成Ik分词器
  10. openSUSE 跨版本升级
  11. 拓端tecdat|R语言随机搜索变量选择SSVS估计贝叶斯向量自回归(BVAR)模型
  12. 印象笔记导入html笔记,Evernote Importer|印象笔记导入
  13. Nature指数全球城市科研排名:北京第一,上海第五,南京第八
  14. python jinja2_Python jinja2
  15. Ccharles 爬取微信公众号和小程序
  16. 投票 java_java实现投票程序设计
  17. 如何确定scrum的story之一:识别利益相关者和目标
  18. php读取pdf文件乱码_PHP读取文件,解决中文乱码UTF-8的方法分析
  19. 32G V100 要不要?又双叒叕到白嫖时间!
  20. 运维自动化管理服务器 CheungSSH

热门文章

  1. startActivity时报错Calling startActivity() from outside of an Activity context requires the FLAG_ACTIV
  2. springboot 使用tk.mybatis要注意
  3. 数据共享和数据开放如何改变世界论文_GW-ICC2019丨数据共享,开启临床研究新模式...
  4. 小白怎么区别插画和原画?插画和原画又有哪些差异?
  5. 奥莉嘎!!!ArrayList源码中remove、removeAll、clear方法我又肝了一遍,收获良多
  6. 浏览器音量增强插件crx
  7. 蓝桥杯 Java试题 H: 数字三角形
  8. 如何做一个基于JAVA在线考试系统毕业设计毕设作品(springboot框架)
  9. 高企研发费用核算的难点有哪些?该如何应对?
  10. ENSP的The specified address conflicts with another address.以及其中一个Protocol是down的问题