Problem is Multiple Color Points Tracking [closed]
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:
- Capture a Video Frame
- Convert frame from BGR to HSV colorspace
- 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:
- Convert Inrange filtered Mat object from HSV back to BGR
- 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
how can we know,without seing your code ? (also, an image would be helpful)
you could split() the V channel from HSV, it's a "good enough" grayscale image already.
maybe it's easier to use connectedComponentsWithStats() on the mask you get from inRange(). this will already give you boundingBoxes for the blobs