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

I found opencv code example to identify edges of image and I try to convert it in to javacv but I can't find method for Mat.copyto() method. Please can some one explain equal method for it? This is the 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's output as a mask, we display our result
     dst = Scalar::all(0);

     src.copyTo( dst, detected_edges);
     imshow( window_name, dst );
    }

This is the 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 );
 }

Please can some one explain equal method for Mat.copyto() ?

Answers


I guess this is the most similar:

CvMat dst = src.clone();

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


Need Your Help

How to check the whether the javascript is minified or not

ibm-mobilefirst worklight-studio

I am trying to implement minification and concatenation in my Worklight project.

hiding rows in excel based on words in a cell

excel vba excel-vba

I am VERY new at VBA and have been searching for VBA code that can do what I want. I have tried several and attempted to adapt them however I just can't seem to get them right so thought I would tr...