opencvsharp4 BitmapConverter Bitmap cannot be changed. [closed]

asked 2020-08-10 21:38:49 -0600

updated 2020-08-11 00:18:04 -0600

OpenCvSharp.Extensions.BitmapConverter bug?

        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);

        liveRverseImage.SaveImage("livebmp.bmp");  // Image saving success
        captureRverseImage.SaveImage("cpaturebmp.bmp"); // Image saving success

        Bitmap liveReverseBitmap = BitmapConverter.ToBitmap(liveRverseImage);
        Bitmap captureReverseBitmap = BitmapConverter.ToBitmap(captureRverseImage);
        liveReverseBitmap.Save("liveReverseBitmap.bmp"); // Failed to save image. 
        captureReverseBitmap.Save("captureReverseBitmap.bmp"); // Failed to save image.

result image description

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by berak
close date 2020-08-11 01:32:52.421092

Comments

we cannot help with 3rdparty c# wrappers, and opencv does not have a "BitmapConverter"

berak gravatar imageberak ( 2020-08-11 01:33:52 -0600 )edit