@@ -309,7 +309,28 @@ public class CVOperations {
309309 }
310310 )),
311311
312- new OperationMetaData (CVOperation .defaults ("CV rectangle" ,
312+ new OperationMetaData (CVOperation .defaults ("CV morphologyEx" ,
313+ "Performs advanced morphological transformations." ),
314+ templateFactory .create (
315+ SocketHints .Inputs .createMatSocketHint ("src" , false ),
316+ SocketHints .Inputs .createMatSocketHint ("kernel" , true ),
317+ SocketHints .createEnumSocketHint ("op" , CVMorphologyTypesEnum .MORPH_OPEN ),
318+ new SocketHint .Builder <>(Point .class ).identifier ("anchor" ).initialValueSupplier (
319+ () -> new Point (-1 , -1 )).build (),
320+ SocketHints .Inputs .createNumberSpinnerSocketHint ("iterations" , 1 ),
321+ SocketHints .createEnumSocketHint ("borderType" , BorderTypesEnum .BORDER_CONSTANT ),
322+ new SocketHint .Builder <>(Scalar .class ).identifier ("borderValue" )
323+ .initialValueSupplier (opencv_imgproc ::morphologyDefaultBorderValue ).build (),
324+ SocketHints .Outputs .createMatSocketHint ("dst" ),
325+ (src , kernel , op , anchor , iterations , borderType , borderValue , dst ) -> {
326+ opencv_imgproc .morphologyEx (src , dst , op .value , kernel , anchor , iterations .intValue (),
327+ borderType .value , borderValue );
328+ }
329+ )),
330+
331+
332+
333+ new OperationMetaData (CVOperation .defaults ("CV rectangle" ,
313334 "Draw a rectangle (outline or filled) on an image." ),
314335 templateFactory .create (
315336 SocketHints .Inputs .createMatSocketHint ("src" , false ),
@@ -426,6 +447,20 @@ public enum CVBorderTypesEnum {
426447 }
427448 }
428449
450+ public enum CVMorphologyTypesEnum {
451+ MORPH_OPEN (2 ),
452+ MORPH_CLOSE (3 ),
453+ MORPH_GRADIENT (4 ),
454+ MORPH_TOPHAT (5 ),
455+ MORPH_BLACKHAT (6 ),
456+ MORPH_HITMISS (7 );
457+
458+ public final int value ;
459+
460+ CVMorphologyTypesEnum (int value ) { this .value = value ;}
461+
462+ }
463+
429464
430465 /**
431466 * All of the operations that this list supplies.
0 commit comments