Spatial compound imaging via beam-steering aims to improve image quality through signal averaging. However, compounding techniques are vulnerable to speed-of-sound and refraction distortions in non-homogeneous tissue. We have developed a system to perform image-based non-rigid registration in real time. The goal is to increase image quality by improving the alignment of the ultrasound frames before compounding. Frames are acquired by a PC-based ultrasound machine (Ultrasonix Inc, Vancouver, Canada), and transmitted to a Windows-based workstation through a high-speed network. Robust image-to-image registration (warping) is performed using block-based estimation of local shifts and thin-plate spline interpolation. Compound images are computed as a rolling average of the nine most recent warped frames. The procedure runs at 20 frames per second on a dual-processor Xeon workstation, demonstrating the feasibility of sophisticated real-time image processing on a standard PC platform. High speed is achieved through algorithm refinements, approximations in speed-critical sections, and low-level optimizations. The result is a fully-automatic real-time spatial compounding system with a demonstrated improvement in image quality. Tests of registration accuracy were performed on simulated data with realistic speckle patterns, using a 10% speed-of-sound variation and an 8° beam-steering angle. The average misalignment across the image was reduced by 70%, from of 0.22 mm to 0.07 mm; in the deepest parts of the image, alignment was improved by 91%. Improved quality is demonstrated on images of a human forearm, which show visibly improved edge sharpness. This work is one of a series of projects demonstrating the ability of a new open-architecture ultrasound system.