Hi all. I am new here and with processing, but wanna get more skills on it. So I wanna ask maybe you know where I get good demos or code for detect (faces, colors, objects) programs. I try some code for face detect but get error with java. My code after 2-3 min working stop. Code is easy but I no idea from where get fatal java error.
Code using OpenCV libaries;
import hypermedia.video.*;
import java.awt.Rectangle;
OpenCV opencv;
// contrast/brightness values
int contrast_value = 0;
int brightness_value = 0;
void setup() {
size( 320, 240 );
opencv = new OpenCV( this );
opencv.capture( width, height ); // open video stream
opencv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT ); // load detection description, here-> front face detection : "haarcascade_frontalface_alt.xml"
// print usage
println( "Drag mouse on X-axis inside this sketch window to change contrast" );
println( "Drag mouse on Y-axis inside this sketch window to change brightness" );
}
public void stop() {
opencv.stop();
super.stop();
}
void draw() {
// grab a new frame
// and convert to gray
opencv.read();
opencv.convert( GRAY );
opencv.contrast( contrast_value );
opencv.brightness( brightness_value );
Hi all. I always get like this error after my program work 1-2 min :
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d961b22, pid=944, tid=2844
#
# JRE version: 6.0_33-b03
# Java VM: Java HotSpot(TM) Client VM (20.8-b03 mixed mode windows-x86 )
# Problematic frame:
# V [jvm.dll+0xa1b22]
#
# An error report file with more information is saved as:
# C:\Documents and Settings\Eima\Desktop\atsisiusta\processing-2.0b7-windows32\processing-2.0b7\hs_err_pid944.log
#
# If you would like to submit a bug report, please visit:
#
http://java.sun.com/webapps/bugreport/crash.jsp
I instal all new java but problem is still are. Maybe someone know how to fix it or event some idea to fix?
and here are report about crash:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d961b22, pid=1916, tid=3276
#
# JRE version: 6.0_33-b03
# Java VM: Java HotSpot(TM) Client VM (20.8-b03 mixed mode windows-x86 )
# Problematic frame:
# V [jvm.dll+0xa1b22]
#
# If you would like to submit a bug report, please visit:
#
http://java.sun.com/webapps/bugreport/crash.jsp #
--------------- T H R E A D ---------------
Current thread (0x27d53800): JavaThread "Animation Thread" [_thread_in_vm, id=3276, stack(0x2a8d0000,0x2a920000)]
EAX=0x00000000 is an unknown value
EBX=0x27d53800 is a thread
ECX=0x27d53800 is a thread
EDX=0x000000ab is an unknown value
ESP=0x2a91f7bc is pointing into the stack for thread: 0x27d53800
EBP=0x2a91f7d8 is pointing into the stack for thread: 0x27d53800
ESI=0x23cce828 is an oop
{method}
- klass: {other class}
EDI=0x00000000 is an unknown value
Stack: [0x2a8d0000,0x2a920000], sp=0x2a91f7bc, free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0xa1b22]
C [OpenCV.dll+0x14561] Java_hypermedia_video_OpenCV_detect+0xfc67
C [OpenCV.dll+0x3be2] Java_hypermedia_video_OpenCV_pixels+0x1b4
j hypermedia.video.OpenCV.pixels(I)[I+0
j hypermedia.video.OpenCV.image(I)Lprocessing/core/PImage;+43
j hypermedia.video.OpenCV.image()Lprocessing/core/PImage;+2
j face_detection.draw()V+59
j processing.core.PApplet.handleDraw()V+283
j processing.core.PGraphicsJava2D.requestDraw()V+4
j processing.core.PApplet.run()V+176
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
V [jvm.dll+0xfadcb]
V [jvm.dll+0x18c3e1]
V [jvm.dll+0xfaf71]
V [jvm.dll+0xfafcb]
V [jvm.dll+0xb5569]
V [jvm.dll+0x1190a4]
V [jvm.dll+0x14108c]
C [msvcr71.dll+0x9565] endthreadex+0xa0
C [kernel32.dll+0x4ed6c] BaseThreadInitThunk+0x12
C [ntdll.dll+0x6377b] RtlInitializeExceptionChain+0xef
C [ntdll.dll+0x6374e] RtlInitializeExceptionChain+0xc2
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 157248K, used 156904K [0x03700000, 0x0e1a0000, 0x0e1a0000)
eden space 139776K, 99% used [0x03700000, 0x0bf3be70, 0x0bf80000)
from space 17472K, 99% used [0x0bf80000, 0x0d07e3a0, 0x0d090000)
to space 17472K, 0% used [0x0d090000, 0x0d090000, 0x0e1a0000)
tenured generation total 349568K, used 349429K [0x0e1a0000, 0x23700000, 0x23700000)
the space 349568K, 99% used [0x0e1a0000, 0x236dd568, 0x236dd600, 0x23700000)
compacting perm gen total 12288K, used 6295K [0x23700000, 0x24300000, 0x27700000)
the space 12288K, 51% used [0x23700000, 0x23d25d18, 0x23d25e00, 0x24300000)
No shared spaces configured.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d961b22, pid=944, tid=2844
#
# JRE version: 6.0_33-b03
# Java VM: Java HotSpot(TM) Client VM (20.8-b03 mixed mode windows-x86 )
# Problematic frame:
# V [jvm.dll+0xa1b22]
#
# An error report file with more information is saved as:
# C:\Documents and Settings\Eima\Desktop\atsisiusta\processing-2.0b7-windows32\processing-2.0b7\hs_err_pid944.log
#
# If you would like to submit a bug report, please visit:
#
http://java.sun.com/webapps/bugreport/crash.jsp #
My comands list are working on face detection with OpenCV libraries. I need somehow to fix that because I wanna connect with arduino mainbord which will control camera movements by 2 servo motors. Event like this example get this errors :
// contrast/brightness values
int contrast_value = 0;
int brightness_value = 0;
void setup() {
size( 320, 240 );
opencv = new OpenCV( this );
opencv.capture( width, height ); // open video stream
opencv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT ); // load detection description, here-> front face detection : "haarcascade_frontalface_alt.xml"
// print usage
println( "Drag mouse on X-axis inside this sketch window to change contrast" );
println( "Drag mouse on Y-axis inside this sketch window to change brightness" );
}
public void stop() {
opencv.stop();
super.stop();
}
void draw() {
// grab a new frame
// and convert to gray
opencv.read();
opencv.convert( GRAY );
opencv.contrast( contrast_value );
opencv.brightness( brightness_value );