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 r开发者_开发技巧ectangle 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.
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)
精彩评论