private void ApplyMask_Click(object sender, RoutedEventArgs e) { Button selectedMask = sender as Button; inputWithMask = SegmentationOperator.ApplyMask(input, selectedMask.CommandParameter as Bitmap); BitmapImageWithMask = BitmapToBitmapImage(inputWithMask); }
public void InitializeMasks(List <Bitmap> bitmapMasks, Bitmap input, Bitmap output) { this.input = input; this.output = output; BitmapImageOutput = BitmapToBitmapImage(output); Masks = new ObservableCollection <MaskModel>(); foreach (Bitmap bmp in bitmapMasks) { Masks.Add(new MaskModel { Bitmap = bmp, Image = BitmapToBitmapImage(bmp) }); } inputWithMask = SegmentationOperator.ApplyMask(input, Masks.First().Bitmap); BitmapImageWithMask = BitmapToBitmapImage(inputWithMask); }