public static < I extends ImageGray < I > , D extends ImageGray < D > > ImageGradient < I , D > gradientSB ( DerivativeType type , Class < I > inputType , Class < D > derivType ) { if ( derivType == null ) derivType = GImageDerivativeOps . getDerivativeType ( inputType ) ; Class which ; switch ( type ) { case PREWITT : which = GradientPrewitt . class ; break ; case SOBEL : which = GradientSobel . class ; break ; case THREE : which = GradientThree . class ; break ; case TWO_0 : which = GradientTwo0 . class ; break ; case TWO_1 : which = GradientTwo1 . class ; break ; default : throw new IllegalArgumentException ( "Unknown type " + type ) ; } Method m = findDerivative ( which , inputType , derivType ) ; return new ImageGradient_Reflection <> ( m ) ; }
Returns the gradient for single band images of the specified type