An Algorithm to Smooth and Find Objects in Astronomical Images