Week 6 (23 Dec – 30 Dec) – Image Comparison

After the handwriting has been predicted through the use of comparison to the MNist supplied data, the handwriting image will be compared to the image of the predicted number in a certain font. For example, if the number predicted is 3, the original input image will then be compared to the image of 3 in the font of Times New Roman. This is done by comparing the similarity between two images by calculating the SSIM (Structural Similarity Index) value. The code provided by Adrian Rosebrock produces the result of images visual differences and the SSIM value. OpenCV is used to identify exactly where in the x,y axis the image differences are. This will allow for the algorithm to map out where the differences in the images are. The SSIM is produced after both images (of equal size) are converted into grayscale. The conversion to grayscale is to simplify the conversion of color into bits. The difference is represented as floating points of 0s and 1s. The 0s representing the area where it is the same, while the 1s represents the area that is different. A bounding box will be generated based on the locations of where the difference exists, and the algorithm visualizes the differences. An issue that arises with this code is that the image of the input image and the compared image must be exactly the same size. The code will not function if there is a size difference, hence the input image size must either be in an environment controlled or resized. Resizing the input image is not ideal as it will pixelate and distort the original image. Hence the group must create a fixed and controlled environment to generate the image. Source: https://www.pyimagesearch.com/2017/06/19/image-difference-with-opencv-and-python/

This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.