Student Name: I Yusuf Omar


About the student

My name is Ismail Yusuf Omar. I am a dedicated computer science enthusiast, currently pursuing my Honors in Computer Science.



About the Project

This project focuses on solving scrambled jigsaw puzzles using computer vision techniques, specifically contour matching and genetic algorithms. Using OpenCV, the jigsaw puzzle image undergoes pre-processing steps such as grey scaling and thresholding, enhancing its clarity and eliminating noise or unwanted artifacts. This prepares the image for creating a binary mask and contour extraction for each puzzle piece. Post segmentation, the puzzle-solving approach diverges into two methods: Edge Matching and Genetic Algorithms. For Edge Matching: The system tries matching all possible piece pairs. OpenCV's findContours() extracts features like height, width, and angle from each sub-contour. Color points from these sub-contours are compared using the FastDTW distance metric, which assesses the similarity of HSV color sequences. If two pieces (say A and B) match well in both contour and color, they're merged, narrowing the search space. For the Genetic Algorithm: A chromosome represents a potential puzzle arrangement. Puzzle pieces are randomly positioned, and the edge-matching technique assesses fitness between neighboring pieces, streamlining the search space. Using a roulette wheel selection method, the best solutions over generations reproduce, creating new populations until an optimal puzzle arrangement emerges.