Imgproc.convexityDefects(); In eclipse + java + opencv
Imgproc.convexityDefects(); In eclipse + java + opencv
我需要有关Java语言中convexitydefect()
函数的信息。
这就是功能:
Imgproc.convexityDefects(MatOfPoint contour, MatOfInt convexhull, MatOfInt4 convexityDefects)
结果是凸面缺陷变量:
MatOfInt4 convexityDefects;
现在在c++中,凸缺陷的结构是:
CvPoint* start; // point of the contour where the defect begins
CvPoint* end; // point of the contour where the defect ends
CvPoint* depth_point; // the farthest from the convex hull point within the defect
float depth;
但是Java为行返回了4 int!如何在java中获取有关开始、结束、depth_point和深度的信息?
您提到的convexityDefects
结构仅用于C API。对于C++和Java,很难比文档中已有的答案更好:
在C++和新的Python/Java接口中,每个凸性缺陷都表示为4元整向量(也称为
cv::Vec4i
):(start_index
、end_index
、farthest_pt_index
、fixpt_depth
),其中索引是凸性缺陷开始、结束和最远点的原始轮廓中基于0的索引,并且CCD_ 8是最远轮廓点和船体之间的距离的定点近似(具有8个小数比特)。也就是说,要得到的浮点值的深度将是fixpt_depth/256.0
。
因此,start
和end
是4个int
的前两个元素,并且包含到contour
的索引。depth_point
是第三个元素,并且是contour
中最深点的索引。将最后一个元素除以256,得到深度的浮点值。
相关文章:
- 如何使用插件CDT在Eclipse中为Java开发人员配置OpenCV
- eclipse - 无缝调试 Java 和C++代码
- 用C++为java构建一个dll,它正在调用另一个dll(Eclipse上的JNI)
- 在 Eclipse C/C++ Developers IDE 上安装 java (Kepler)
- C++ Eclipse Luna CDT - java.lang.NullPointerException
- 将eclipse for c++和java合并到一个IDE中
- 用于C++的Eclipse插件,具有Java可用的所有功能
- 从C++导出到Eclipse作为Java程序
- Ubuntu 并安装 Eclipse 以支持 C++ 和 Java
- 是否有一个可下载的 eclipse 包,我可以将其用于 Java、c++ 和 JS
- 带有CMake和Eclipse的Java
- Imgproc.convexityDefects(); In eclipse + java + opencv
- JNI, Java to C++ in Eclipse: undefined reference to '_imp__JNI_CreateJavaVM@12'
- 如何在Eclipse中解析Java和c++ ?
- Combining Eclipse for Java EE and CDT
- 使用JNI从c++程序执行java jar,使用g++或eclipse
- Eclipse中的Java/ c++项目管理
- Eclipse for C++ 要求提供 Java Runtime Environment (JRE) 或 Java D
- JNI(Java 和 C++)在 Ubuntu 11.10 上使用 Eclipse
- java.lang.UnsisfiedLinkError:运行时调用本地方法Eclipse时未找到该本地方法