This GUI is for displaying images and selecting region of interest (ROI).
Python 3 and a few external modules (install them with pip install <module> if Python complains).
- Place utils.py and session.py in the same directory and run session.py.
- You have the option to load an output csv file from previous session or start a new session.
- The output file from previous session should not have been altered! Work with copies if altering the file is necessary
- If starting a new session, select all image files by using Ctrl or Shift buttons.
- Marking ROI
- Select ROI using the radio option.
- Create a polygon on the image.
- Left click adds a point
- Right click finalizes the polygon
- Repeat above steps. You can reset the ROIs with “Clear ROI” button.
- When you’re done with the image, click “Finalize Image”. This will save the ROI for the next image (“Apply Previous ROI” button).
- Output
- Click “Save and close” to save the output csv file.
- The output will be a csv file with the iamge metadata, ROI coordinates, and ROI statistics
- Note: ROI coordinates will be a list of (x,y) values
- i.e. [(3,4), (10, 10), (5,2)]
- Note: ROI coordinates will be a list of (x,y) values
- This is the file you can load a session with.
- Hotkeys
- Enter: finalize image
- Space: apply previous ROI
- Right arrow: skip to next image
To modify the ROI types, you can edit the ROI_TYPES and ROI_COLORS variables in utils.py.
This is more complicated. You have to modify the STATS variable in utils.py, but the output file save the result. I need to test this.
This might be useful if a large image is causing issues with the size of your app. You can change the size of region dedicated for displaying the image (default is 1600x1200). This is in utils.py under CANVAS_SIZE variable.
Assume that the input directory is the camera_id. The input will be a folder associated with a camera. The current implementation keeps all the images around. i.e. for 200 images, I had 4gb memory overhead.Fix this so that only current image is opened.
Image scrollbar is on the top and left. When the image is too large you can’t access the right and bottom side of the app.
If image is finalized without ROI, it overwrites the previous ROI. This is a safe way but it might be inconvenient.