1. A computer-implemented method for automatically filling in a panoramic image having an invalid pixel region, comprising: estimating a reference surface common to an initial panoramic image and a nearby panoramic image; representing the initial panoramic image on a surface of a first three-dimensional sphere; representing the nearby panoramic image on a surface of a second three-dimensional sphere; automatically identifying an invalid pixel in the initial panoramic image based on a mask associated with the initial panoramic image and the reference surface; projecting the invalid pixel from a surface of the first three-dimensional sphere corresponding to the invalid pixel of the initial panoramic image onto a pixel location on the reference surface; identifying a projection point on the surface of the second three-dimensional sphere corresponding to a valid pixel in the nearby panoramic image based on the pixel location on the reference surface; and automatically replacing pixel data of the invalid pixel of the initial panoramic image based on pixel data of pixels of the valid pixel in the nearby panoramic image.