graylevelwith background.m

来自「gray level slicing with background it i」· M 代码 · 共 23 行

M
23
字号
clc;
clear all
a=imread('pout.tif');
bb=double(a);
[row,col]=size(bb);
LT=input('Enter lower threshold value:');
UT=input('Enter upper threshold value:');
for x=1:1:row
    for y=1:1:col
        if bb(x,y)>= LT 
            if bb(x,y)<= UT
             f(x,y)=255;                                
            else f(x,y)= bb(x,y)
            end
            end
    end
end
       
figure(1)
imshow(uint8(a))
figure(2)
imshow(uint8(f))

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?