Digitizing a 2D pattern template using a photo from a standard camera