31 switch (kshape::get())
33 case morphologyfilter::KernelShape::Rectangle:
34 kernel = cv::getStructuringElement(cv::MORPH_RECT, ksize::get());
break;
35 case morphologyfilter::KernelShape::Cross:
36 kernel = cv::getStructuringElement(cv::MORPH_CROSS, ksize::get());
break;
37 case morphologyfilter::KernelShape::Ellipse:
38 kernel = cv::getStructuringElement(cv::MORPH_ELLIPSE, ksize::get());
break;
45 case morphologyfilter::MorphoOp::Erode: mop = cv::MORPH_ERODE;
break;
46 case morphologyfilter::MorphoOp::Dilate: mop = cv::MORPH_DILATE;
break;
47 case morphologyfilter::MorphoOp::Open: mop = cv::MORPH_OPEN;
break;
48 case morphologyfilter::MorphoOp::Close: mop = cv::MORPH_CLOSE;
break;
49 case morphologyfilter::MorphoOp::Gradient: mop = cv::MORPH_GRADIENT;
break;
50 case morphologyfilter::MorphoOp::TopHat: mop = cv::MORPH_TOPHAT;
break;
51 case morphologyfilter::MorphoOp::BlackHat: mop = cv::MORPH_BLACKHAT;
break;
54 cv::morphologyEx(src, dst, mop, kernel, anchor::get(), iter::get());
56 return "op=" + op::strget() +
", kshape=" + kshape::strget() +
",\nksize=[" + ksize::strget() +
57 "], anchor=[" + anchor::strget() +
"], iter=" + iter::strget();