private void drawPoints(int[] depthMap) {
        Vector3D vv = new Vector3D();
        data.clear();
        int c = 0;
        stroke(255);
        strokeWeight(5);
        for (int x = 0; x < resx; x++) {
            for (int y = 0; y < resy; y++) {
                int i = x + y * resx;
                if (i % nthpoint == 0) {
                    int z = depthMap[i];
                    if (z > 50) {
                        Vector3D v = new Vector3D(x, y, z);
                        Vector3D v1 = sensor.convertProjectiveToRealWorld(v);
                        if (v1.getZ() < MAX_Z && v1.getY() > MIN_Y) {
                            point((float) v1.getX(), (float) v1.getY(), (float) v1.getZ());
                            vv.add(v1);
//                            data.add(new DenseInstance(new double[]{v1.getX(), v1.getY(), v1.getZ()}));
                            data.add(v1);
                            c++;
                        }
                    }
                }
            }
        }
        vv.divide(c);
        stroke(255, 0, 0);
//        point((float) vv.getX(),(float) vv.getY(),(float) vv.getZ());
        
        pointsOut = ks.kmeansSample(data, 20);
//        pointsOut = ds.downsampleRand(data, 300);
//        pointsOut = ds.downsampleGrid(pointsOut);
        
        for(Vector3D v : pointsOut) {
            point((float)v.getX(), (float)v.getY(), (float)v.getZ());
        }  

    }