I am developing a program for image processing, and I need to save some pictures from a video and do some processing on them. When dealing with 1 picture it doesn't really take time, But when I'm dealing with 100 pictures it makes difference I'm saving the files to my hard disk, and that's why it takes time the thing is, the function I'm using is a ready made function and it only accepts (file name) the function is really complicated so i cannot build my own function ( if that's what you are thinking )
I'm thinking of 2 things right now and would like to have your opinions about them:
- change the input of the function, but how ? is there a way to change this input from a ( file name ) to an array which holds these pictures ?
- save the file to ram. but how to save files to ram by names, and be able to use them as ( file name ) in the function ?
I appreciate your help , thanks so much
this is my code but i still have problems:
Capture video = new Capture("c:\\5.avi");
Image<Bgr, Byte> Imageframe ;
Dictionary<string, MemoryStream> dict = new Dictionary<string, MemoryStream>();
Imageframe = video.QueryFrame();
Bitmap bmp = Imageframe.ToBitmap();
dict.Add("mypicture.png", new MemoryStream());
bmp.Save(dict["mypicture.png"],imageformat.png);
its saying imageformat does not exist in the context
and this is the function im using :
Image<Bgr, byte> result;
result = DrawMatches.Draw("box.png", "box_in_scene.png", out matchTime,i);