我正在尝试使用 OpenCV 制作一个应用程序。我面临一个简单的问题,但我没有解决这个问题的知识。
我需要在图像内取一个框来获取矩形并在 OpenCV 中使用它,但 Android 使用 android.graphics.Rect 和 OpenCV 需要 org.opencv.core.Rect 并且我正在尝试一个简单的转换,但是结果不好。
android.graphics.Rect(int left, int top, int right, int bottom)
org.opencv.core.Rect(int x, int y, int width, int height)
我没有发现 wait 是左上右下的表示,文档讨论了“侧面”,但我对从 android 转换为 opencv 感到困惑
谢谢你。
方程式为:
x = left
y = top
width = right - left
height = bottom - top
和
left = x
top = y
right = x + width
bottom = y + height