Hi Asad,
1 - how much time it will take to process an image?
Hi Asad,
Thank you for writing back.
I have performed a few tests on different file formats having different file sizes with constant 200 DPI resolution whereas the input template has 20 grid elements/questions to be recognized. The BMP image format having 10 MB size took the least time (105 milliseconds) to recognize all 20 markers. Jpeg image of 318 KB file size took 166 milliseconds for the same process. Tiff image of 2.7 MB took 463 milliseconds.
Here are the answers to your questions in the same sequence.
- It depends on the image format & the number of elements in the template. As per my observation BMP images are most favorable as it took the least time (105 milliseconds) to recognize 20 elements from the attached template. Moreover, if you increase the number of elements the time to process the image will slightly increase.
- Apparently, image format is the most concerned factor regardless of the file size therefore the image size may not affect the OMR process or execution time at large.
- Resolution should be 200 DPI at least, however, it suggested to scan the documents at 300 DPI.
- Same as above.
Please feel free to write back in case you have further questions.
C#
string[] imagesFiles = Directory.GetFiles(MyDir + “/paper/”);
var watch = new System.Diagnostics.Stopwatch();
//Load template file
OmrTemplate template = OmrTemplate.Load(MyDir + “template-20Q.amr”);
foreach (var imagesFile in imagesFiles)
{
FileInfo fileInfo = new FileInfo(imagesFile);
watch.Start();
//Load the image to be analyzed
OmrImage image = OmrImage.Load(imagesFile);
// Instantiate the recognition engine for the template
OmrEngine engine = new OmrEngine(template);
// Extract data. This template has only one page.
OmrProcessingResult result = engine.ExtractData(new OmrImage[] { image });
//Load actual result from
Hashtable OmrResult = result.PageData[0];
//Get Collection of Keys
ICollection key = OmrResult.Keys;
foreach (string k in key)
{
Console.WriteLine(k + ": " + OmrResult[k]);
}
Console.WriteLine("Processed " + imagesFile + " in " + watch.ElapsedMilliseconds + “miliseconds”);
}
watch.Stop();
i want to use ur code in a seperate thread as the directory will receive a file using filewatcher i will process that file in a separate thread. Do u think, cross-thread type exception could occur or not???
Hi Asad,
Thanks a lot. so please give the urls for 1 month trial version for OCR.Net.
Hi again,
var omrlicense = new Aspose.OMR.License();
omrlicense.SetLicense(@“file path location to the .lic file”);