OpenCV and Processing 16

This example continues from the last post to compute the optical flow between 2 greyscale images by using the calcOpticalFlowPyrLK() function in the Video module. The new position of the pixels tracked will be delivered in a MatOfPoint2f object. By using the last and current position of the feature points, we can plot the path of the pixel movements. Furthermore, we can use such information for interactive or generative drawings, found in my artwork, Movement in Time.


Continue reading

OpenCV and Processing 15

The coming example will be the sparse optical flow. Before that, we first work on the 2D feature points tracking. The function goodFeaturesToTrack() belongs to the Imgproc module. It takes in a greyscale image and identifies the feature points (corners) as a matrix of point, MatOfPoint. The sample code here uses the feature points to render a live graphics of the webcam image.


Continue reading