This approach uses a pipeline of computer vision and machine learning algorithms to detect the center of the panels. The general algorithm goes as follows:
1. Preprocess Image
2. Bitmask LEDs
4. Match target LEDs
5. Compute center of panel
parser.add_argument('-c', "--camera", default="webcam", help="Which camera to use, e.g. raspberry, webcam")
parser.add_argument('-i', '--framework', default="opencv",
help="Specifies which framework to use as inference, e.g. opencv, tensorflow")
parser.add_argument('-s', '--show', type=bool, help='Conditonal for displaying frame', default=True)
python source -i opencv -s false
cd vision
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements/requirements.txt
cd vision/source/panel_predictor/panel_finder/
python panel_classifier/ --mode train
cd vision/source/panel_predictor
python panel_finder --mode {video/webcam} --video {video_path}
Tensorflow 2.0 has no longer supports the freezing of tensorflow graphs to .pb files. We need to downgrade in order to do this if we want to use OpenCV DNN
cd vision/requirements
virtualenv -p python3 tf114
source tf114/bin/activate
pip install requirements_convert.txt
cd source/panel_predictor/panel_finder/
python panel_classifier/ --mode convert
- For Raspberry Pi follow the guide in the raspberrypi_setup directory
- For laptops you can the venv virtual environment
cd vision/source/panel_predictor
python panel_finder/ --mode {video/webcam} --vide {video_path} --framework opencv