android - Android 版 OpenCV 中的不兼容垫

标签 android opencv mat

prevPts = new MatOfPoint2f(prev);

prev 是一个 Mat;

第一行 prevPts = new MatOfPoint2f(prev); 引发异常 Incompatible MAT。我不明白为什么要这样做。 API 表示 MatOfPoint2f 可以接收 MAT。

最佳答案

你可以使用:

MatOfPoint matOfPoint = ...code to receive ... 

MatOfPoint2f mat2f = new MatOfPoint2f();
matOfPoint.convertTo(mat2f, CvType.CV_32FC2);

关于android - Android 版 OpenCV 中的不兼容垫,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19603523/

相关文章:

覆盖单元格数据时 MATLAB matfile 的大小会增加

android - GoogleAnalytics - 按用户对事件进行分组

math - 为什么有 3 个相互冲突的 OpenCV 相机标定公式?

android - OpenCV 中的文本清理器,如 ImageMagicK 脚本

opencv - 如何关闭Raspberry Pi上的opencv imshow()窗口?

c++ - 为什么 OpenCV Mat 对象在我在嵌套 for 循环中分配它们后不包含预期值?

c++ - OpenCV 中 Mat 对象的 header 是什么意思?

android - 如何在 Android 中永久禁用 Wi-Fi、蓝牙和 USB 大容量存储

android - 在 flutter 中运行后台进程,当应用程序关闭时显示通知和点击 API,

android - 重新打包 boot.img 时出错 (Android)