Ask Your Question
0

RED spectral portion in a mpeg video file

asked 2017-04-19 11:39:34 -0500

biobio gravatar image

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-04-19 12:05:21 -0500

LBerger gravatar image

updated 2017-04-21 02:57:54 -0500

StevenPuttemans gravatar image

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);
}
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-04-19 11:39:34 -0500

Seen: 75 times

Last updated: Apr 21