Ask Your Question

Revision history [back]

Problem is Multiple Color Points Tracking

Hello, I'm running into a weird exception when I try to use the below method to track multiple color points of the same color:

Pseudo Code:

  1. Capture a Video Frame
  2. Convert frame from BGR to HSV colorspace
  3. Run Inrange to filter out all other colors and only get the one color I want (so far so good)

Now here is where things get dicey. I'm trying to use the Hough circles detector to figure out the center of these filters color dots. However, there is no Convert color from HSV to GRAY. So I do the following:

  1. Convert Inrange filtered Mat object from HSV back to BGR
  2. Convert the now BGR Mat object to Gray

At step 5 is where an exception gets thrown. How come I can straight convert a directly captured BGR Mat object but not one that has been filtered by InRange?

Any suggestions for better code to track the position of same colored dots?

Thanks,

Han