|
17 | 17 | import edu.wpi.grip.generated.opencv_imgproc.enumeration.ColorConversionCodesEnum;
|
18 | 18 | import edu.wpi.grip.generated.opencv_imgproc.enumeration.ColormapTypesEnum;
|
19 | 19 | import edu.wpi.grip.generated.opencv_imgproc.enumeration.InterpolationFlagsEnum;
|
| 20 | +import edu.wpi.grip.generated.opencv_imgproc.enumeration.MorphTypesEnum; |
20 | 21 | import edu.wpi.grip.generated.opencv_imgproc.enumeration.ThresholdTypesEnum;
|
21 | 22 |
|
22 | 23 | import com.google.common.annotations.VisibleForTesting;
|
@@ -313,16 +314,16 @@ public class CVOperations {
|
313 | 314 | "Performs advanced morphological transformations."),
|
314 | 315 | templateFactory.create(
|
315 | 316 | SocketHints.Inputs.createMatSocketHint("src", false),
|
| 317 | + SocketHints.createEnumSocketHint("op", MorphTypesEnum.MORPH_OPEN), |
316 | 318 | SocketHints.Inputs.createMatSocketHint("kernel", true),
|
317 |
| - SocketHints.createEnumSocketHint("op", CVMorphologyTypesEnum.MORPH_OPEN), |
318 | 319 | new SocketHint.Builder<>(Point.class).identifier("anchor").initialValueSupplier(
|
319 | 320 | () -> new Point(-1, -1)).build(),
|
320 | 321 | SocketHints.Inputs.createNumberSpinnerSocketHint("iterations", 1),
|
321 | 322 | SocketHints.createEnumSocketHint("borderType", BorderTypesEnum.BORDER_CONSTANT),
|
322 | 323 | new SocketHint.Builder<>(Scalar.class).identifier("borderValue")
|
323 | 324 | .initialValueSupplier(opencv_imgproc::morphologyDefaultBorderValue).build(),
|
324 | 325 | SocketHints.Outputs.createMatSocketHint("dst"),
|
325 |
| - (src, kernel, op, anchor, iterations, borderType, borderValue, dst) -> { |
| 326 | + (src, op, kernel, anchor, iterations, borderType, borderValue, dst) -> { |
326 | 327 | opencv_imgproc.morphologyEx(src, dst, op.value, kernel, anchor,
|
327 | 328 | iterations.intValue(), borderType.value, borderValue);
|
328 | 329 | }
|
@@ -447,17 +448,16 @@ public enum CVBorderTypesEnum {
|
447 | 448 | }
|
448 | 449 | }
|
449 | 450 |
|
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); |
| 451 | + public enum CVMorphTypesEnum { |
| 452 | + MORPH_OPEN(MorphTypesEnum.MORPH_OPEN.value), |
| 453 | + MORPH_CLOSE(MorphTypesEnum.MORPH_CLOSE.value), |
| 454 | + MORPH_GRADIENT(MorphTypesEnum.MORPH_GRADIENT.value), |
| 455 | + MORPH_TOPHAT(MorphTypesEnum.MORPH_TOPHAT.value), |
| 456 | + MORPH_BLACKHAT(MorphTypesEnum.MORPH_BLACKHAT.value); |
457 | 457 |
|
458 | 458 | public final int value;
|
459 | 459 |
|
460 |
| - CVMorphologyTypesEnum(int value) { |
| 460 | + CVMorphTypesEnum(int value) { |
461 | 461 | this.value = value;
|
462 | 462 | }
|
463 | 463 | }
|
|
0 commit comments