Optimisation of card recognition routine

University essay from Uppsala universitet/Institutionen för informationsteknologi

Author: Emil Bagge; [2020]

Keywords: ;

Abstract: Card-dealing machines for the game Bridge are used to automate the time-consuming process of sorting cards. They require methods to recognize each card's suit and value during the process, as the sorting is predetermined. The machine considered in      this thesis uses a webcam that feeds a 30 FPS video stream to a contour analysis algorithm. This thesis goes through and researches possible solutions for 3 different improvement areas: motion blur, degradation and colour recognition. Motion blur occurs when the cards move around in the machine, resulting in heavily distorted images whose suit and value are difficult to recognize. I propose using a metric based on the variance of the Laplacian to recognize blurry images. Testing shows that this is an efficient and accurate method that allows the machine to save time by quickly discarding blurry images. Degradation in the form of stains or colour loss risks breaking the connectivity of contours by distorting shapes and figures, making contour analysis unreliable. To deal with this I propose different morphological operations, such as closing and erosion, to quickly adjust these types of errors. By applying these methods, images whose suit   and value were previously unrecognizable could be processed successfully. To compensate for the added run-time I propose implementing Otsu’s thresholding as a more efficient binarization method. Testing shows that it is 4 times faster than the old method. But since it is unable to binarize bright images I suggest using the old method as a fallback if Otsu's method fails. More testing is needed to establish if time is ultimately saved. Colour information could help the recognition but is currently not used. I propose a simple metric based on the amount of red pixels found by converting the RGB image into HSV and thresholding the hue channel. By only considering the center of the image, the thresholding becomes 3.5 times faster while also being less noisy than using the entire image. But since colour space conversion is a time-consuming process and the resulting information has limited use, it is unlikely that this method is worth implementing. Out of the 3 different improvement areas that has been researched 4 methods are proposed, but only 2 show promise after testing; a blur metric based on the Laplacian and using morphological operations to fix distorted images. Otsu's method is fast but unreliable and the redness metric results in very little value added relative to run-time cost.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)