List of usage examples for org.opencv.core Mat copyTo
public void copyTo(Mat m, Mat mask)
From source file:View.PreprocessSignature.java
private static Mat doCanny(Mat frame) { // init/*from ww w. j ava 2 s. c o m*/ Mat grayImage = new Mat(); Mat detectedEdges = new Mat(); // convert to grayscale Imgproc.cvtColor(frame, grayImage, Imgproc.COLOR_BGR2GRAY); // reduce noise with a 3x3 kernel Imgproc.blur(grayImage, detectedEdges, new Size(3, 3)); // canny detector, with ratio of lower:upper threshold of 3:1 //Imgproc.Canny(detectedEdges, detectedEdges, this.threshold.getValue(), this.threshold.getValue() * 3); Imgproc.Canny(detectedEdges, detectedEdges, 6, 6 * 3); // using Canny's output as a mask, display the result Mat dest = new Mat(); frame.copyTo(dest, detectedEdges); return dest; }