Skip to content

Keep Biggest Contours

Description

Keeps the contours inside the biggest one.
Needs to be part of a pipeline where a mask has already been generated
Same as Keep linked contours but won't be able to retrieve multi part contours Real time: False

Usage

  • Mask cleanup: Cleans a coarse mask generated by threshold tools

Parameters

  • Root contour position (root_position): (default: BOTTOM_CENTER)
  • Erosion/dilation iterations (kernel size 3) (dilation_iter): (default: 0)
  • Pseudo color channel (channel): (default: l)

Example

Source

Source image

Parameters/Code

Default values are not needed when calling function

1
2
3
4
5
from ipapi.ipt import call_ipt

mask = call_ipt(ipt_id="IptKeepBiggestContours",
                source="arabido_sample_plant.jpg",
                root_position='MIDDLE_CENTER')

Result

Result image