Find Contours
This layer (find_contours) extracts contours from bitmaps and stores results as polygons.
1
{
2
"src": [
3
"$sample1"
4
],
5
"dst": "$sample2",
6
"action": "find_contours",
7
"settings": {
8
"classes_mapping": {
9
"my-mask": "found-contours"
10
}
11
}
12
}
Copied!
For each figure of class "my-mask" this will find contours (with OpenCV findContours), and the found contours will be stored as objects of shape "polygon" (class "found-contours").
Holes in source masks produce holes in polygons (with two-level hierarchy of borders).

Settings

  • classes_mapping โ€” dict where keys are existing classes of shape bitmap, and values are new names of classes.

Example

Example of usage may be found here.
Last modified 1yr ago
Copy link