Stereo imaging algorithm