Comments on: Announcing OpenCV for Processing http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/ Thu, 19 Jun 2014 09:26:37 +0000 hourly 1 By: Saurabh Datta http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/#comment-79823 Wed, 18 Jun 2014 16:33:18 +0000 http://urbanhonking.com/ideasfordozens/?p=713#comment-79823 Ah.. I got it working but now I don’t see any rectangles around my face in live webcam feedback..I I load a separate static image it detects but is unable to do so on live video.. this is the new code:


import gab.opencv.*;
import java.awt.Rectangle;
import processing.video.*;

Capture cam;
OpenCV opencv;
Rectangle[] faces;

void setup() {
size(640, 480);
cam = new Capture(this, 640, 480);
cam.start();

opencv = new OpenCV(this, cam);
//size(opencv.width, opencv.height);
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
faces = opencv.detect();

}

void draw() {
if (cam.available() == true) {
cam.read();
}
image(opencv.getInput(), 0, 0);

noFill();
stroke(0, 255, 0);
strokeWeight(3);
for (int i = 0; i < faces.length; i++) {
rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
}
//image(cam, 0, 0);
}

]]>
By: Saurabh Datta http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/#comment-79818 Wed, 18 Jun 2014 16:15:03 +0000 http://urbanhonking.com/ideasfordozens/?p=713#comment-79818 Hello again.
I’m with Processing 2.2.1 and was trying face detection with live webcam input. I wrote the following code, but I’m getting the following error.. ‘IllegalArgumentException width(0) and height(0) cannot be <=0' at line

opencv = new OpenCV(this, cam);

import gab.opencv.*;
import java.awt.Rectangle;
import processing.video.*;

Capture cam;
OpenCV opencv;
Rectangle[] faces;


void setup() {
size(640, 480);
cam = new Capture(this);
cam.start();
opencv = new OpenCV(this, cam);
size(opencv.width, opencv.height);
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
faces = opencv.detect();
}

void draw() {
if (cam.available() == true) {
cam.read();
}
image(opencv.getInput(), 0, 0);

noFill();
stroke(0, 255, 0);
strokeWeight(3);
for (int i = 0; i < faces.length; i++) {
rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
}
//image(cam, 0, 0);
}

]]>
By: greg http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/#comment-75242 Tue, 03 Jun 2014 21:56:27 +0000 http://urbanhonking.com/ideasfordozens/?p=713#comment-75242 Dan — Is this on Linux? Are you running the most recent version of Processing? It sounds like a bug that would occur if Processing doesn’t populate the CPU memory for the PImage (which used to happen for awhile back in the early 2.0 releases). If you’re on an old version, try upgrading to the most recent version of Processing.

]]>
By: greg http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/#comment-75241 Tue, 03 Jun 2014 21:53:17 +0000 http://urbanhonking.com/ideasfordozens/?p=713#comment-75241 Never heard of Tobi. What is it?

]]>
By: greg http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/#comment-75240 Tue, 03 Jun 2014 21:51:29 +0000 http://urbanhonking.com/ideasfordozens/?p=713#comment-75240 context.depthImage() returns a PImage. So you can just pass that directly to OpenCV like this:

opencv.loadImage(context.depthImage())

and then run normal opencv functions after that.

]]>
By: Mudit http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/#comment-70210 Mon, 19 May 2014 06:14:57 +0000 http://urbanhonking.com/ideasfordozens/?p=713#comment-70210 Hi Greg,
Great work! I see all examples uses test Images. Can you quickly help me use with simple open NI(for Kinect)? Because if you see a simple OpenNI example, it goes something like:

SimpleOpenNI context;
void setup()
{
size(640*2, 480);
context = new SimpleOpenNI(this);
context.enableDepth();
}
void draw()
{
// update the cam
context.update();
image(context.depthImage(), 0, 0);
}

]]>
By: JSM http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/#comment-65177 Thu, 01 May 2014 09:24:10 +0000 http://urbanhonking.com/ideasfordozens/?p=713#comment-65177 Hello greg.
one thing more which I would like to ask is do you have some idea about TOBII eye tracker is that open CV gona work with Tobii Development kit or ???

]]>
By: JSM http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/#comment-65176 Thu, 01 May 2014 09:21:54 +0000 http://urbanhonking.com/ideasfordozens/?p=713#comment-65176 now its working fine their were mine mistake that I were were using Processing 32 bit with Open CV 64 bit,,, thanks @GREG for your support.

]]>
By: JSM http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/#comment-64694 Tue, 29 Apr 2014 10:03:17 +0000 http://urbanhonking.com/ideasfordozens/?p=713#comment-64694 Hello greg:
I am getting this Error ?? can anyone help me to fix even I did copy the libraries in folder libraries
opencv_processing-win64
but still it says ???
A library used by this sketch is not installed properly.
Cannot load local version of opencv_java245 : Linux 32/64, Windows 32 bits or Mac Os 64 bits are only avaible
A library relies on native code that’s not available.
Or only works properly when the sketch is run as a 32-bit application.

]]>
By: Dan Thimm http://urbanhonking.com/ideasfordozens/2013/07/10/announcing-opencv-for-processing/#comment-62193 Sun, 20 Apr 2014 14:29:24 +0000 http://urbanhonking.com/ideasfordozens/?p=713#comment-62193 Hello Greg,
Wonderful work you are doing! I am new to processing and am getting this fault
on a couple of the scripts (The ones I really want to explore)
One is the HueRangeSelection and the other is the Background Subtraction.

I am running an Intel B960 Processor on a Gateway NE56R41u (Not the fastest or the best but it usually works for me)

ANY help is greatly appreciated.
OpenCV for Processing 0.4.5 by Greg Borenstein http://gregborenstein.com
Using Java OpenCV 2.4.5.0
OpenCV for Processing 0.4.5 by Greg Borenstein http://gregborenstein.com
Using Java OpenCV 2.4.5.0
java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 0
at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206)
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
at javax.media.opengl.Threading.invoke(Threading.java:191)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:541)
at processing.opengl.PJOGL.requestDraw(PJOGL.java:688)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1651)
at processing.core.PApplet.run(PApplet.java:2254)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at processing.opengl.Texture.convertToRGBA(Texture.java:1078)
at processing.opengl.Texture.set(Texture.java:348)
at processing.opengl.PGraphicsOpenGL.updateTexture(PGraphicsOpenGL.java:6257)
at processing.opengl.PGraphicsOpenGL.getTexture(PGraphicsOpenGL.java:6122)
at processing.opengl.PGraphicsOpenGL$TexCache.getTexture(PGraphicsOpenGL.java:6914)
at processing.opengl.PGraphicsOpenGL.flushPolys(PGraphicsOpenGL.java:2464)
at processing.opengl.PGraphicsOpenGL.flush(PGraphicsOpenGL.java:2415)
at processing.opengl.PGraphicsOpenGL.endDraw(PGraphicsOpenGL.java:1712)
at processing.core.PApplet.handleDraw(PApplet.java:2404)
at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:862)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:665)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:649)
at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1289)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1119)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:994)
at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1300)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Could not run the sketch (Target VM failed to initialize).
For more information, read revisions.txt and Help ? Troubleshooting.

]]>