查找台球桌的角落,以使用OpenCV
我有一个 image 带有轻微透视变形的台球表的
我正在尝试取消图像(使台球桌的角落对应于我的输出图像的角落),然后在输出图像上检测池球。为了张开表,我打算使用cv2.perspectivetransform()
获得将台球表的角落映射到我的输出图像的角落的转换矩阵。但是,我没有桌子角落的位置。我想编程地找到角落。
到目前为止,我已经应用了A bask> bask (过滤了除了泳池表之外的所有内容)。施加了掩码后,我使用了一个Canny Edge检测器来查找“ nofollow noreferrer”> pool表唯一:
我的想法是使用Hough Line Transform算法来查找与池桌边缘相对应的线(以编程方式找到台球表的拐角),但是Hough Line Transil算法似乎很难检测到边缘。我如何从这里找到台球桌的角落?
编辑
有什么办法可以提取轮廓的尖角(与直边变成口袋相对应的八个点)?
I have an image of a pool table with slight perspective distortion:
I am trying to un-warp the image (such that the corners of the pool table correspond to the corners of my output image) and then detect the pool balls on the output image. To unwarp the table, I intend to use cv2.PerspectiveTransform()
to obtain the transformation matrix that maps the corners of the pool table to the corners of my output image. However, I do not have the locations of the corners of my table; I want to find the corners programmatically.
So far, I have applied a mask (that filters out everything but the pool table). After applying the mask, I've applied a Canny edge detector to find the edges of the pool table only:
My idea was to use the Hough line transform algorithm to find the lines corresponding to the edges of the pool table (to find the corners of the pool table programmatically), but the Hough line transform algorithm seems to have a hard time detecting the edges well. How can I find the corners of the pool table from here?
EDIT
Is there any way I can just extract the sharp corners of the outline (the eight points corresponding to where the straight edges turn into the pockets)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论