Interactive tool for creating precise polygon masks with real-time visualization.
| Domain | Description & Examples |
|---|---|
| Image Inpainting | ✅ Precisely mark damaged areas 🖼️ Example: Old photo restoration |
| Medical Imaging | ⚕️ Annotate organ boundaries in CT scans 🩺 Example: Lung nodule annotation |
| Satellite Analysis | 🛰️ Extract building polygons 🌆 Example: Urban expansion studies |
- 🖱️ Left-click to add points | Right-click to undo
- 🔍 Adaptive window scaling with coordinate mapping
- 🎨 Generates 3-channel PNG masks
- 📏 Preserves original image dimensions
- 🔄 Real-time visual feedback
pip install opencv-python numpy- Place your image as
test.png(or modifyimg_pathin code) - Run:
python main.py- Annotate:
- Left-click: Add vertex
- Right-click: Remove last vertex
- S: Save mask (auto-closed) and exit
- ESC: Quit without saving
| Original Image | Generated Mask |
|---|---|
![]() |
![]() |
- Coordinate system conversion between screen and original image
- Automatic window centering with black borders
- BGR color space standard for OpenCV compatibility

