/** * Applies a local Otsu threshold * * @see ThresholdLocalOtsu * * @param scale Scale factor adjust for threshold. 1.0 means no change. * @param down Should it threshold up or down. * @param regionWidth About how wide and tall you wish a block to be in pixels. * @param inputType Type of input image * @return Filter to binary */ public static <T extends ImageGray<T>> InputToBinary<T> localOtsu(boolean otsu2, ConfigLength regionWidth , double tuning, double scale, boolean down, Class<T> inputType) { if( BOverrideFactoryThresholdBinary.localOtsu != null ) return BOverrideFactoryThresholdBinary.localOtsu.handle(otsu2,regionWidth, tuning, scale, down, inputType); return new InputToBinarySwitch<>(new ThresholdLocalOtsu(otsu2,regionWidth,tuning,scale,down),inputType); }