将 org.opencv.core.Point 转换为 android.graphics.Point [英] Converting org.opencv.core.Point to android.graphics.Point
问题描述
我想在图像位图上的特定点放置一个图标.我通过使用 OenCV 获得了要放置图标的位置.我可以理解 org.opencv.core.Point
与 android.graphics.Point
的不同.如何将 org.opencv.core.Point
转换为 android.graphics.Point
?
I want to put an icon at a particular point on the image bitmap. I got the point where to be icon to be placed by using OenCV. I could understand that org.opencv.core.Point
is different from that of android.graphics.Point
. How can I convert org.opencv.core.Point
to android.graphics.Point
?
推荐答案
它们的来源不同(至少,在您离开 Object
规范之后),因此没有直接的方法转换它们.你应该能够做的最好的是
They're not from the same sources (at least, after you leave the Object
specification), so there's no direct way to convert them. The best you should be able to do is
[在你已经有一个名为 point
的 org.opencv.core.Point
之后]
[after you have an org.opencv.core.Point
named point
already]
pt = new android.graphics.Point(point.x, point.y);
您可以将其设为 return 语句而不是赋值,并在某处创建一个方法,该方法仅为您返回 android.graphics.Point
对象.
You could make that a return statement instead of an assignment and just make a method somewhere that just returns android.graphics.Point
objects for you.
这篇关于将 org.opencv.core.Point 转换为 android.graphics.Point的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!