将魔方与背景隔离的最佳方法
我一直在使用 opencv 开发一个 python 程序,它将帮助用户解决魔方问题。最重要的&复杂的部分是识别立方体以读取其每一面的值。
到目前为止,我运气不错,但我想稍微改变一下处理管道。我认为在尝试检测(圆形)方形贴纸并读取它们的颜色之前,将立方体与其背景隔离是有意义的。
附件是我们将要处理的框架类型的示例。我不确定将立方体与背景隔离的最佳方法是什么。我尝试过背景选择,这似乎有点有希望(尽管蒙版非常有颗粒感和斑点)。但我也想知道使用对象检测之类的东西是否更有意义。
我考虑过制作一个“哑”裁剪,使用户将立方体对齐在标线内。然而,我更喜欢一个更优雅的解决方案,并且不介意花费额外的时间。
编辑:也许轻微的散景可以用来识别背景,或者它是否太小而无法一致检测?
感谢您的帮助!
I have been working on a python program using opencv that will help the user solve the Rubik's Cube. The most important & complicated part is identifying the cube to read the value of each of its sides.
I have had a decent amount of luck so far but am wanting to change the processing pipeline a little. I think it would make sense to isolate the cube from its background before trying to detect the (rounded) square stickers and read their colors.
Attached is an example of the sort of frame we would be dealing with. I'm not sure what the best method for isolating the cube from the background would be. I have tried background selection, which seemed somewhat promising (though the mask was very grainy & blotchy). But I am also wondering if it would make more sense to use something like object detection.
I have considered just making a "dumb" crop which makes the user align the cube within a reticle. However, I would prefer a more elegant solution and don't mind spending the additional time that entails.
Edit: maybe the mild bokeh could be used to identify the background, or is it too miniscule to detect consistently?
Thanks for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论