private ArrayList<Integer> straightLinePostProcessing(ArrayList<Integer> corners, double[] distApart) {
        ArrayList<Integer> filteredCorners = new ArrayList<Integer>(corners);

        boolean allLines = false;

        while (!allLines) {
            allLines = true;

            for (int i = 1; i < filteredCorners.size(); i++) {
                int c1 = filteredCorners.get(i - 1);
                int c2 = filteredCorners.get(i);

                if (!isLine(c1, c2, LINE_THRESHOLD)) {
                    int newCorner = minDistBetweenIndices(distApart, c1, c2);
                    filteredCorners.add(i, newCorner);

                    allLines = false;
                }
            }
        }

        for (int i = 1; i < filteredCorners.size() - 1; i++) {
            int c1 = filteredCorners.get(i - 1);
            int c2 = filteredCorners.get(i);
            int c3 = filteredCorners.get(i + 1);

            if (isLine(c1, c3, LINE_THRESHOLD)) {
                filteredCorners.remove(i);
                i--;
            }
        }
        try {

            if (distance(pts.get(0), pts.get(filteredCorners.get(1))) < 15.0) {
                filteredCorners.remove(1);
            }

            if (distance(pts.get(pts.size() - 1), pts.get(filteredCorners.get(filteredCorners.size() - 2))) < 15.0) {
                filteredCorners.remove(filteredCorners.size() - 2);
            }
        } catch (Exception ex) {

        }

        return filteredCorners;
    }