1. A method for forming a composite image from a set of images, the method comprising: using one or more processors to execute at least in part the following operations: identifying one or more foreground pixel groups in a first image from the set of images and one or more foreground pixel groups in a second image from the set of images; identifying a set of interest points selected from the foreground pixel groups in the first image; forming a set of point pairs by finding a set of points selected from the foreground pixel groups of the second image that correlates to the set of interest points; forming a transform using at least some of the set of point pairs; responsive to a foreground pixel group residing on a boundary of the first image or the second image, removing the foreground pixel group; responsive to at least one foreground pixel of a transformed foreground pixel group from the second image, which transformed foreground pixel group is obtained using the transform, corresponding at a same pixel location in the first image to a foreground pixel in the first image, discarding the foreground pixel group of the second image; for a foreground pixel group of the second image that has not been discarded: transforming, according to the transform, a bounding box that bounds the foreground pixel group; performing an inverse transform of at least some of the pixels within the transformed bounding box; and responsive an inverse-transformed pixel corresponding to a foreground pixel in the second image, making the pixel from the transformed bounding box a foreground pixel.