morphClose static method
Morphological closing: dilation followed by erosion.
Fills small dark holes while preserving shape and size of larger objects.
Equivalent to OpenCV's cv::morphologyEx(MORPH_CLOSE).
Implementation
static Uint8List morphClose(
Uint8List gray,
int width,
int height, {
int kernelSize = 3,
}) {
final dilated = dilate(gray, width, height, kernelSize: kernelSize);
return erode(dilated, width, height, kernelSize: kernelSize);
}