Photogrammetric Algorithms and Software for Spacecraft Optical Imaging Systems