private void button1_Click(object sender, EventArgs e) { Idx = (Idx + 1) % 9; Left = new Image <Rgb, byte>((Idx + 1) + "right.png").Resize(320, 240, INTER.CV_INTER_NN); Right = new Image <Rgb, byte>((Idx + 1) + "left.png").Resize(320, 240, INTER.CV_INTER_NN); Network = new MarkovNetwork(Left, Right); while (Network.Step > 1) { LogProbability maxProb = LogProbability.Zero; int afterMaxStepsCount = 0; while (afterMaxStepsCount < 5) { afterMaxStepsCount++; Network.HiggsStep(); UpdateImage(); var prob = Network.GetPotential(); if (prob > maxProb) { maxProb = prob; afterMaxStepsCount = 0; } } Network.ReduceStep(); } for (int i = 0; i < 100; i++) { Network.HiggsStep(); UpdateImage(); } }
private void button2_Click(object sender, EventArgs e) { Network.ReduceStep(); }