Monthly Archives: July 2015

OpenCV and Processing 19

Similar to the last Hough Line detection, the following example illustrates the use of the new LineSegmentDetector class in the Imgproc module. Instead of using the new command, we have to use the Imgproc.createLineSegmentDetector() function to create a new instance of the class.  

Posted in Research, Software | Comments closed

OpenCV and Processing 18

In addition to the Hough circle detection, this example works on the Hough line segment detection. It inputs the live webcam image; converts it into greyscale; applies a medianBlur filter; processes the Canny edge detection. The Imgproc.HoughLinesP() function will finally single out the line segments into a Mat – lines in our example codes.

Posted in Research, Software | Tagged , , | Comments closed

OpenCV and Processing 17

The example explores the Hough Circle detection in the Imgproc module. It starts with a greyscale copy of the live webcam image with an application of a blur filter, in this case, a medianBlur.

Posted in Research, Software | Tagged , , | Comments closed

Load external class in Processing

It is a short side project away from the OpenCV and Processing thread. In this example, I would like to see if I can load an external class within a Processing sketch. The structure of the program is:

Posted in Testing | Tagged | Comments closed

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 […]

Posted in Research, Software | Tagged , , | Comments closed

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 […]

Posted in Research, Software | Tagged , , | Comments closed

OpenCV and Processing 14

This example continues to explore the Video module in OpenCV. It uses one of the BackgroundSubtractors, the BackgroundSubtractorKNN. It learns the motion in front of the camera and treats the stationary scene as background. In the code, the important command is bkg.apply(frame, fgmask);bkg.apply(frame, fgmask); The subtractor object bkg takes in the latest frame and generates […]

Posted in Research, Software | Tagged , , | Comments closed

OpenCV and Processing 13

In this example, we move on to the Video module of OpenCV 3.0.0. The first function we test is the Dense Optical Flow. It demonstrates the use of the calcOpticalFlowFarneback function. Again it makes use of the previous CVImage object to bridge between the Processing PImage and OpenCV Mat. The example also reduces the size […]

Posted in Research, Software | Tagged , , | Comments closed