Monthly Archives: May 2015

OpenCV and Processing 9

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.

Posted in Research, Software | Tagged , | Comments closed

OpenCV and Processing 8

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.  

Posted in Research, Software | Tagged , | Comments closed

OpenCV and Processing 7

This example compares the pixel information between a Processing PImage and OpenCV Mat of the same external image file. The dimension of the image in Processing is width x height (x, y) while for OpenCV, it is rows() x cols() (y, x). A random point is picked and its pixel color is shown both in […]

Posted in Research, Software | Tagged , | Comments closed

OpenCV and Processing 6

To perform the same image loading task in OpenCV, we use the imread() function in the Imgcodecs module. The function was in the Highgui module before. The image loaded in the Mat data structure is in BGR format. We shall use the split and merge commands to align the proper channels. Finally, we use a […]

Posted in Research, Software | Tagged , | Comments closed

OpenCV and Processing 5

Now we proceed to first core part of the tutorials, representation of image in Processing and OpenCV. In Processing, the class is PImage. Digital video, Movie and live webcam feed, Capture are also PImage. When we import the external image file from the data folder through loadImage(), the format will usually be RGB. The internal […]

Posted in Research, Software | Tagged , | Comments closed

OpenCV and Processing 4 more

This example will demonstrate the use of the Rect class in OpenCV and compare it with the Rectangle class in Java. The Rect class will be useful when we work on the face detection example later. The detected faces will be returned as rectangles.  

Posted in Research, Software | Tagged , | Comments closed

OpenCV and Processing 4

The Java binding of OpenCV has a number of data classes in the form of MatOfxxx, where xxx is other datatype such as Int, Float, Point. This example will demonstrate the use of MatOfInt class. These classes will usually be used for parameters passing between different OpenCV functions. We can manipulate it similar to array […]

Posted in Research, Software | Tagged , | Comments closed

OpenCV and Processing 3

This example will demonstrate the use of CvType, Size and Scalar. CvType defines all the matrix types in OpenCV. It describes the number of channels, and depth information for each element (pixel) in the matrix. This example will use CV_8UC1 – 8 bits unsigned char, 1 channel. To communicate with Processing, we usually take CV_8UC4 […]

Posted in Research, Software | Tagged , | Comments closed

OpenCV 3.0.0 rc1 Java build

I built the OpenCV 3.0.0 rc1 64-bit Java bindings and packaged into one single file. You can use it for the Processing examples. Copy them to the code folder of the sketch for simple testings. opencv_java300_rc1 (64-bit) It includes the following files, opencv-300.jar libopencv_java300.dylib (patched with the @loader_path) libopencv_java300.so (built in Ubuntu 64 bit) opencv_java300.dll […]

Posted in Software | Tagged , | Comments closed

OpenCV and Processing 2

The second example loads the OpenCV library; creates an identity matrix; and print its content in the console window.  

Posted in Books, Software | Tagged , | Comments closed