Add MORPH_DIAMOND support to samples and tutorials

This commit is contained in:
krikera
2025-06-27 21:09:53 +05:30
parent 5ee8919139
commit 27867cc72c
11 changed files with 42 additions and 16 deletions

View File

@@ -23,7 +23,7 @@ import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;
public class MorphologyDemo1 {
private static final String[] ELEMENT_TYPE = { "Rectangle", "Cross", "Ellipse" };
private static final String[] ELEMENT_TYPE = { "Rectangle", "Cross", "Ellipse", "Diamond" };
private static final String[] MORPH_OP = { "Erosion", "Dilatation" };
private static final int MAX_KERNEL_SIZE = 21;
private Mat matImgSrc;
@@ -79,6 +79,8 @@ public class MorphologyDemo1 {
elementType = Imgproc.MORPH_CROSS;
} else if (cb.getSelectedIndex() == 2) {
elementType = Imgproc.MORPH_ELLIPSE;
} else if (cb.getSelectedIndex() == 3) {
elementType = Imgproc.MORPH_DIAMOND;
}
update();
}