Category Archives: Software

OpenCV 3.3 Java Build

The new release of OpenCV 3.3 is out now. I again prepare the Java build for the CVImage Processing library use. It also includes the optflow extra module for motion history applications. Here is the list of the 3 OpenCV releases. CVImage with OpenCV 3.1 CVImage with OpenCV 3.2 CVImage with OpenCV 3.3 The book […]

Also posted in Books | Tagged , | Comments closed

TensorFlow in Processing

The Java binding for the Google Deep Learning library, TensorFlow is now available. The binary library files for version 1.1.0-rc1 ¬†are also available for download here. Below is the code for the Hello World program included in the distribution that I modified for Processing.   import org.tensorflow.Graph; import org.tensorflow.Session; import org.tensorflow.Tensor; import org.tensorflow.TensorFlow;   Graph […]

Also posted in Research | Tagged , | Comments closed

OpenCV 3.2 Java Build

In preparing for the forthcoming book in Processing and OpenCV, I have tried to build the Java binding in OpenCV 3.2. It worked easily for the basic components. Nevertheless, when I included the contribution module – optflow, it failed. After a number of attempts in various platforms, I found it was due to the […]

Also posted in Books, Research | Tagged , | Comments closed

Screen capture in Processing

This sketch demonstrates the use of the Robot class in Java to perform screen capture in Processing. It will create Jodi like effect with feedback in computer screen. Have fun with it. Here are the codes. It makes use of the Robot class.   import java.awt.Robot; import java.awt.image.BufferedImage; import java.awt.Rectangle;   Robot robot;   void […]

Also posted in Testing | Tagged , , | Comments closed

Save Processing screen as video with jCodec – new

It may not be easy for readers to get the old jcodec-0.1.5.jar for what I have done in the last post. I tried to work out for a newer solution but found that the latest version did change quite a lot. The latest jcodec source is 0.2.0. I built the latest two files for the […]

Also posted in Research | Tagged , | Comments closed

Save video in Processing with JCodec

As a side product of current research, I manage to save a Processing screen in an MP4 video file with the use of the JCodec library. Download the former¬†jcodec-0.1.5.jar into the code folder of your Processing sketch. The simplest way is to use the SequenceEncoder class to add a BufferedImage to the MP4 video. Remember […]

Also posted in Research, Testing | Tagged , , , | Comments closed

Searching in Weka with Processing

Further to the last Weka example, I used the same CSV data file for neighbourhood search. By pressing the mouse button, it generated a random sequence of numbers between 1 to 4. The program used the sequence as an instance to match against the database from the CSV data file. The closet match will be […]

Also posted in Research | Tagged , , | Comments closed

First trial of Weka in Processing

Instead of using the machine learning module (ML) of OpenCV, I also investigated another popular machine learning library for Java, Weka, from the University of Waikato. The first trial was to load an external CSV file into the proper data structure of the Weka library. The content of the CSV file is as follows. The […]

Also posted in Research | Tagged , , | Comments closed

Artificial Neural Network in OpenCV with Processing

This is the first trial of the Machine Learning module, artificial neural network in OpenCV with Processing. I used the same OpenCV 3.1.0 Java built files. The program took the live stream video (PImage) from webcam and down-sampled to a grid of just 8 x 6 pixels of greyscale. It started by default in the […]

Also posted in Research, Testing | Tagged , , | Comments closed

Enumerate all files in the data folder of Processing

There are lots of ways to enumerate all the files inside the data folder of Processing sketch. Here are 2 of them. The first one uses the Java DirectoryStream class. The second one uses the static function walkFileTree from the Files class.   Example with DirectoryStream try { DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get(dataPath(""))); for (Path file […]

Also posted in Testing | Tagged | Comments closed