使用 .NET 识别图像中特定尺寸的矩形
我想使用 .NET 的任何“ok”库来识别白色背景上的黑色矩形的轮廓。
我知道这个问题:
我只是想更多地了解图像识别库以及如何在这种特定情况下使用它们。
我理想的解决方案将采取以下形式:
给定两张图像;真实图像和控制图像(只有白色背景上的黑色矩形轮廓)返回真实图像上黑色矩形内的真实图像中的所有内容。
可以假设真实图像将具有与控制图像的一般尺寸和一般位置(但不精确)匹配的黑色矩形轮廓。真实图像上的矩形外部通常应该是白色的,类似于控制图像。然而,任何图像都可以位于黑色矩形内。
C# 源代码将是首选。我会接受一些只能识别精确图像的东西,只要该库具有一些模糊类型的函数,我可以使用这些函数来改进它并以它们的总体方向显示。
I would like to recognize the outline of a black rectangle on a white background using any 'ok' library for .NET.
I am aware of this question:
Are there any OK image recognition libraries for .NET?
I would just like a little more of a trail head into image recognition libraries and how to use them in this specific case.
My ideal solution would take the form of:
Given two images; a real image and a control image, of just a black rectangle outline on a white background, return everything in the real image inside of the black rectangle on the real image.
It can be assumed that the real image would have a black rectangle outline matching the general size and a general location (but not exact) of the control image. And outside of the rectangle on the real image should be generally white-ish, similar to the control image. Any image could be inside the black rectangle however.
C# Source code would be preferred. I'll accept something that will only recognize an exact image as long as the library has some fuzzy-type functions I can play with to refine it and am shown in their general direction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道任何预制的软件包,但是有一些为此制作的算法
如果图像中对象的大小和形状不会与设置的模板变化太大(即每次运行算法时,你很清楚形状是什么样子,包括大小),那么模板匹配(http://en.wikipedia.org/wiki/Template_matching)是迄今为止最简单的解决方案
,但是如果大小和形状可以多一点变量,那么您需要查看霍夫变换(http://en.wikipedia.org/wiki/Hough_transform)
I don't know any pre-made packages, but there are a couple of algorithms made for this
If the size and shape of the object in the image won't vary too much from a set template (i.e. each time you run the algorithm, you know pretty well what the shape looks like, including size), then template matching (http://en.wikipedia.org/wiki/Template_matching) is by far the easiest solution
However if the size and shape could be a bit more variable, then you'll want to look at the Hough transform (http://en.wikipedia.org/wiki/Hough_transform)