开发者

How to detect occurrencies of a small image in a larger image?

I would like to detect the occurrencies of a small image in a larger image, as well as coordinates.

开发者_运维百科

How do I do it with C#/.NET?


Your question fits into the realm of computer vision. This is a branch of computing where even many of the simple problems require a fair understanding of image processing and algorithms. I recommend you implement a CV library like AForget.NET to simplify the task.


Basic strategy.

  1. Find descriptors that can fairly specifically describe (pinpoint) the small image and can be evaluated given a certain coordinate.
  2. Find ways to evaluate that descriptor function at various locations in the larger image.
  3. Find ways to make #2 fast. If not possible, go back to #1 and try another descriptor.

Useful ideas.

  1. Phase correlation appears to be a hot technique on SO.

    • http://en.wikipedia.org/wiki/Phase_correlation
    • Phase correlation
    • Detecting if two images are visually identical
    • Numerical Pattern Matching
  2. Image pyramid. (for its ability to speed up many classes of descriptors with minimal tinkering)

    • http://en.wikipedia.org/wiki/Pyramid_(image_processing)


An extremely low-level way to do it would be to read in the file as a bitmap stream (assuming you can convert it to bitmap) and parse it to search for patterns. But your algorithm would have to be very, very refined. So basically, what P.Brian.Mackey said.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜