我的Android应用程序中有2个Activity填充的菜单,当我进入第一个活动并进行皮肤检测等一些图像处理时,突然活动重启并在大约一分钟后返回菜单而没有任何错误(只需重启和回到主菜单)。任何机构都可以解释我的应用程序发生了什么?它会帮助我很多。感谢。
这种手部检测和皮肤检测的来源
@Override
protected Bitmap processFrame(VideoCapture capture) {
capture.retrieve(mRgba, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA);
capture.retrieve(mGray, Highgui.CV_CAP_ANDROID_GREY_FRAME);
if (mCascade != null) {
int height = mGray.rows();
int handSize = Math.round(height * Isign.minHandSize);
List<Rect> hand = new LinkedList<Rect>();
mCascade.detectMultiScale(mGray, hand, 1.1, 2, 2 // TODO: objdetect.CV_HAAR_SCALE_IMAGE
, new Size(handSize, handSize));
for (Rect r : hand){
a++;
Core.rectangle(mRgba, r.tl(), r.br(), new Scalar(0, 255, 0, 255), 3);
if (a == 20){
a = 0;
br = r.br();
tl = r.tl();
tgn = r;
flag = true;
}
}
}
if (flag == true){
mCascade = null;
Core.rectangle(mRgba, tl, br, new Scalar(0, 0, 255, 255), 3);
//Create ROI image from mRgba
roi_out = mRgba.submat(tgn);
Mat output = new Mat();
output = drawLargestContour(roi_out);
//Create Rect ROI Area
Mat roi_kotak = mRgba .colRange(tgn.x, tgn.x+tgn.width)
.rowRange(tgn.y, tgn.y+tgn.height);
//Copy Processed image and put in init space
output.copyTo(roi_kotak);