-1

I'm writing a small C# application that is supposed to process an image. In fact, multiple images per second if possible, so it needs to be fast.

I need to do something like binary thresholding, but a little different I guess.

I need everything in the image to turn black, except for areas / pixels that are a given color.

enter image description here

Lets assume we have this image (random, it can be anything) and we want everything to turn black except the red "o" and the red "e". These two could stay red or turn white, I wouldn't care.

After that I want to do some template matching on the image, thats what I need this "binarization" for.

Is there any way to do that? I didnt find anything about this so far, but maybe I'm lacking the correct search terms.

Thank you very much for any hints.

user2677466
  • 139
  • 1
  • 13
  • You may want to study this, if you want to code it from ground up. Note that those Os do not have a uniform color, so you wil need some threshold.. – TaW Nov 11 '21 at 12:47

1 Answers1

0

The term you are looking for is color segmentation. In the simplest case you define a RGB volume. But ideally you first separate color from intensity information.

https://en.wikipedia.org/wiki/List_of_color_spaces_and_their_uses

Also note that in most cases it is sufficient to do template matching with any of the color channels or the intensity image. Binarization is usually not involved in this.

Piglet
  • 27,501
  • 3
  • 20
  • 43