Method initialize
Select pixel function
added the sameNeigh function and the subfunctions similarityFunc and distanceFunc