1

How can access coordinates of convexity defects and convexhull?

I try to do measurment of each finger (on open-palm hand picture) and i would like to get acces to coordinates first five points of convexhull and first four points of convexity defects (counting from the top of an image). To do that, i need to know what the coorginates (x and y) are.

The format od convexhull is MatOfInt and the format of convexityDefects is MatOfInt4. I was looking for answer but unfortunately only answer I found was in C++, and I'm working with java.

I will be very gratefull for any help.

Paulina
  • 930
  • 8
  • 13
  • This answer is helpful as well: https://stackoverflow.com/questions/10961660/android-java-opencv-2-4-convexhull-convexdefect – Paulina Dec 05 '17 at 14:01

1 Answers1

0

Have you tried converting your MatOfInt to a List of Point's ?

You can do it like this:

// MatOfInt mat;
List<Point> list1 = mat.toList();   

// Or:
List<Point> list2 = new ArrayList<Point>();

Converters.Mat_to_vector_Point(mat, list2);

You can find more OpenCV Java data structure converters here.

Rui Marques
  • 8,567
  • 3
  • 60
  • 91