3

In a current project I've to do some template matching work with opencv.

My source image is big enough (4k * 8k px) and template is relatively small (220 * 220 px). So it takes about 6 seconds per image and I want to improve it's performance.

I found out that there are lots of unusable zones on the source image, which wouldn't ever be the right answer (e.g. imagine the source image like a square with circle inside it and all templates are from inside-circle-area). Is there a possible way to prevent processing these pixels (outside the circle)?

The only solution to which I came is to paint over those "bad zones" with one unique color and redefine matching method in which I'll skip pixels with this color. But before it, maybe there are some other descisions that I haven't found.

Edit

Here is an example of a source image to make it easier to understand.

Source image example

And so all templates contain only part with "forest", but algorithm still processes "water"-part too, how to get rid from it?

Regards, Pavel

Pavel B.
  • 41
  • 6

0 Answers0