I've been working on a face recognition system. The image processor using the following code :
Bitmap bit = (Bitmap) System.Drawing.Image.FromFile (files [j].FullName, true);
Image <Bgr, Byte> img1 = new Image <Bgr, Byte>(bit); // path can be absolute or relative.
Image <Gray, Byte> grayFrem = img1.Convert <Gray, byte>();
I render and receive an increase in data and puts the data into the Dictionary.
After the income I want to actually do:
Img1.Dispose ();
I do it because I want to unlock the file and then perform a copy in a different class, this is the code that I use to copy.
File.Copy (Path.Combine (path, pic), Path.Combine (backupDir, pic), true);
I get still get this error :
Unhandled Exception: System.IO.IOException: The process can not access the file 'C: \ xxxxxx \ xxxx \ xxx \ 95177.jpg' because it s being used by another process.
Can I use another method to unlock the image or the process?
Best regards