1. A method of improving labeling of pixels in an image comprising: calculating an energy for said 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 a new labeled solution based on said energy using a quadratic pseudoboolean optimization algorithm; and updating labels in the fully labeled solution using the new labeled solution.