Phase Unwrapping Algorithm Using Edge Detection And Statistical Cost Functions