public void Prepare(IReadOnlyCollection <Cell> cells, Action <int, double> broadcast) { Debug.Assert(IsResolved == false, "IsResolved == false"); _neighbours = new Neighbours(this, cells); _frames = _images .Select(image => new Frame(image, _rect)) .ToArray(); var frameCount = 0; double frameDivisor = _frames.Length; foreach (var frame in _frames) { frame.UpdateConstancy(_frames); broadcast(++frameCount, frameDivisor); } SelectFrame = _frames.OrderByDescending(frame => frame.Score).First(); }