private void sortPerimetro(ObjetoImagem objeto) {
        List<Point> sorted = new ArrayList<>();
        List<Point> toSort = new ArrayList<>(objeto.getPerimetro());

        Point current;
        current = toSort.get(0);
        sorted.add(toSort.get(0));
        toSort.remove(0);

        while(!toSort.isEmpty()) {
            if(toSort.size() == 1) {
                sorted.add(toSort.get(0));
                current = toSort.get(0);
                toSort.remove(0);
                break;
            }
            boolean processou = false;
            for (Point aux : toSort) {
                // Se for vizinho
                if(aux.x >= current.x - 1 && aux.x <= current.x + 1 && aux.y >= current.y - 1 && aux.y <= current.y + 1) {
                    sorted.add(aux);
                    toSort.remove(aux);
                    current = aux;
                    processou = true;
                    break;
                }
            }
            if(!processou) {
                sorted.add(toSort.get(0));
                current = toSort.get(0);
                toSort.remove(0);
            }
        }


//        objeto.setPerimetro(sorted);
    }