gpt4 book ai didi

java - javacv 中 opencv Mat.copyto() 方法的相等方法是什么?

转载 作者:搜寻专家 更新时间:2023-11-01 03:54:47 27 4
gpt4 key购买 nike

我找到了用于识别图像边缘的 opencv 代码示例,我尝试将其转换为 javacv,但我找不到 Mat.copyto() 方法的方法。请有人可以解释一下平等的方法吗?这是示例代码。
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 );
}

这是转换后的方法

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() 的 equal 方法吗?

最佳答案

我想这是最相似的:

CvMat dst = src.clone();

关于java - javacv 中 opencv Mat.copyto() 方法的相等方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11515920/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com