Automated Mosaicing of Torn Paper Documents using Global Consistency