1. A computer implemented method of improving labeling of pixels in an image, the method operable on a processor, the method comprising: calculating, by the processor, an energy for a partially labeled solution and at least one unlabeled pixel, wherein said at least one unlabeled pixel is assigned a label corresponding to a fully labeled solution; computing, by the processor, a new labeled solution based on said energy for the partially labeled solution and said at least one unlabeled pixel using a quadratic pseudoboolean optimization algorithm; and updating labels in the fully labeled solution to correspond to the new labeled solution.