public class ContourPipeline extends OpenCvPipeline
{
    // Notice this is declared as an instance variable (and re-used), not a local variable
    Mat grey = new Mat();
    Mat limited = new Mat();
    Mat hierarchy = new Mat();

    List<MatOfPoint> cnts = new ArrayList<MatOfPoint>();
    List<MatOfPoint> approxList = new ArrayList<MatOfPoint>();