summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.m
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-19 23:09:30 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-20 02:40:39 -0400
commitf618466c25d43f3bae9e40920273bf77de1e1149 (patch)
tree460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.m
parent47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff)
initial sd-vbs
initial sd-vbs add sd-vbs sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.m')
-rw-r--r--SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.m33
1 files changed, 33 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.m b/SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.m
new file mode 100644
index 0000000..cee30ce
--- /dev/null
+++ b/SD-VBS/benchmarks/sift/src/matlab/siftlocalmax.m
@@ -0,0 +1,33 @@
1% SIFTLOCALMAX Find local maximizers
2% SEL=SIFTLOCALMAX(F) returns the indexes of the local maximizers of
3% the Q-dimensional array F.
4%
5% A local maximizer is an element whose value is greater than the
6% value of all its neighbors. The neighbors of an element i1...iQ
7% are the subscripts j1...jQ such that iq-1 <= jq <= iq (excluding
8% i1...iQ itself). For example, if Q=1 the neighbors of an element
9% are its predecessor and successor in the linear order; if Q=2, its
10% neighbors are the elements immediately to its north, south, west,
11% est, north-west, north-est, south-west and south-est
12% (8-neighborhood).
13%
14% Points on the boundary of F are ignored (and never selected as
15% local maximizers).
16%
17% SEL=SIFTLOCALMAX(F,THRESH) accepts an element as a mazimizer only
18% if it is at least THRES greater than all its neighbors.
19%
20% SEL=SIFTLOCALMAX(F,THRESH,P) look for neighbors only in the first
21% P dimensions of the Q-dimensional array F. This is useful to
22% process F in ``slices''.
23%
24% REMARK. Matrices (2-array) with a singleton dimension are
25% interpreted as vectors (1-array). So for example SIFTLOCALMAX([0 1
26% 0]) and SIFTLOCALMAX([0 1 0]') both return 2 as an aswer. However,
27% if [0 1 0] is to be interpreted as a 1x2 matrix, then the correct
28% answer is the empty set, as all elements are on the boundary.
29% Unfortunately MATLAB does not distinguish between vectors and
30% 2-matrices with a singleton dimension. To forece the
31% interpretation of all matrices as 2-arrays, use
32% SIFTLOCALMAX(F,TRESH,2) (but note that in this case the result is
33% always empty!).