 		//d_img_labels_.download(init_labels);
 		// init_labels.release();
 
-		Analyze << <grid_size_, block_size_ >> > (d_img_labels_);
+		//Analyze << <grid_size_, block_size_ >> > (d_img_labels_);
+		Compression << <grid_size_, block_size_ >> > (d_img_labels_);
 
 		//Mat1i analyze_labels;
 		//d_img_labels_.download(analyze_labels);
 		// analyze_labels.release();
 
 		Reduce << <grid_size_, block_size_ >> >(d_img_, d_img_labels_);
-		Analyze << <grid_size_, block_size_ >> > (d_img_labels_);
+		//Analyze << <grid_size_, block_size_ >> > (d_img_labels_);
+		Compression << <grid_size_, block_size_ >> > (d_img_labels_);
 
 		//Mat1i final_labels;
 		//d_img_labels_.download(final_labels);


		Init << <grid_size_, block_size_ >> >(d_img_, d_img_labels_);

		//Mat1i init_labels;
		//d_img_labels_.download(init_labels);
		// init_labels.release();

		Analyze << <grid_size_, block_size_ >> > (d_img_labels_);

		//Mat1i analyze_labels;
		//d_img_labels_.download(analyze_labels);
		// analyze_labels.release();

		Reduce << <grid_size_, block_size_ >> >(d_img_, d_img_labels_);
		Analyze << <grid_size_, block_size_ >> > (d_img_labels_);

		//Mat1i final_labels;
		//d_img_labels_.download(final_labels);


	}

	// Risale alla radice dell'albero a partire da un suo nodo n
	__device__ unsigned Find_label(const int *s_buf, unsigned n, unsigned label) {
		// Attenzione: non invocare la find su un pixel di background

		assert(label > 0);

		while (label - 1 != n) {
			n = label - 1;
			label = s_buf[n];

			assert(label > 0);
		}

		return n;

	}


	// Unisce gli alberi contenenti i nodi a e b, collegandone le radici
	__device__ void Union(int *s_buf, unsigned a, unsigned b) {
