2012-07-17 2 views
4

이미지의 가장자리를 식별하기 위해 opencv 코드 예제를 발견했으며 javacv로 변환하려고했지만 Mat.copyto() 메소드에 대한 메소드를 찾을 수 없습니다. 어떤 사람이 동등한 방법을 설명 할 수 있습니까? 이것은 샘플 코드입니다.
http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.htmljavacv의 open.cv Mat.copyto() 메소드와 동일한 방법은 무엇입니까?

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); 
    } 

이)

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); 
} 

은 어떤 하나 (Mat.copyto 동등한 방법을 설명 할 수주십시오 변환 방법?

답변

0

나는 이것이 가장 유사한 추측 :

CvMat dst = src.clone(); 
0

을이 cvCopy(src, dst, detected_edges)있는 기존의 C API의.

관련 문제