findContours function

VecVARP findContours(
  1. VARP img,
  2. int mode,
  3. int method, {
  4. (double, double) offset = (0, 0),
})

method only support CHAIN_APPROX_NONE, CHAIN_APPROX_SIMPLE

Implementation

VecVARP findContours(VARP img, int mode, int method, {(double, double) offset = const (0, 0)}) {
  if (method != CHAIN_APPROX_NONE && method != CHAIN_APPROX_SIMPLE) {
    throw ArgumentError.value(method, 'method', 'Only support [CHAIN_APPROX_NONE], [CHAIN_APPROX_SIMPLE]');
  }
  final cOffset = Point.fromTuple(offset);
  final pOut = c.mnn_cv_findContours(img.ptr, mode, method, cOffset.ref);
  final rval = VecVARP.fromPointer(pOut);
  cOffset.dispose();
  return rval;
}