public MonochromeCell BuildMonochrome(ColorRegion region) { if (_averageImageColorValue > ColorStats.GetValue(region.Color)) { return(new MonochromeCell(true)); } else { return(new MonochromeCell(false)); } }
public ColorRegion[,] GroupSectorsByColor() { // To be merged with last one var lastSectorWidth = image.Width % sectorWidth; var lastSectorHeight = image.Height % sectorHeight; var colors = new ColorRegion[sectorRows, sectorCols]; var sectors = GetColorSectors(); for (var row = 0; row < sectorRows; row++) { for (var col = 0; col < sectorCols; col++) { var sector = sectors[row, col]; var color = ColorStats.CalculateAverageColorArr(sector); var colorRegion = new ColorRegion(sectorHeight, sectorWidth, color); colors[row, col] = colorRegion; } } return(colors); }