Project used for Embedded Systems project in Poznań University of Technology. The goals of this project are:
- Extracting contours from images
- Drawing them on A5 paper
- Saving them in a database for later reusage
The project currently supports uploading images from computer or taking pictures with PiCamera.
- Raspberry Pi 2 Model B V1.1
- Raspbery Pi Camera Rev 1.3
This repository contains the following files:
static/css/styles.css
- global stylesheet with styles used in the whole webappstatic/images
- this is where the app stores temporary images, do not remove itstatic/scripts/utls.js
- AJAX and vanilla JS functions used by the webappstatic/scripts/camera.js
- script for interacting with camera APIstatic/scripts/images.js
- script for fetching images from the databasestatic/scripts/navigation.js
- script for navigating between pagesstatic/scripts/plot.js
- script for interacting with the plotterstatic/scripts/stats.js
- script for fetching stats (plotter state, logs)static/scripts/upload.js
- script for uploading images to servertemplates/*.html
- pages of the webappcamera.py
- script controlling the cameradatabase.py
- script for operating on the databaseentrypoint.sh
- bash script used to start the appextractor.py
- script for extracting contours from images using OpenCV librarylogger.py
- setup for logging:
- Logs of level
DEBUG
will be saved to a file namedplotter.log
- Logs of level
INFO
will be printed to the console
main.py
- main server with all the endpoints, merging all parts togetherplot.py
- script for working with the plotterrequirements.pip
- list of libraries required in the project
- Install python on your Raspberry Pi (Python 3+):
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
tar xf Python-3.6.0.tar.xz
cd Python-3.6.0
./configure --enable-optimizations --prefix=/usr
make
- Install pip:
sudo apt-get install python3-pip
- Install requirements:
pip3 install -r requirements.pip
- Ensure that the plotter is in starting position (0 on X and 0 on Y axis, plotter will move from and return there)!
- Start the server:
sudo chmod 777 entrypoint.sh
./entrypoint.sh
- Navigate to
http://127.0.0.1:5000/
orhttp://0.0.0.0:5000/
in your browser and you are good to go!
Before submitting your pull request please check your code with pylint - settings for pylint are available in .pylintrc
file. Github Actions will automatically run it on your code on every pull request. Please also remember this is a school project therefore the repository may become inactive after a while when its authors will graduate.
This project is licensed under MIT license, which means that you have the right to distribute, modify and use this project in your own projects (even under more strict license) so long as you provide the original authors whose work you are using in your project and do not hold them liable.
List of known bugs / possible improvements:
- When removing (5*n+1)-th image the JS will not reset the pagination