Ask Your Question

Revision history [back]

How to get the size or area of a contour upon touch

I am new to openCV functionality , I need help on how I can get the size of the contour and if possible crop the touched part and save.I have checked for the solution on Google as well as StackOverFlow. Any link to a tutorial will be highly appreciated.

How to get the size or area of a contour upon touch

I am new to openCV functionality , I need help on how I can get the size of the contour and if possible crop the touched part and save.I have checked for the solution on Google as well as StackOverFlow. Any link to a tutorial will be highly appreciated.

UPDATE: I am using the color-blob detector sample code,Please help.I have tried this:

  List<MatOfPoint> con = mDetector.getContours();
  double size = Imgproc.contourArea((Mat) con);

  String Stringsize =Double.toString(size);
  Toast.makeText(this, Stringsize, Toast.LENGTH_SHORT).show();