0

I am using Java wrapper class to do this feature by opencv extra modules(Ximgproc) . this is the code below,

    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);

It's getting too slow to process for each frame (900 - 1000 ms) referred link in stack-overflow ,

Shyam Kumar
  • 909
  • 11
  • 12
  • Hi, can you please tell me how you can use the trained model in android ? and the Implementation of the Class "StrcuturedEdgeDetection" .. or you provide me with any link that can help get to your results ? – user 007 Apr 09 '18 at 07:10
  • I don't know how, But you can use predefined model. get it from this link https://github.com/opencv/opencv_extra/blob/master/testdata/cv/ximgproc/model.yml.gz – Shyam Kumar Apr 09 '18 at 10:07
  • thanks for providing a link to the model. I'm trying to do the same thing as you ! along my research I found your comments on youtube , and opencv forum ! please if you have any further informations about how can we implement it in java ! let me know – user 007 Apr 09 '18 at 10:46

0 Answers0