You are most likely trying to use a variable that has not been initialised somewhere. In the following two lines you create a new entry in the
hull
list, and then send it to
Imgproc.convexHull
. However you may not have any data in it.
hull.add(new MatOfInt());
Imgproc.convexHull(newContours.get(i), hull.get(i));