StructuredEdgeDetection.create constructor

StructuredEdgeDetection.create(
  1. String model, {
  2. RFFeatureGetter? howToGetFeatures,
})

Implementation

factory StructuredEdgeDetection.create(String model, {RFFeatureGetter? howToGetFeatures}) {
  final cmodel = model.toNativeUtf8().cast<ffi.Char>();
  final p = calloc<cvg.StructuredEdgeDetection>();
  howToGetFeatures == null
      ? cvRun(() => ccontrib.ximgproc_StructuredEdgeDetection_Create(cmodel, p))
      : cvRun(() => ccontrib.ximgproc_StructuredEdgeDetection_Create_1(cmodel, howToGetFeatures.ref, p));
  calloc.free(cmodel);
  return StructuredEdgeDetection.fromPointer(p);
}