@@ -309,7 +309,28 @@ public class CVOperations {
309
309
}
310
310
)),
311
311
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 ,
327
+ iterations .intValue (), borderType .value , borderValue );
328
+ }
329
+ )),
330
+
331
+
332
+
333
+ new OperationMetaData (CVOperation .defaults ("CV rectangle" ,
313
334
"Draw a rectangle (outline or filled) on an image." ),
314
335
templateFactory .create (
315
336
SocketHints .Inputs .createMatSocketHint ("src" , false ),
@@ -426,6 +447,21 @@ public enum CVBorderTypesEnum {
426
447
}
427
448
}
428
449
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 ) {
461
+ this .value = value ;
462
+ }
463
+ }
464
+
429
465
430
466
/**
431
467
* All of the operations that this list supplies.
0 commit comments