matlab(im2bw)

Something i lean in matlab. One sentence per day…..

IM2BW Convert image to binary image by thresholding.
    IM2BW produces binary images from indexed, intensity, or RGB images. To do
    this, it converts the input image to grayscale format (if it is not already
    an intensity image), and then converts this grayscale image to binary by
    thresholding(阀值控制在0-1之间,如果输入的是uint8类图像,则自动将所有像素点除以255,然后使用用户自定义的阀值或者是默认阀值0.5).                               The output binary image BW has values of 1 (white) for all
    pixels in the input image with luminance greater than LEVEL and 0 (black)
    for all other pixels. (Note that you specify LEVEL in the range [0,1],
    regardless of the class of the input image.)


    BW = IM2BW(I,LEVEL) converts the intensity image I to black and white.


    BW = IM2BW(X,MAP,LEVEL) converts the indexed image X with colormap MAP to black and white.


    BW = IM2BW(RGB,LEVEL) converts the RGB image RGB to black and white.


    Note that the function GRAYTHRESH can be used to compute LEVEL
    automatically.
    Class Support
    -------------
    The input image can be uint8, uint16, single, int16, or double and it
    must be nonsparse. The output image BW is logical. I and X must be 2-D.
    RGB images are M-by-N-by-3.

 

各个函数的使用:

im2uint8:将输入转化为uint8,有效的输入图像数据类型包括logical, uint8, uint16, double

im2uint16:将输入转化为uint16,有效的输入图像数据类型包括同上

mat2gray:将输入转化为double,但是输出的double数据都在[0, 1]范围内,有效的输入只有double

im2double:如果输入的不是double类型图像,在输出都是在[0, 1]范围,如uint8则输出为uint8/255。但如果是double类型,则原样输出

im2bw:上面已经解释了,输出的是二值图像。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值