Ask Your Question

Revision history [back]

opencvsharp4 BitmapConverter Bitmap cannot be changed.

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 image description

opencvsharp4 BitmapConverter Bitmap cannot be changed.

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 image description

opencvsharp4 BitmapConverter Bitmap cannot be changed.

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(liveRverseImage);
BitmapConverter.ToBitmap(captureRverseImage);
        liveReverseBitmap.Save("liveReverseBitmap.bmp"); // Failed to save image. 
        captureReverseBitmap.Save("captureReverseBitmap.bmp"); // Failed to save image.

result image description

opencvsharp4 BitmapConverter Bitmap cannot be changed.

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

opencvsharp4 BitmapConverter Bitmap cannot be changed.

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

opencvsharp4 BitmapConverter Bitmap cannot be changed.

OpenCvSharp.Extensions.BitmapConverter bug?

 Bitmap liveBitmap = ImageProcessingUtility.ConvertTo32(new Bitmap("Live.bmp"));
         Bitmap captureBitmap = ImageProcessingUtility.ConvertTo32(new Bitmap("Capture.bmp"));

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