Table of contents

ContoursUnit

The ContoursUnit class represents a unit that contains contours as intermediate results. It is derived from the IntermediateResultUnit class.

Definition

Module: dynamsoft_core

class ContoursUnit(IntermediateResultUnit)

Methods

Method Description
get_contours Gets the contours.
set_contours Sets the contours.

get_contours

Gets the contours.

def get_contours(self) -> Tuple[int, List[Contour], List[Vector4]]:

Return value

Returns a tuple containing following elements:

  • error_code <int>: The error code indicating the status of the operation.
  • contours <List[Contour]>: The contours in the unit.
  • hierarchies <List[Vector4]>: The hierarchies of the contours in the unit.

See Also

Contour

Vector4

set_contours

Sets the contours and hierarchies in the unit.

def set_contours(self, contours: List[Contour], hierarchies: List[Vector4], matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:

Parameters

contours The contours in the unit.

hierarchies The hierarchies in the unit.

matrix_to_original_image The transform matrix to original image.

Return Value

Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.

See Also

Contour

Vector4

Is this page helpful?

YesYes NoNo

In this article: