I want to detect custom forms like crosses. I tried to use matchTemplate, but the background color of the marker is not always the same. If I use a alpha channel in a marker png, I don't get a good result. Maybe I have to set up a ROI? What is a good way to de开发者_如何学Ctect this forms?
Have you considered using another color space where foreground and background are better separated?
- use grayscale version if your markers are typically brighter than background
- convert to HSV space and then only use Saturation and Value, e.g. if you have white markers on colored background
matchTemplate() does not work with a mask ("foreground-only" template).
精彩评论