← Back to projects

Industrial Robot Playing Tic-Tac-Toe via Computer Vision

Role
Software unit
Context
Undergraduate capstone project
Period
2021-2022
Team
4 people
PythonComputer visionMinimaxQt Creator
The robot makes its move based on the board state it reads through computer vision
The full loop in motion: camera read, board state, move decision and robot arm execution
Vision output: the board matrix read from the camera and the robot's move decision

My contribution

  • The image processing pipeline that turns the camera frame into a board matrix, in Python
  • Designing and implementing the Minimax tree based game solving algorithm
  • The operator interface: prototyped in Kodular Creator, then rewritten in Qt Creator
  • Translating raw robot data into language the user actually understands
PythonComputer visionMinimax Qt CreatorAndroidIndustrial robot

This project was the first version of what I do with YOLO today: turning a camera frame into a data structure a machine can decide on. It used classical image processing rather than deep learning, but the problem was the same one: turning an image into an action.

def tahta_matrisi(kare):
    """Kameradan tahta durumu: 3x3 matris (-1 bos, 0 O, 1 X)."""
    gri = cv2.cvtColor(kare, cv2.COLOR_BGR2GRAY)
    esik = cv2.adaptiveThreshold(gri, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C,
                                 cv2.THRESH_BINARY_INV, 31, 7)
    durum = [[-1] * 3 for _ in range(3)]
    for satir in range(3):
        for sutun in range(3):
            hucre = hucre_kes(esik, satir, sutun)   # perspektiften duzeltilmis
            durum[satir][sutun] = sinifla(hucre)    # kontur sayisi + doluluk
    return durum
Simplified, representative snippet: reading the board state from the camera frame