开发者

OpenCV - How to detect marker with alpha channel

开发者 https://www.devze.com 2023-02-22 07:23 出处:网络
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.

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).

0

精彩评论

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