RED spectral portion in a mpeg video file
Hi I have a video file and I want to get the amount of red in there. How Do I do that? What is the simplest way?
Thx
Hi I have a video file and I want to get the amount of red in there. How Do I do that? What is the simplest way?
Thx
To read a video you can use this tutorials.
About color you can use split function to extract BGR plane
Added by @StevenPuttemans
A small code example:
VideoCapture cap("/path/to/video/location");
Mat frame;
while(true){
cap >> frame;
if(frame.empty()){
break;
}
vector<Mat> channels;
split(frame, channels);
imshow("Red Channel", channels[2]);
waitKey(15);
}
Asked: 2017-04-19 11:39:34 -0600
Seen: 164 times
Last updated: Apr 21 '17
Which values for window size and number of pyramids are reasonable for calcOpticalFlowPyrLK?
Lossless video codecs in OpenCV?
Line detection and timestamps, video, Python
How to change BackgroundSubtractorMOG2 options
video properies give wrong results.
Building the video I/O part only?