xy123001
  f=imread(\'123.tif\');       % 读入一幅图片
  g=imadjust(f,[0 1],[1 0]);  % 负片显示 

 【imadjust】 

imadjust(f, [low_in high_in],[low_out high_out],gama)

此处low_out=1 > high_out=0 所以输出的灰度被反转,故而是负片

注意:除了f 、gama  所有输入值都被限定在0 1之间

下图显示gama在输入和输出灰度之间的指数关系

【imcomplement】补充

 s=imcomplement(f); % 负片显示的另一种方法

 

【stretchlim 对比度拉伸】stretch伸展  limit限制

不想关心imadjust 的参数 [low_in high_in],[low_out high_out],偷了个懒,使用:

low_high=stretchlim(f)  %对比度拉伸,是一个两元素的向量
g=imadjust(f,low_high,[])

可见下图执行之后,对比度提升

更普通的用法

low_high=stretchlim(f,tol)

tol:  指定 用低像素值和高像素值充满的图像部分

默认值是[0.01 0.99], 饱和级别2%  

   tol=[low_frac high_frac]

 

tol 可以是小于1的标量,则

       low_frac=tol

   high_frac=1-tol

若选择tol=0 ,则low_high=[min(f(:))  max(f(:))]

 

分类:

技术点:

相关文章:

  • 2021-04-08
  • 2021-09-04
  • 2021-04-04
  • 2022-12-23
  • 2021-11-23
  • 2021-10-22
  • 2021-07-02
猜你喜欢
  • 2021-09-12
  • 2021-12-08
  • 2021-11-27
  • 2022-12-23
  • 2021-07-09
  • 2021-09-22
  • 2021-04-04
相关资源
相似解决方案