Leaf vein extraction in Opencv and applying in ml

2019-08-05 14:40发布

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.

0条回答
登录 后发表回答