Thanks for your patience.
We have further investigated the scenario and found that the exception was not caused by the multiple answers but, by the fact that reference points were located very close to the border line - which caused errors during image processing. The best way to deal with such issues is to remove borders completely.
We also advise to use as less borders or additional lines on template as possible (check our test data on Github to see examples of cleaner borderless templates: https://github.com/aspose-omr/Aspose.OMR-for-.NET/tree/master/TestData). If you still want to use borders on image, it is required to move reference points further away from borders to avoid issues.
In the attached archive there are two folders:
LargerSpace, with edited image and template and more space around reference points. Still, there is a possibility that some of poor quality photos may not be recognized. We recommend using NoBorders to avoid issues completely.
NoBorders, which contains edited image and template, as well as several photos demonstrating that with clearly visible reference points almost any kind of image can be recognized. Photo “1.jpg” is rather good quality, while “2.jpg” and “3.jpg” are rotated and curved. Still, it is possible to fully recognize such images.
For some poor quality photos, like “2.jpg” and “3.jpg” it is required to use custom threshold value for bubbles recognition like so:
int customThreshold = 40;
OmrEngine engine = new OmrEngine();
TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath);
RecognitionResult result = templateProcessor.RecognizeImage(imagePath, customThreshold);
This threshold represents the percentage of black pixels in the bubble and surrounding area, which is processed during recognition. Not all images may work perfectly on default value (which is currently set to 45), especially rotated or skewed. In such cases, it is required to find best fitting value to achieve best results. Usually lowering the threshold a bit allows to correctly process such images.
Templates (1).zip (3.5 MB)
We have generated another ticket as OMR-462 in order to investigate against these images and will surely share our feedback as soon as investigation is complete. Please spare us little time.
PS: We were unable to notice any issue with the image (86dcef93-c19b-4655-99c6-3f54d8fbf939.jpg (116.1 KB)) from the archive.