Histogram buildHistR(RegionInfo region) {
	   int unitX = 15;
	   int sizeX = 360 / unitX; //360 degrees
	   int l = (int)(Math.sqrt(this.width * this.width + this.height * this.height)/2);
	   //int sizeY = 20;
	   //Histogram2D histR = new Histogram2D(sizeX, sizeY, 0, sizeX, 0, l);
	   Histogram histR = new Histogram(sizeX, 0, 360);
	   int orgX = (region.maxX - region.minX) / 2;
	   int orgY = (region.maxY - region.minY) / 2;
	   //rho = cos()x + sin()y;
	   //x = r*cos(), y = r*sin();
	   int x = 0;
	   int y = 0;
	   int idx = 0;
	   int val = 0;
	   for (int t = 0; t < sizeX; t++) {
		   for (int r = 1; r < l; r++) {
			   x = orgX + (int) Math.floor(r * Math.cos(t*unitX*Math.PI/180));
			   y = orgY + (int) Math.floor(r * Math.sin(t*unitX*Math.PI/180));
			   idx = y * this.width + x;
			   if (isLegal(idx) && this.pixels[idx*3] == (byte)0) {
				   val = this.blackPixels[idx] & 0xff;
                   if (val >=2 && this.blackRegions.get(val - 2).type != 1)
				       histR.bin(t, r);
                   break;
			   }
			   else if (!isLegal(idx)) {
				   histR.bin(t, r);
				   break;
			   }
		   }
	   }
	   return histR;
   }