⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adaptivethres.m

📁 source code for fingerprint using matlab
💻 M
字号:
function [o] = adaptiveThres(a,W,noShow);
%Adaptive thresholding is performed by segmenting image a
%Honors Project 2001~2002
%wuzhili 99050056
%comp sci HKBU
%last update 19/April/2002

[w,h] = size(a);
o = zeros(w,h);

%seperate it to W block
%step to w with step length W

for i=1:W:w
for j=1:W:h
mean_thres = 0;

%white is ridge -> large

if i+W-1 <= w & j+W-1 <= h
   	mean_thres = mean2(a(i:i+W-1,j:j+W-1));
   	%threshold value is choosed
      mean_thres = 0.8*mean_thres;
      %before binarization
      %ridges are black, small intensity value -> 1 (white ridge)
      %the background and valleys are white, large intensity value -> 0(black)
      o(i:i+W-1,j:j+W-1) = a(i:i+W-1,j:j+W-1) < mean_thres;
end;
   
end;
end;


if nargin == 2
imagesc(o);
colormap(gray);
end;

⌨️ 快捷键说明

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