本文整理了Java中org.opencv.imgproc.Imgproc.Laplacian()
方法的一些代码示例,展示了Imgproc.Laplacian()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Imgproc.Laplacian()
方法的具体详情如下:
包路径:org.opencv.imgproc.Imgproc
类名称:Imgproc
方法名:Laplacian
[英]Calculates the Laplacian of an image.
The function calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator:
dst = Delta src = (d^2 src)/(dx^2) + (d^2 src)/(dy^2)
This is done when ksize > 1
. When ksize == 1
, the Laplacian is computed by filtering the image with the following 3 x 3 aperture:
vecthreethree 0101(-4)1010
Note:
ksize > 1
时完成的。当ksize == 1
时,通过使用以下3 x 3孔径过滤图像来计算拉普拉斯算子:代码示例来源:origin: openpnp/openpnp
@Override
public Result process(CvPipeline pipeline) throws Exception {
Mat mat = pipeline.getWorkingImage();
Imgproc.Laplacian(mat, mat, mat.depth());
return null;
}
}
代码示例来源:origin: JavaOpenCVBook/code
protected void processOperation() {
if(sobelString.equals(operation)){
Imgproc.Sobel(originalImage, image, -1, xOrder,yOrder,aperture,1.0, 0.0);
// Core.convertScaleAbs(image, image);
}
else if(laplaceString.equals(operation)){
Imgproc.Laplacian(originalImage, image, -1, aperture, 1.0, 0.0);
// Core.convertScaleAbs(image, image);
// Imgproc.threshold(image, image, 1, 255, Imgproc.THRESH_BINARY_INV);
}
else if(cannyString.equals(operation)){
Imgproc.Canny(originalImage, image, lowThreshold, highThreshold, aperture, false);
}
else if(noneString.equals(operation)){
image = originalImage.clone();
}
updateView(image);
}
内容来源于网络,如有侵权,请联系作者删除!