Skip to content

Interactive mask annotation tool for generating precise image segmentation masks with real-time visualization | 实时可视化手动标注mask生成工具

License

Notifications You must be signed in to change notification settings

semikonductor/InteractiveMaskAnnotator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polygon Mask Annotation Tool

PythonOpenCV

Interactive tool for creating precise polygon masks with real-time visualization.

Use Cases

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

Features

  • 🖱️ 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

Installation

pip install opencv-python numpy

Usage

  1. Place your image as test.png (or modify img_path in code)
  2. Run:
python main.py
  1. Annotate:
    • Left-click: Add vertex
    • Right-click: Remove last vertex
    • S: Save mask (auto-closed) and exit
    • ESC: Quit without saving

Output Example

Original Image Generated Mask
Input Output

Technical Notes

  • Coordinate system conversion between screen and original image
  • Automatic window centering with black borders
  • BGR color space standard for OpenCV compatibility

About

Interactive mask annotation tool for generating precise image segmentation masks with real-time visualization | 实时可视化手动标注mask生成工具

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages