原生转换
Bitmap图片转MemoryStream
1 | ms = new MemoryStream(); |
Bytes图片转MemoryStream
1 | MemoryStream ms = new MemoryStream(bytes) |
MemoryStream转Bitmap
1 | Bitmap bitmap=new Bitmap(Image new Bitmap(ms)); |
opencvsharp转换
BGR转RGB
1 | Cv2.CvtColor(source, target, ColorConversionCodes.BGR2RGB); |
Mat/Bitmap互转
1 | bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(target); |
MemoryStream转Mat
1 | source = Mat.FromStream(ms, ImreadModes.AnyColor); |

