i want to select center pixels and store in a vector, and then track those pixels in corresponding consecutive frames by optical flow. If anyone have idea please guide me or give five reference. Thanks
If you use OpenCV some of the optical flow implementations give you the possibility of adding and arbitrary set of points to follow. You could do that with the Lucas-Kanade method implemented in the library. (See here https://docs.opencv.org/3.3.1/dc/d6b/group__video__track.html#ga473e4b886d0bcc6b65831eb88ed93323).
But keep in ming that the points your are sampling in the grid might not be good points to be tracked. Maybe you also want to check dense optical flow algorithms like Farneback which is also implemented in OpenCV and their "goodFeatures2Track" function.
Are you familiar with Matlab? Keeping center pixel of each 10x10 block from a frame as vector is easy. But further tracking of the same pixel, you may have to read more about it.
Thanks a lot Oscar Luis sir and Manikandan sir. I'm using OPENCV currently i'm reading a paper where the work is did by grid based tracking that's why i'm asking....here is the link of the paper Article Scene Conditional Background Update for Moving Object Detect...