
Exercises 363
A direct implementation of this algorithm would be prohibitively slow, since
mean shifts a re to be computed for all of the pixels. For a partial solution in
Python using the OpenCV package, see Exercise 12(c).
In the ENVI/IDL extension MEAN_SHIFT_RUN described in Appendix C, two
approximations are employed to sp eed things up. First, all pixels within ra dius
r of convergence point w are assumed also to converge to that mode a nd are
excluded from further processing. Second, all pixels lying sufficiently close
(within a distance r/2) to the path tr aversed from the initial vector y
ν
to the
mode w are similarly assigned to that mode and