我已经编写了一个查找高斯滤波器DIfference的代码,请告诉我如何根据最大值和最小值从滤波后的图像中找到关键点
clc;
X=imread('DSC00963.JPG');
k = 10;
sigma1 = 0.5;
sigma2 = sigma1*k;
hsize = [3,3];
h1 = fspecial('gaussian', hsize, sigma1);
h1 = fspecial('gaussian', hsize, sigma2);
gauss1 = imfilter(img,h1,'replicate');
gauss2 = imfilter(img,h2,'replicate');
dogImg = gauss1 - gauss2;
imshow(dogImg);
答案 0 :(得分:0)
我猜您可以将每个像素与移位的图像进行比较。下面找到4邻居最大值。
mask = dogImg > dogImg([1, 1:end-1], :) & ...
dogImg > dogImg([2:end, end], :) & ...
dogImg > dogImg(:, [1, 1:end-1]) & ...
dogImg > dogImg(:, [2:end, end]);
[y, x] = find(mask);