Skip to main content
. Author manuscript; available in PMC: 2018 Jan 27.
Published in final edited form as: IEEE Trans Image Process. 2016 Jul 27;25(10):4753–4767. doi: 10.1109/TIP.2016.2594486

Algorithm 3.

Sample selection for kCPM

Input: Positive training samples 𝒟+, negative training samples 𝒟, distance threshold r, order flag positive_first.
Output: Selected points set 𝒮
1: 𝒮 ←∅;
2: if positive_first then
3: 𝒟 = 𝒟+𝒟, where 𝒟+ occur first.
4: else
5: 𝒟 = 𝒟𝒟+, where 𝒟 occur first.
6: end if
7: for all xi in 𝒟 in order do
8: if minxj𝒮 d(xi, xj) > r then
9:   Add xi into 𝒮;
10: end if
11: end for