1. A computing device comprising memory and instructions stored in memory and executable by the computing device to perform a method of training a codebook, the method comprising: for a training set of images comprising a high-resolution image, creating a blurred image that is lower in resolution than the high resolution image; detecting a location of an edge pixel in the transition region of the blurred image; defining a blurred visual pattern block that includes the edge pixel in the blurred image; defining a high-resolution visual pattern block in the high-resolution image corresponding to the edge pixel in the blurred image; determining a high-quality visual pattern block codeword corresponding to the high-resolution visual pattern block; determining a blurred visual pattern block codeword corresponding to the high quality visual pattern codeword; and forming a pair of two codewords comprising the high-quality visual pattern block codeword and the blurred visual pattern block codeword.