WIP: Segfault is fixed, EM and KNN are unified in one function

ComputeEMPosteriors and ComputeKNNPosteriors are set in one function
called ComputePosteriors, that means KNN is run at each iteration of EM
loop.
Also, the dirtyThresholdedLabels image is the one that is used in
ComputeKNNPosteriors, since it has all labels (not only foreground regions).