-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSURFDetector.m
More file actions
48 lines (39 loc) · 1.29 KB
/
SURFDetector.m
File metadata and controls
48 lines (39 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
classdef SURFDetector < Detector
%SURFDETECTOR Detect features using the speeded-up robust features
%(SURF) detector
properties
metricThreshold;
numOctaves;
numScaleLevels;
end
methods
function obj = SURFDetector(metricThreshold, numOctaves, ...
numScaleLevels)
obj = obj@Detector(0);
if nargin > 0
obj.metricThreshold = metricThreshold;
else
obj.metricThreshold = 1000.0;
end
if nargin > 1
obj.numOctaves = numOctaves;
else
obj.numOctaves = 3;
end
if nargin > 2
obj.numScaleLevels = numScaleLevels;
else
obj.numScaleLevels = 4;
end
end
function points = detectFeatures(obj, img)
if ~ismatrix(img)
img = rgb2gray(img);
end
points = detectSURFFeatures(img, ...
'MetricThreshold', obj.metricThreshold, ...
'NumOctaves', obj.numOctaves, ...
'NumScaleLevels', obj.numScaleLevels);
end
end
end