public void pickRegions2() {
      ArrayList<Seed> seeds = new ArrayList<Seed>();
      int idx = 0;
      int marker = 2; //mark pixel with number greater than 1
      int i = 0, j = 0;
      //int numSeeds = 3;
      final int width = this.width;
      final int height = this.height;
      int x = 0; int y = 0;
      int maxVal = 0;
      int maxIdx = 0;
      Integer[] candidates = new Integer[NUM_SEEDS];
      for (RegionGroup group : this.textgroup) {
    	  i = 0; j = 0;
    	  maxVal = 0;
    	  maxIdx = 0;
         if (group.getMembers().size() > 0) {
            System.out.println(group.getId() + ":" + group.isClosed());
            System.out.println(group.minX + "," + group.minY + "," + group.maxX + "," + group.maxY);
            System.out.println(((group.maxX + group.minX) / 2) + "," + ((group.maxY + group.minY) / 2));
            //removeTexts(group.getMembers());
            x = (group.maxX + group.minX) / 2;
            y = ((group.maxY + group.minY) / 2);
            idx = y * width + x;
            while(i++ < NUM_SEEDS) {
            	while(!checkPixel(this.pixels, idx, width, height, 3) && j++ < 1000) { //  && i++ < 1000
            		x = BDetection.randomWithRange(group.minX, (group.maxX + group.minX) / 2);
            		y = BDetection.randomWithRange(group.minY, (group.maxY + group.minY) / 2);
            		//y++; 
            		idx = y * this.width + x;
            		//seeds.add(new Seed(idx, group.minX, group.minY, group.maxX, group.maxY, group.isClosed(), group));
            	}
            	RegionInfo rInfo = seedGrowth4(new Seed(idx, group.minX, group.minY, group.maxX, group.maxY, group.isClosed(), group),
            			BDetection.RADIUS, BDetection.GAP_SCORE);
            	candidates[i-1] = idx;
            	if (rInfo.pixCount > maxVal) {
            		maxVal = rInfo.pixCount;
            		maxIdx = i-1;
            	}
            }
            seeds.add(new Seed(candidates[maxIdx], group.minX, group.minY, group.maxX, group.maxY, group.isClosed(), group));
            System.out.println((idx % this.width) + "," + (idx / this.width));
         }
      }
      for (Seed seed : seeds) {
         //grow region from the seed points
         //System.out.println("region=" + marker);
         RegionInfo rInfo = seedGrowth3(seed, marker, BDetection.RADIUS, BDetection.GAP_SCORE);
         this.pixCounts.add(rInfo);
         marker++;
      }
   }