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
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: 175 times
Last updated: Apr 21 '17