Ultrasonic imaging algorithm for the health monitoring of pipes