private void Test() { OriginalImage.Save(@"C:\Users\10488835\Desktop\PhD\Papers\Software Practise and Experience\Latex\images\BackgroundSub\1-Original.png"); using (Image <Gray, Byte> displayImage = OriginalImage.Convert <Gray, Byte>()) using (Image <Gray, Byte> binaryimage = displayImage.ThresholdBinary(new Gray(ThresholdValue), new Gray(255))) { binaryimage.Save(@"C:\Users\10488835\Desktop\PhD\Papers\Software Practise and Experience\Latex\images\BackgroundSub\2-BinaryImage.png"); Image <Gray, Byte> binaryBackground; IEnumerable <IBoundaryBase> boundaries; VideoSettings.GeneratePreview(Video, out binaryBackground, out boundaries); binaryBackground.Save(@"C:\Users\10488835\Desktop\PhD\Papers\Software Practise and Experience\Latex\images\BackgroundSub\3-BinaryBackground.png"); using (Image <Gray, Byte> subbed = binaryBackground.AbsDiff(binaryimage)) using (Image <Gray, Byte> not = binaryBackground.Not()) using (Image <Gray, Byte> added = binaryimage.Add(not)) { added.Save(@"C:\Users\10488835\Desktop\PhD\Papers\Software Practise and Experience\Latex\images\BackgroundSub\4-BinaryAdded.png"); } } }