FeiGeChuanShu/ncnn-android-yolox

在on_image_render函数下对图像rgb进行灰度化,结果会导致手机上闪退

meixiansen opened this issue · 0 comments

具体代码

void MyNdkCamera::on_image_render(cv::Mat& rgb) const
{
    if (rgb.empty())
        return;
    cv::Mat src = rgb.clone();
    cv::Mat matGray;
    cv::cvtColor(src, matGray, CV_RGB2GRAY);
    {
        ncnn::MutexLockGuard g(lock);
        if (g_yolox)
        {
            std::vector<Object> objects;
            g_yolox->detect(rgb, objects);
            g_yolox->draw(rgb, objects);
        }
        else
        {
            draw_unsupported(rgb);
        }
    }
    draw_fps(rgb);
}

进行debug,具体报错

`

E/cv::error(): OpenCV(4.5.3) Error: Requested object was not found (could not open directory: /data/app/com.tencent.ncnnyolox-tvY0PkV6XrQyBx4J6SbZxw==/base.apk!/lib/arm64-v8a) in glob_rec, file /home/runner/work/opencv-mobile/opencv-mobile/opencv-4.5.3/modules/core/src/glob.cpp, line 273
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 975 (ImageReader-640), pid 32479 (ncent.ncnnyolox)

`