The example recreates the VideoCapture sample from the OpenCV documentation. It uses the Imgproc module to convert the color image into single channel greyscale, apply a blur filter, and find the edges.
The example converts a PImage (ARGB) to a Mat (BGR). It then randomly samples a pixel to compare their color values in the two formats. In order to transfer the integer array pixels from the PImage to the byte array of the CV_8UC4 matrix, it makes use of the ByteBuffer and IntBuffer.
Continue reading “OpenCV and Processing 8”