Camera program written using Python and OpenCV
The purpose of this program is to be used with a Raspberry Pi in order to take photos during the NASA Student Launch competition.
Do take a look at the current issues to see what needs to be done (feel free to add more if needed as well)
NOTE: When using the gif overlay, there is a lag in video output. I do not know if that will affect the camera output on the raspberry pi since we don't actually need video output, but it's something to keep in mind.
For running git commands, see here
Typically, you'll want to use git fetch origin main and git pull to update your local repo from the current one.
To merge onto main, save your commits onto a separate branch and push it to the repo, then create a pull request
Tip: If you have VSCode installed, you can type in code . in the file directory in the command line and immediately open the repo that way.
- Install python on your system
- Install required python packages with
pip install -r init.txt - To run it, type in
python cam.pyinto the terminal
space: takes a photo
1: toggle grayscale effect
2: toggle 180 flip effect
3: overlay a gif image of the bad news gif
4: static overlay (not needed but just in case gif overlay ends up falling through)
5: clears all effects
q: quits and closes the program
Images read in opencv using RGB or BGR are read using 3 color channels (red, green, blue). Our opencv program reads images using BGR, which just means the color blue is read in first.
Converting the image into grayscale turns that 3 channel image into a 2 channel one. That's why if you want to overlay another image, you have to either convert that overlay into a 2 channel, or convert the captured grayscale frame into a 3 channel.
You can see the different sizes of the images with the print([image].shape) that's inserted into the code.
- Add timestamp to photo
- Change image to and from grayscale
- Special effects filter
- Pan camera at different angles
- Be able to receive commands from radio signals