We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
openCV using JNI (Read 842 times)
openCV using JNI
Mar 12th, 2008, 6:17pm
 
Hi,
 
I am doing a project on content-based image retrieval. I wonder if you could answer an urgent question which bothered me for weeks on JNI.
 
Right now, I am trying to call openCV facedetection function to my original Java program. The C code can be built successfully to a dll file, and the Java program is able to deal with the simple function given by the C code. But when the Java file encounters the lines like:  
"IplImage* image = cvLoadImage( filename, 1 );"
or  
" faces = cvHaarDetectObjects( image, cascade, storage, 1.1, 2, CV_HAAR_DO_CANNY_PRUNING, cvSize(40, 40) );",  
JVM will output an error like this:  
 
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000955c, pid=3164, tid=2344
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode)
# Problematic frame:
# C  0x0000955c
 
I suppose the problem could be the cvLoadImage and cvHaarDetectObjects returned a null C pointer which JVM cannot accept. But can I get rid of the null pointer like this?
 
I am truly looking foward to your reply.
Re: openCV using JNI
Reply #1 - Mar 12th, 2008, 8:04pm
 
please don't double post.
Page Index Toggle Pages: 1