Image Processing pipeline for Granular
Steps to run image processor:
-
Install dependencies in requirements.txt (Note: Make sure BaseMap and all it's dependencies are installed for visualization. See https://matplotlib.org/basemap/users/installing.html)
-
Run python3 main.py
-->This will start a watchdog service (event triggers) on the directory data/raw_images --> Any files (jpg, subdirectories) added to the watchdog directory will trigger an event --> Subdirectory structure is recommended as it is easier to detect crop type based on subdirectory name
-
Copy data/photos to data/raw_images (Note: You can do this iteratively with each subdirectory(barley, corn, etc) as well)
-
The processed images can be found under data/processed_images (Note: All the directories are configurable under configs/configs.json)
-
Send a SIGINT ( ctrl + c) to stop the processor
-
The cordinates for the images can be found in data/visualize/cordinates.txt
-
To visualize the cordinates run ./visualize.py
Future Improvements:
- Use multithreading to process each image under a directory with a thread pool
- Use API and webserver to visualize the cordinates at any point in time
- Use a logging class instead of print statements