Inspiration

I wanted to make this project ever since I watched the series Teen wolf in which there is a scene where a cop is notified when a person opens his laptop and a picture is clicked of that person .

What it does

This project is made using python and opencv. the program first converts the image to grayscale and then compares the first frame it took to all the frames it captures until it finds a difference between the frames. Then further processing is done on that frame. The computer creates a rectangle around most likely object it detected and sends the image to the user's given email.

How I built it

I built this project using python and open cv which is built on numpy . I first learned about open cv through youtube tutorials and practiced it by building some basic programs using it. I surfed the open cv docs and after creating a normal video program I learned how to do image processing through youtube and stack overflow.

How to run the Program?

1) clone the repository 2) CREATE an 'images' folder without changing the name in the same directory as the object_detection.py file .You can copy and paste the name 'images'. 3) Please use a gmail account with the program if you use outlook or any other account the program will not be able to send an email to that account. 4) when you run the program, you will see a prompt to enter your email and another prompt where you have to enter 0 to use the main (integrated) camera or 1 to use a secondary camera. 5) when the program runs, please go out of your video frame otherwise the program will identify you as background and not work properly. After it starts you can try coming in frame or to bring some object in the video frame. 6) To quit the program press 'q'

Challenges I ran into

One of the challenge I ran into is that after I had initiated the send email function, the video froze. I found out that it was because the send email functions takes some time to execute and the script does not go forward because of it. So I searched stack overflow and came across a concept called threading. Which then I learned more about and implemented it in the code.

Accomplishments that I am proud of

Granted that this project is still not without its inefficiencies and its not 100% accurate but I am proud of the fact that I was able to learn Image processing and open cv in a week and build this project.

What I learned

I learned how to process images, Threading and How to send an attachment through email.message module.

What's next for Who Opened My Laptop?

Next I am planning to build a website for it using streamlit and integrating this program into the website.

Built With

Share this project:

Updates