how do i access coordinates of a color in video ?
I want to know the coordinates of a given color in an image using OpenCV.
I want to know the coordinates of a given color in an image using OpenCV.
Hmm well - i am pretty sure this is not what you want but let me answer your question like it was asked. Find the coordinates for a specific colour in images.
First of all a video consists of several frames(a frame is an image). So lets just see how to do it for images.
Well we know that an image consists of pixels. A non grayscale image will have 3 channels(Red, Green, Blue) - the order of the channels after you read in the picture depends on the library you use. Some libs use (RGB), for opencv its (BGR). The channels consists of columns(sum(amount of columns) = total width of image) and rows (sum(amount of rows) = total height of image) Each Channel will have pixels in range from 0 - 255 - this means 256 values. So assuming you have the colour values you need to find in format (BGR)
I am pretty sure just getting the x,y coordinates for pixels of a specific colour is not enough. Maybe you want to detect areas of colours and their coordinates. Maybe you want to detect "colours" in a common sense. This mean for example "Red" as light red, dark red. In that case you need a range.
I am a bit confused but maybe you can make yourself clear a bit more what you really want to do. "coordinates of colours" is really very generic.
Greetings, Holger
P.S Any comment / hints on my explanation is welcome - maybe i have some thinking errors.
Asked: 2018-10-10 04:15:02 -0600
Seen: 715 times
Last updated: Oct 10 '18
A question about registration function in Opencv2.4.2
opencv_traincascade with same size negatives (as positives)
phase correlation for image registration(image stitching)
Does OpenCV provide Connected Component labeling method for binary image?
3d models from 2d image slices
Find image inside of another (corners detection?)
try to explain that better, please. have a look at the faq
did you mean the monitor screen ? that might not be possible at all.