getPerspectiveTransform on a non entire quadrangle

只谈情不闲聊 提交于 2019-12-23 04:55:07

问题


I am working on a Open CV Android project, the aim is the user can take a picture of a snooker table and I have to find balls positions on image retrieved. When I have four corners of the table on my picture, it is pretty easy, I have already coded table, balls and colors detection, and I use getPerspectiveTransform() function to warp my table on a rectangle. Then I have balls center position on the rectangle.

If I have three corners, I think I have to extend table edges and find lines intersection to get my fourth corner.

Problem : With two corners, I am trying to find a solution for 2 weeks and I am not sure it is possible. I have the edge table dimensions (L=2.80m, l=1.40m) and balls diameter (d=61.5mm)

I am not asking for a code solution (even if it's still better), but if someone have a way to resolve that problem, it would be very nice.

来源:https://stackoverflow.com/questions/29181863/getperspectivetransform-on-a-non-entire-quadrangle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!