0
我的處理代碼如下。EXCEPTION_ACCESS_VIOLATION(0xc0000005)在處理語言中使用OpenCV時
import hypermedia.video.*;
import processing.video.*;
import java.awt.Rectangle;
OpenCV opencv;
int width = 320;
int height = 240;
void setup() {
size(320, 240); //set window size
opencv = new OpenCV(this); //setup openCV
opencv.capture(width, height); // open video stream
opencv.cascade(OpenCV.CASCADE_FRONTALFACE_ALT);
}
void draw(){
opencv.read();
image(opencv.image(), 0, 0);
Rectangle[] faces = opencv.detect(1.2, 2, OpenCV.HAAR_DO_CANNY_PRUNING, 40, 40);
noFill();
stroke(255,0,0);
for(int i=0; i<faces.length; i++) {
rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
}
}
此代碼工作幾秒鐘,然後發生異常。
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d961b22, pid=232, tid=4008
#
# 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\Administrator\Desktop\processing-2.0b7\hs_err_pid232.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Hi @vishnu - 這段代碼是否會在其他機器上拋出相同的異常?你有沒有在你的機器上運行memtest(http://www.memtest.org/)以確保它沒有損壞RAM。我有類似的事情發生在我身上,這是我的臺式機上壞的RAM。 –
我在朋友的筆記本電腦上運行了這段代碼,並得到了同樣的錯誤。 – vishnu