private void CalcOpticalFlowBase(Bitmap leftInput, Bitmap rightInput, Func <SimpleImage, SimpleImage, int, FlowArray> flowCalcFunc, int pyramidLevel = 4) { SimpleImage left = new SimpleImage(leftInput); SimpleImage right = new SimpleImage(rightInput); System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch(); watch.Start(); _SingleFlow = flowCalcFunc(left, right, pyramidLevel); watch.Stop(); this.CalculationTimeText.Text = watch.Elapsed.Milliseconds.ToString(); SimpleImage demonstrator = _CLProcessor.ModifyImageWithFlow(left, null, _SingleFlow); _LeftFlowImage = left; _RightFlowImage = right; _DIsplayedImage = _LeftFlowImage; _ModifiedImage = demonstrator; }
private void DisplayImage() { if (EarlierRadioButton.Checked) { _DIsplayedImage = _LeftFlowImage; } else if (ModifiedImageRadioButton.Checked) { _DIsplayedImage = _ModifiedImage; } else { _DIsplayedImage = _RightFlowImage; } SimpleImage result = _DIsplayedImage; if (DecorateCheckBox.Checked) { result = _CLProcessor.Decorateflow(result, _SingleFlow); } DemonstratorPB.Image = result.Bitmap; }
private void ModifiedImageRadioButton_CheckedChanged(object sender, EventArgs e) { _DIsplayedImage = _ModifiedImage; DisplayImage(); }
private void LaterRadioButton_CheckedChanged(object sender, EventArgs e) { _DIsplayedImage = _RightFlowImage; DisplayImage(); }