public static int[][] trimWhiteRows(int[][] seg){
		
		boolean blackflag = false;
		
	
			if(seg.length < 1 )
				return seg;
			if(seg[0].length < 1)
				return seg;
			
			int[][] eToESeg = new int[seg.length][seg[0].length];
			int newSegCurrentRow = 0;
			
			for(int i = 0; i < seg.length; i++ ){
				
				blackflag = false;
				for(int j = 0; j < seg[0].length; j++){
					
					if(seg[i][j] == 1){
						blackflag = true;
						break;
					}
				}
				
				if(blackflag){
					eToESeg[newSegCurrentRow] = seg[i];
					newSegCurrentRow++;
				}
			}
		
			// we need to make a new array with extra columns deleted
			int[][] realSegmentarray = new int[newSegCurrentRow][seg[0].length];
			for(int x = 0; x < newSegCurrentRow; x++){
				
				realSegmentarray[x] = eToESeg[x];
			}
			
			return realSegmentarray;
	}