- Yerhard Lalangui Fernández
- Biomedical Engineering student at Technical University of Madrid
- Member of the Robotics Club at Rey Juan Carlos University
- GitHub Repository (Robotics Club)
Dynamic ROI (Region of Interest)
Although tracking points can be interesting it would be better to track a specific object or person. At the beginning I tried to adjust the ROI based on points calculated by cv2.calcOpticalFlowPyrLK function. The Dynamic ROI is good if there are no more objects in front of the camera and this is the first problem: we are not alone in the world. It is true that we can use the cv2.CamShift function (in this case based on HSV color model), which is really useful when we are tracking, but the problem is different: although we can have more objects in front of the camera, if the object of interest is covered by another object we lose track of the ROI.
In order to improve this function I thought about mixing and using both methods: Optical Flow and HSV color model. It is true that we are not alone in the world, but we can use an HSV filter, isolate the object and track just this filtered object in the frame. Thus the dynamic ROI will be more accurate, we can see the trajectory, the noise will not be a problem and it will be easier to create an algorithm in case that our object of interest is missing.
Sometimes it is useful to track individual feature points across successive frames in a video. In this case I have used a technique called optical flow, which is one of the most powerful techniques used in computer vision. I have used some functions such as cv2.goodFeaturesToTrack function (this method can find strongest corners in a given image) as well as cv2.calcOpticalFlowPyrLK function (this function -Lucas-Kanade method- is a good technique to show the motion of the keypoints between consecutive frames through motion vectors).