0

I have a code like below. I want convert the image from picture-box to apply median-filter by EmguCV. And the problem is that the "out of memory" problem occurs even though I dispose the image. After I click many button handler, the first line occurs show the problem. Please help me!

Bitmap bm1 = new Bitmap(imgBox.Image); //Out of memory
Image<Gray, byte> EmguImage1 = new Image<Gray, byte>(bm1);
EmguImage = EmguImage1.SmoothMedian(1);
imgBox.Image.Dispose();
imgBox.Image = EmguImage1.Bitmap;
bm1.Dispose();
EmguImage1.Dispose();
Huu Tin
  • 57
  • 1
  • 1
  • 8

0 Answers0