I am implementing an algorithm in image processing which contains a while loop which must be terminated when a condition is satisfied.
My problem is