Bitmap liveBitmap = ImageProcessingUtility.ConvertTo32(new Bitmap("Live.bmp")); Bitmap captureBitmap = ImageProcessingUtility.ConvertTo32(new Bitmap("Capture.bmp"));
Mat liveImage = BitmapConverter.ToMat(liveBitmap);
Mat captureImage = BitmapConverter.ToMat(captureBitmap);
Mat liveRverseImage = new Mat(liveImage.Size(), liveImage.Type());
Mat captureRverseImage = new Mat(captureImage.Size(), captureImage.Type());
Cv2.BitwiseNot(liveImage, liveRverseImage);
Cv2.BitwiseNot(captureImage, captureRverseImage);
Bitmap live = BitmapConverter.ToBitmap(liveRverseImage);
Bitmap cpature = BitmapConverter.ToBitmap(captureRverseImage);
liveRverseImage.SaveImage("livebmp.bmp"); // Image saving success
captureRverseImage.SaveImage("cpaturebmp.bmp"); // Image saving success
Bitmap liveReverseBitmap = BitmapConverter.ToBitmap(liveRverseImage);
Bitmap captureReverseBitmap = BitmapConverter.ToBitmap(liveRverseImage);
liveReverseBitmap.Save("liveReverseBitmap.bmp"); // Failed to save image.
captureReverseBitmap.Save("captureReverseBitmap.bmp"); // Failed to save image.
result