[英]Draw 3D bounding box of object in 2D (Processing)
I would like to draw a 2d box around a 3d object and at the end, it should look like the following image:我想在 3d object 周围画一个二维盒子,最后,它应该如下图所示:
I have already drawn a 3d Box and determined the corners (red balls) as well, but however I don't know what to do next or which steps should be taken next.我已经画了一个 3d 盒子并确定了角落(红球),但是我不知道下一步该做什么或下一步应该采取哪些步骤。
It would be a pleasure if someone could provide an algorithm or the next couple of steps to carry on working on it.如果有人能提供一种算法或接下来的几个步骤来继续研究它,那将是一种乐趣。
Thanks in advance:)提前致谢:)
Suppose you have 8 coordinates for both x
and y
假设
x
和y
都有 8 个坐标
x=[123,455,544,677,345,333,677,322]
y=[734,543,654,234,132,654,321,123]
and assuming these 2 lists to be the xy coordinates for a 3D box, then its 2D box can be found by this code:并假设这两个列表是 3D 框的 xy 坐标,则可以通过以下代码找到其 2D 框:
x_min=min(x)
y_min=min(y)
x_max=max(x)
y_max=max(y)
And if you do something like this如果你做这样的事情
cv2.rectangle(image,(x_min,y_min),(x_max,y_max),(255,0,0),1)
then you will get the result.然后你会得到结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.