use of boofcv.abst.filter.ImageFunctionSparse in project BoofCV by lessthanoptimal.
the class FactoryDerivativeSparse method createLaplacian.
/**
* Creates a sparse Laplacian filter.
*
* @see boofcv.alg.filter.derivative.LaplacianEdge
*
* @param imageType The type of image which is to be processed.
* @param border How the border should be handled. If null {@link BorderType#EXTENDED} will be used.
* @return Filter for performing a sparse laplacian.
*/
public static <T extends ImageGray<T>> ImageFunctionSparse<T> createLaplacian(Class<T> imageType, ImageBorder<T> border) {
if (border == null) {
border = FactoryImageBorder.single(imageType, BorderType.EXTENDED);
}
if (GeneralizedImageOps.isFloatingPoint(imageType)) {
ImageConvolveSparse<GrayF32, Kernel2D_F32> r = FactoryConvolveSparse.convolve2D(GrayF32.class, LaplacianEdge.kernel_F32);
r.setImageBorder((ImageBorder_F32) border);
return (ImageFunctionSparse<T>) r;
} else {
ImageConvolveSparse r = FactoryConvolveSparse.convolve2D(GrayI.class, LaplacianEdge.kernel_I32);
r.setImageBorder(border);
return (ImageFunctionSparse<T>) r;
}
}
Aggregations