Giter VIP home page Giter VIP logo

template_detection's Introduction

Template Detection

This was the 2017-2018 project for the Python team in Tinovation.

The 2017-2018 "Notes" project hoped to use a Raspberry Pi to record a teacher's whiteboard throughout lecture. During the lecture, the Pi would stream images to a database. As the Python team, our objective was to use the streamed images to (a) identify the space within which the teacher was writing, and then (b) identify what was written.

We successfully identified the space within which the teacher was writing; however, due to time constraints, we were ultimately unable to reach out second goal of text identification.

We knew that this task would involve computer vision. After several attempts of trial and error, we found the sample code "face_detect.py", with which we were able to detect faces in "messi.jpg," "abba2.jpg" and "abba2.png". With this small success being achieved across multiple OS in our team, we decided that the libraries used in "face_detect.py", namely, OpenCV and numPy, were optimal in achieving our goals.

For our first attempt at identifying the text space, we tried identifying templates based off of color. To do this, we created "color_detection.py". The input image, "color_screenshot.jpg", would have a red template in the bottom left and top right corners of a whiteboard. The program identifies thresholds of color (in this case, red) and found the furthest xy coordinates that fit in the threshhold. The program would then create an image called "cropped.jpg" that contained only the area between the two red templates. This was successful in that it could find the area between the two colored symbols.

Then we realized that to be more accurate, it would help to identify templates based off of their shape. Our second attempt was "template_detection2.py", which had input "template.jpg" and "screenshot.jpg". The code searches source image "screenshot.jpg" and finds matching templates based off of the template image "template.jpg". It then draws a box around the two templates that are the furthest apart, and then draws a bigger box around that. (Again, this works on the logic that there would be a template at the bottom left and top right corners of the whiteboard.)

Our Results: While we were unsuccessful in our text identification, we gained a lot of valuable knowledge working with image inputs, OpenCV, and numPy formatting in regards to image processing. Skills gained included manipulating images stored as numPy arrays, reading and writing files using OpenCV, mapping color threshholds to zip files of xy points on the CV2 plane, and analyzing the different template matching methods to maximize for accuracy in our specific project.

template_detection's People

Contributors

emchin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.