Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Region of Interest in Video File

This is my first time posting here and hoping for a positive result since my research is near its conclusion.

I want to add in my code a function that will process only the defined region of interest of a video file.

(I can't post image since I don't have yet a reputation but same question is posted here ---> http://answers.opencv.org/question/18619/region-of-interest-in-video-file/)

Storyboard:

I'm making a program in C++/OpenCV that will make the pedestrians and vehicles look that they are not in the scene/disappear by getting the running average of the videos frame. I already made that. Now my problem is I do want only the portion of the video that is under the region of interest to be processed because I want to preserve the Lighting/Illumination of the Christmas lights while they are blinking.

Why? I want to use this method to capture only the blinking lights this coming yuletide season without the disturbance of vehicle and people in the scene.

How can I do that? I mean getting a region of interest in a video file.

Thanks in advance.

like image 483
mabg Avatar asked Oct 22 '22 03:10

mabg


1 Answers

  1. Fix your ROI Position.
  2. Take the region from each frame of the video.
  3. Then process it.
  4. Apply for all frames.

Like this:

cv::Rect ROI(startX,startY,width,height);
while(1)
{ 
   cap.read(frame);
   temp = frame(ROI);
   process(temp);
}
like image 74
Barshan Das Avatar answered Oct 24 '22 04:10

Barshan Das