Which method is equal to opencv Mat.copyto () in javacv?

I found an opencv code sample to identify the edges of an image, and I am trying to convert it to javacv, but cannot find a method for the Mat.copyto () method. Please can someone explain an equal method for this? This is sample code.
http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.html

Mat src, src_gray; Mat dst, detected_edges; int edgeThresh = 1; int lowThreshold; int const max_lowThreshold = 100; int ratio = 3; int kernel_size = 3; char* window_name = "Edge Map"; void CannyThreshold(int, void*) { /// Reduce noise with a kernel 3x3 blur( src_gray, detected_edges, Size(3,3) ); /// Canny detector Canny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size ); /// Using Canny output as a mask, we display our result dst = Scalar::all(0); src.copyTo( dst, detected_edges); imshow( window_name, dst ); } 

This is a converted method.

 CvMat src, src_gray; CvMat dst, detected_edges; int edgeThresh = 1; int lowThreshold; final int max_lowThreshold = 100; int ratio = 3; int kernel_size = 3; String window_name = "Edge Map"; int CannyThreshold() { cvSmooth(src_gray, detected_edges, 3, 3); cvCanny( detected_edges, detected_edges, lowThreshold, lowThreshold*ratio, kernel_size ); cvZero(dst); src.copyTo( dst, detected_edges); // *** This line gives compile error cvShowImage( window_name, dst ); } 

Can someone explain the equal method for Mat.copyto ()?

+4
source share
2 answers

I think this is most similar:

 CvMat dst = src.clone(); 
0
source

In the traditional C API, this is cvCopy(src, dst, detected_edges) .

0
source

All Articles