Opencv结构化林或快速边缘检测(Android onPreviewFrame)太慢

时间:2017-11-16 06:46:57

标签: android opencv edge-detection opencv4android opencv-contrib

我正在使用Java包装类通过opencv额外模块(Ximgproc)来执行此功能。这是下面的代码,

    Mat resizeMat = /* frames from android camera */ ;              
    StructuredEdgeDetection pDollar = createStructuredEdgeDetection("path_of_model.yml.gz");
    Mat src = new Mat();
    resizeMat.convertTo(src, CV_32F, 1.0 / 255.0);
    Mat edges = new Mat(src.size(), src.type());
    pDollar.detectEdges(src, edges);
    Mat output = new Mat();
    edges.convertTo(output, CV_8UC1, 255.0);
   Imgproc.findContours(output, contours, new Mat(), Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE);

每帧处理速度太慢(900 - 1000毫秒)referred link in stack-overflow

0 个答案:

没有答案