using OpenCvSharp;

namespace VisionBuilder.UI.Avalonia.Services;

public static class ImageConverter
{
    public static global::Avalonia.Media.Imaging.Bitmap MatToAvaloniaBitmap(Mat mat)
    {
        var encoded = mat.ImEncode(".bmp");
        using var ms = new MemoryStream(encoded);
        return new global::Avalonia.Media.Imaging.Bitmap(ms);
    }
}
