Region of Interest in Video File

一个人想着一个人 提交于 2019-12-23 10:53:08

问题


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.


回答1:


  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);
}


来源:https://stackoverflow.com/questions/18180795/region-of-interest-in-video-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!