I've followed the instructions on
http://ubaa.net/shared/processing/opencv/ to the letter, but none of the library examples work for me (on windows vista). The error I get (when running my sketch) is:
"No library found for hypermedia.video".
I've downloaded opencv release version 1.0, installed it, added to path, rebooted, etc. Unzipped the opencv processing library to the "libraries" folder of my sketch (so pretty much done everything that I should), but it doesn't work.
Does anyone know what's going wrong? It seems counterintuitive to me that the examples load the library by "
import hypermedia.video.*;", while the library is called opencv. Is this what causing the problem? (The main library folder is called "OpenCV", and the jar file "OpenCV.jar", but using "
import opencv.*;" doesn't work either..
I am trying to check if a connection is already open in my sketch with the
java function isOpen():
if (connection.isOpen() == true)
But processing returns an error: "the function isOpen() does not exist". Is there an equivalent for isOpen() in processing? (I am checking for an open connection because i don't want to unneccessarily open a new connection).
(Or is it not neccessary to check for already opened connections (and close open connections) in processing?)
Just two short questions (that i wasn't able to find in the documentation);
in a try-block, does a return; statement immediately exit the try-block (like it would do with a for-loop for example)?
if the try-block throws an error, can i (after fixing the error in the corresponding catch-block) make the script retry the try block (without having to build an entire checking system with booleans and for or while-loops)? Is there a simple command for that? (btw., i realize there is a risk of an infinite loop with this)
I am parsing some numerical values from a .txt file to an arraylist. Right now i'm doing that like this:
// create arraylist
ArrayList values = new ArrayList();
// load values into temporary int array
int[] v = int(loadStrings("values.txt"));
// copy contents of temporary int array to arraylist
for (int i=0; i<v.length; i++) {
values.add(v[i]);
}
println(values.size());
As you can see i'm not parsing directly into the arraylist, but with an intermediate int[] (because i don't know how many lines the txt-file has). I would like to skip this step, but have not been able to figure out how. Does anyone know how to parse directly into the arraylist?