AI Robotics Final Project of an image copying turtle
- Be able to batch process and apply binary thresholding to a myriad number of images using a single image processing function
- Using the binary images, extract the contours and their coordinates
- Using the contour coordinates extracted, redraw a processed image using the Python Turtle Module
- Be able to save the finalized results of the drawing and be able to save the drawing process as a gif
- OpenCV - for image processing and contour extraction
- Pillow (aka PIL) - for final result image saving and the gif creation
- Python Turtle - for the image drawing portion
- OpenCV's adaptive thresholding using the mean method.
- OpenCV's findContours function using the RETR_LIST mode and CHAIN_APPROX_NONE method
- Image Processing:
- Curtle's image processing contains of a few steps:
- Grayscale conversion
- Add a blur to our grayscale image
- Apply Adaptive Mean Thresholding
- Extract contours and their coordinates to pass to our drawing function
- Use Python's Turtle Module to redraw coordinates, coupled with PIL to save final results and GIF of the drawing process
- In regards to possible future work on Curtle, we would like to find a way to apply Canny Edge Detection so that we can compare our current results to what a Canny implementation's results would look like.
- Implementing arg parse so that we can run the code on individual images instead of a batch
- potentially run for videos.
- If you recieve an error "OSError: Unable to locate Ghostscript on paths" you should be able to solve it by doing the following:
- Install Ghostscript for your corresponding OS at this link: https://ghostscript.com/releases/gsdnld.html
- Add Ghostscript to the system path (if it is not added automatically)
- Verify installation
- Restart and rerun Curtle
Abhishek. (2024, March 28). Canny edge detection: Explained and compared with opencv in python. Medium. https://medium.com/@abhisheksriram845/canny-edge-detection-explained-and-compared-with-opencv-in-python-57a161b4bd19 Anastasia Murzova Sakshi Seth, Murzova, A., & Seth, S. (2021, May 5). Otsu’s Thresholding Technique. LearnOpenCV. https://learnopencv.com/otsu-thresholding-with-opencv/ Contours: Getting Started. OpenCV. (n.d.-a). https://docs.opencv.org/3.4/d4/d73/tutorial_py_contours_begin.html Image Thresholding. OpenCV. (n.d.-b). https://docs.opencv.org/4.x/d7/d4d/tutorial_py_thresholding.html Rosebrock, A. (2023, June 9). Adaptive Thresholding with opencv ( cv2.adaptivethreshold ). PyImageSearch. https://pyimagesearch.com/2021/05/12/adaptive-thresholding-with-opencv-cv2-adaptivethreshold/ Vipin. (2024, October 14). Contour detection in opencv: A comprehensive guide. Medium. https://medium.com/thedeephub/mastering-contouring-in-opencv-a-comprehensive-guide-10e6fe2a069a
Bulbapedia. (2024, September 27). Fuecoco (pokémon). https://bulbapedia.bulbagarden.net/wiki/Fuecoco_%28Pok%C3%A9mon%29 Carpenter, N. (2019, October 9). Pokemon’s developers just want us to take care of Sobble. Polygon. https://www.polygon.com/2019/10/9/20907051/pokemon-sword-shield-three-starter-pokemon-info Gilliam, R. (2021, September 23). New Kirby game for Switch Leaks ahead of Nintendo Direct. Polygon. https://www.polygon.com/22689856/kirby-nintendo-switch-direct-leak-discovery-stars Hillenburg, Stephen. “SpongeBob Square Pants.” (2) Marks, T. (2022, March 24). Kirby and the Forgotten Land Review. IGN. https://www.ign.com/articles/kirby-and-the-forgotten-land-review