public BinaryMap ComputeMask(BlockMap blocks, short[, ,] histogram) { byte[,] contrast = Contrast.Compute(blocks, histogram); BinaryMap mask = new BinaryMap(AbsoluteContrast.DetectLowContrast(contrast)); mask.Or(RelativeContrast.DetectLowContrast(contrast, blocks)); mask.Or(LowContrastMajority.Filter(mask)); mask.Or(BlockErrorFilter.Filter(mask)); mask.Invert(); mask.Or(BlockErrorFilter.Filter(mask)); mask.Or(BlockErrorFilter.Filter(mask)); mask.Or(InnerMaskFilter.Filter(mask)); Logger.Log(mask); return(mask); }