Finds largest connected shape in a matrix.
Given a matrix of (m x n), containing values of 0 and 1, determines the largest shape that contains entirely values of 1. The shape must not intersect other shapes, so all contour lines must be surrounded by 0 values.
Example matrix:
0 1 0 1 1 1 0
1 1 0 1 1 0 0
0 0 0 0 0 0 1
0 0 0 0 1 1 1
Here the top right shape is the largest one, containing the most values of 1.
The implmentation is based on labelling algorithm known from computer vision.
"Interesting" files:
src/matrixblobfinder/matrixblobfinder.cpp
src/main.cpp
tests/main.cpp
build/test/test.log
Before running cmake, make sure conan
is installed: pip install conan
Build with cmake as usual, then run build/bin/demo
or ctest
inside the build directory.