Week 7 (30 Dec – 6 Jan) – Tkinter Canvas

A major drawback of the existing system for identifying the handwriting and differences are the image size, type and content. To mitigate that issue, the group decided that the input image of the algorithm will be created by the user on runtime. This is possible through the use of tkinter canvas. The user will first draw their numbers on the canvas, save it, exit, and immediately the algorithm will produce its prediction. This solved the issue of size as now the image’s size is predetermined by the canvas, eliminating issues due to size differences for the image similarity algorithm. The handwriting will also be clear and match the requirement of the MNist database comparison. A handwriting taken by a photo will not contain the best crop or color. The code provided by Nikhil Singh contains a tkinter canvas script that emulates the program paint. This is achieved by reading the mouses x and y position when it is on the canvas and if its clicked. However, the code does not come with a save feature. The group had problems implementing a save script as tkinter does not have a built-in save feature. The group at first used Image-Grabber to take a screenshot of the canvas based on its position on the screen. However, this method was inconsistent as the image will not cropped properly and is dependent on the canvas’ position on the computer screen. If the canvas is to the right of the computer screen, the screenshot will not include the canvas image. Furthermore, the canvas image became inconsistent in size, creating conflict when operating the image comparison code. To solve this issue, the group implemented the save feature which uses ghostscript to encode the canvas into a UTF-8 format, which will then be converted into a JPG output. 

This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.