- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我找到了用于识别图像边缘的 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/
尝试使用 JAVACV 库从网络摄像头捕获。但它会抛出一个 UnsatisfiedLinkError。堆栈轨迹如下: Exception in thread "main" java.lang.Unsa
尝试使用 JavaCV 进行图像处理以根据其 Exif 数据旋转图像。从文件读取和写入 Mat 或 IplImage 是可行的,但由于正在上传或下载文件,我也希望能够做同样的事情来处理 byte[]
我正在尝试实现使用 JavaCv Surf 的示例。我下载了示例代码、.jar 文件并安装了官方网页要求的所有内容 (http://code.google.com/p/javacv/)。但似乎缺少一个
我正在开发一个使用 Java 的应用程序,该应用程序可以纠正透视(也称为梯形校正)。为此,我使用 Bytedeco's JavaCV 。引用documentations和其他几个websites和在线
我是 JavaCV/OpenCV 的新手,所以如果我是一个完全的白痴,请提前道歉...... 我需要检测图像中的“主要/主要”人脸(此图像大部分是“个人资料图片”),人脸识别 不需要。 由于不同haa
我想通过 Java 轻松捕获我的网络摄像头。我按照本教程使用 JavaCV 和 OpenCV:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/o
我在使用 JavaCV 时遇到问题。 我下载了javaCV-bin 我在 ubuntu 上的引用库中的项目中添加了 .jar 文件 我可以使用位于下载文件中的示例代码 但是错误是 Exception
我正在尝试使用 JavaCV 在我的照片数据库中实现人脸识别。虽然检测可能的面孔工作正常(已经有很多 Java 示例),但我仍然坚持进行实际识别。更准确地说,是训练人脸识别器。 出于测试目的,我有一个
我正在尝试使用 JavaCV 实现使用 ORB 算法的图像识别。根据一些论文[1] , [2] ,ORB关键点描述符是一个二进制字符串。那么,如何在获取图像的关键点后得到这个二进制字符串呢? 这是我获
我对 JavaCV FFmpegFrameRecorder 的使用有点困惑。我有几个 byte[] 或 short[] 数组(取决于我的图像是 8 位还是 16 位)是否有与多个图像相关的数据。现在,
我正在尝试使用 Java 从相机获取一些图像,但我遇到了一些问题;任何帮助将不胜感激! 代码如下: 错误日志: Exception in thread "main" java.
以下 JavaCV 代码有什么问题?我尝试填充 CvSeq 以进行进一步的工作,但 JVM 几乎 在不同位置可靠地崩溃,并出现 EXCEPTION_ACCESS_VIOLATION,最常见的是 [ms
我正在尝试过滤掉图像中的轮廓。我的代码没有语法错误,但当我运行程序时,我只是得到很多红色文本。我已定位故障点为cvInRangeS。 cvInRangeS(imghsv,minc,maxc,imgbi
我刚刚找到了一个很好的 JavaCV 示例,它使用 FFmpegFrameGrabber为应该“快”的Linux制作屏幕截图代码: try { int x = 0, y = 0, w = 13
我正在尝试使用 HoughCircles 的 JavaCV 实现方法,但我在参数方面遇到了一些问题。这是我的代码: Mat currentImageGray = tgtFrag.getImage().
我正在尝试使用 FFmpegFrameRecorder 从一组图像中制作一个视频 .mp4 文件作为更大程序的一部分,因此我设置了一个测试项目,在其中尝试制作一个25fps 的同一帧的 100 个实例
我想不断捕捉网络摄像头并让它在 Canvas 上查看。图像的保存很好。它每秒拍摄一张照片。但是 canvas.showImage() 不起作用。我的屏幕仍然空白。控制台在每一帧都显示“清理相机”。 头
我从昨天开始用 android 做 javacv,在使用 FFmpegFrameRecorder 或 FrameRecorder 从图像 (IplImage) 生成视频时出错,同时在使用 cvCvtC
我在我的项目中使用 javaCV 信封,当我尝试使用 cvLoad 函数从 xml (haarcascade_frontalface_default.xml) 加载 Haar 级联时,我从中得到 nu
我在使用 JavaCV 实现的这个项目中遇到了问题。我想至少找到二值图像中最顶部、最底部、最左侧和最右侧的点: 我这里指的点是 (x,y) 坐标。我已经尝试实现 HoughLines(它只检测直线而不
我是一名优秀的程序员,十分优秀!