Skip to content

MarcelBruckner-TUMProjects/DataAnnotationTools

Repository files navigation

Data Annotation Tools

This serves as a collection of data annotation tools for data labelling, i.e. image segmentation.


Running in Standalone Mode

See below for the necessary dependencies.

Compiling

mkdir build && cd build
cmake ..
cmake --build . -j8

CMake Configure Options

# Default is OFF for all options

-DWITH_TESTS=ON/OFF     # Build with tests.

Testing

cd cpp 
ctest --verbose

Apps

WaterSheder

A Marker-based Image Segmentation Tool

The algorithm fills the image from drawn marker locations until the image gradient surpasses a specific threshold. This results in a segmentation around the border of objects with the same color.

To segment an image using the WaterSheder mark connected regions with the mouse. All connected markers form one region, and you can extend a region by extending the marker. The biggest component needs to be the background, which itself must have a marker region. This means that at least 2 markers need to be placed.

Example execution of the WaterSheder

Running

./cpp/app/WaterSheder -h  # Prints the help message.
                          # See it for the required input data and further usage.

Mouse Commands

Key Description
Left Draw markers.

Keyboard Commands

Key Description
b Quick zoom out of the image to see the full image.
c Clear all markers in the current visible region.
d Toggle delete mode. In delete mode left mouse button strokes remove marked pixels.
n Quick zoom into the image to see the enlarged region around your mouse location.
The resulting zoom level is based on the Quick Zoom trackbar value.
q Quit program (Without confirmation).
r Toggle to render the watershed mask.
s Save the watershed results as a YAML file specified by -o/--output.
w, SPACE Run the watershed algorithm based on the current markers.
09 Set stroke thickness of the left mouse button.

Sliders

Key Description
Pos X Sets the X pixel position of the top left corner of the visible region.
Pos Y Sets the Y pixel position of the top left corner of the visible region.
Zoom The current zoom level. 0 = Total zoomed in, 100 = Full image shown.
Quick Zoom The zoom level after hitting n.
Thickness The thickness of the left mouse button stroke.

Best Practices

  • Save often! There is no way to reload when the program was closed.
  • Start by roughly filling the background with one big marker.
  • Zoom in and out of the image with n and b.
  • Repeatedly using n follows the mouse movement through the zoomed image.
  • If the algorithm does not correctly detect the object border, try to roughly outline the object by extending the background marker.
  • If you enclose a marker with a loop of another marker, the enclosed region of the inner marker will be part of the outer markers region.

Dependencies

Dependency Usage Installation Required
Boost Command line parsing sudo apt install libboost-all-dev Yes
OpenCV Rendering during evaluation extern/setup_opencv.sh

Please only run if you don't use OpenCV elsewhere. This might cause problems if you have your own OpenCV setup installed, as it compiles OpenCV with the minimal flags needed and overrides the system installation.
-DWITH_OPENCV=ON

Internal Dependencies

These dependencies are pulled by CMake when the project is built. You do not have to install them manually.

Dependency Usage Required
YAML-CPP YAML parser for objects and pixels Yes
GoogleTest Google unit testing framework -DWITH_TESTS=ON

About

A collection of data annotation tools I use during my projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages