function cp = cornerprocess(c,T,q)
cp = c > T;
B = ones(q);
cp = imdilate(cp,B);
cp = bwmorph(cp,'shrink','Inf');
数字图像处理的冈萨雷斯版本的cornerprocess函数,希望能帮助到大家。(例11.8)
f = imread('wozi.tif');
figure;imshow(f);
CH = cornermetric(f,'Harris'); %用Harris方法
CH(CH < 0) = 0;
CH = mat2gray(CH);
figure;imshow(imcomplement(CH));
CM = cornermetric(f,'MinimumEigenvalue'); % 用最小特征值的方法
CM = mat2gray(CM);
figure;imshow(imcomplement(CM));
% 获得直方图
hH = imhist(CH);
hM = imhist(CM);
figure;imhist(CH);
figure;imhist(CM);
% 利用百分比计算阈值
TH = percentile2i(hH,0.9945);
TM = percentile2i(hH,0.9970);
cpH = cornerprocess(CH,TH,1);
cpM = cornerprocess(CM,TM,1);
figure;imshow(cpH);
figure;imshow(cpM);