Leaf vein extraction in Opencv and applying in ml

旧巷老猫 提交于 2019-12-13 00:32:01

问题


I want to extract leaf veins and use them in machine learning process, but I don't know how to do it right.

I've tried with sobel and get quite good results.

code:

  Imgproc.GaussianBlur(image, image, new Size(3, 3), 0, 0);
  Imgproc.cvtColor(image, image, Imgproc.COLOR_BGR2GRAY);      
  Mat Sx = new Mat(); Mat Sy = new Mat();
  Mat absSx = new Mat(); Mat absSy = new Mat();
  Imgproc.Sobel(image, Sx, CvType.CV_16S, 1, 0, 3, 1, 0, Imgproc.BORDER_DEFAULT);
  Core.convertScaleAbs(Sx, absSx);
  Imgproc.Sobel(image, Sy, CvType.CV_16S, 0, 1, 3, 1, 0, Imgproc.BORDER_DEFAULT);
  Core.convertScaleAbs(Sy, absSy);
  Core.addWeighted(absSx, 0.5, absSy, 0.5, 0, image);

images:

1 2

Many depends on image resolution and quality, but is there better approach?

How to use these information in machine learning? How to transform this graphical data to a form appropriate for classifiers?

I've tried only using pixels data in classifaction, but outcome was not good.

来源:https://stackoverflow.com/questions/20301692/leaf-vein-extraction-in-opencv-and-applying-in-ml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!