We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

RecognizeMultiPageTemplate

I am providing a multi-page OMR file along with two images calling RecognizeMultiPageTemplate. However the recognition results come back with 2 copies of Page #1 in the array and the results are fine for page #1, but page 2 is completely ignored and unprocessed when calling recognitionResults[1].GetCsv().

Attached is the OMR file. Is there anything wrong with the formatting? If not, is this a bug?
scorecard1.zip (1.5 KB)

@Shonn

Would you please share the sample images as well along with sample code snippet that you are using? We will test the scenario in our environment and address it accordingly.

scorecard2.png (44.3 KB)
scorecard1.png (58.4 KB)

var engine = new OmrEngine();
TemplateProcessor templateProcessor = engine.GetTemplateProcessor(@"D:\dev\AsposeOmrTesting\AsposeOmrTesting\Templates\TwoPageScoreCard.omr");

string imagePath1 = Path.Combine(@"D:\dev\AsposeOmrTesting\AsposeOmrTesting\", "scorecard1.png");
string imagePath2 = Path.Combine(@"D:\dev\AsposeOmrTesting\AsposeOmrTesting\", "scorecard2.png");

var recognitionResults = templateProcessor.RecognizeMultiPageTemplate(new string[] { imagePath1, imagePath2 });

string csvResultPage1 = recognitionResults[0].GetCsv();
string csvResultPage2 = recognitionResults[1].GetCsv();

@Shonn

We are checking it and will share our feedback with you soon.

@Shonn

We were able to replicate the issue in our environment. Therefore, have logged it as OMRNET-392 in our issue tracking system for further investigation. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Understood, thank you for your help!

1 Like

@Shonn

Can you please share the source with which you created the multi-page template? (.txt or .json) So that we can recreate all the steps and try to understand the problem.

I used your Aspose OMR Client application to overlay both forms and simply made it into an OMR structure with 2 page objects.

@Shonn

Thanks for the feedback. We will let you know in case we need more information from your side.

@Shonn

For correct identification of a page in multipage templates, each page is provided with a barcode element.
This barcode element stores page numbers. Without this element, multipage templates recognize only the first page.

You used the WPF application to create .omr markup. Unfortunately, this application does not have multipage functionality.

To emulate this functionality we have edited the scorecard.omr file - added checkboxes for page two.
and added a barcode with page identifier to scorecard1.png and scorecard2.png. We have plans to include similar functionality in web applications as well.

omrfiles.zip (114.8 KB)

OK, I understand the WPF application doesn’t provide that functionality. Thank you for adding the page barcodes for me. I see that the height and width are the same on both but the top and left values are different…if I had 3 pages would either of these entries work on page 3 as well, or does the Top and Left values vary depending on the page?

{
					"Type": "BarcodeDownloadable",
					"Name": "pageBarcode",
					"Width": 109,
					"Height": 106,
					"Top": 410,
					"Left": 1194,
					"BarcodeType": "QR",
					"QrVersion": 1
				},

{
					"Type": "BarcodeDownloadable",
					"Name": "pageBarcode",
					"Width": 109,
					"Height": 106,
					"Top": 406,
					"Left": 1179,
					"BarcodeType": "QR",
					"QrVersion": 1
				},

@Shonn

We have recorded your feedback under the earlier logged ticket and will share updates with you soon.

@Shonn

There is no fundamental difference if the upper right point is shifted by a couple of pixels. The main thing is that the page name is encrypted in the barcode - Page1, Page2 etc. Then the program will understand which page is currently recognized and give the result for it.

I’m still seeing the same issue where it is processing Page 1 twice using your modified OMR and image files. I simply replaced my OMR with yours, printed the images, filled them out (see attached PNGs in the zip file), and I’ve attached the CSV results for the RecognizeMultiPageTemplate() results array items recognitionResults[0] and recognitionResults[1] so you can see what I’m seeing. Even the OMR fields you added for page 2, such as STAGE4NOGO, are not in the second set of results. Instead, I just see a repeat of that elements from page 1.

Also, notice that the “pageBarcode” CSV values are not coming in for either page, nor are any of the other barcodes (QR codes).

Please advise. Thank you!

MultipageIssue2.zip (1.4 MB)

@Shonn

We are checking the issue in our environment and will get back to you shortly.

@Shonn

Best way for you would be to use our version and code. If it is impossible - please provide your personal code snippet and API version details:

We have run tests on Aspose.OMR version - 22.1 and did not notice any issue.

We have used this code:

int customThreshold = 40;
OmrEngine engine = new OmrEngine();
TemplateProcessor templateProcessor = engine.GetTemplateProcessor(@"C:\Users\User\Desktop\ScoreCard\scorecard.omr");

var images = new string[] { @"C:\Users\User\Desktop\ScoreCard\scorecard1.png", @"C:\Users\User\Desktop\ScoreCard\scorecard2.png" };

RecognitionResult[] results = templateProcessor.RecognizeMultiPageTemplate(images, customThreshold);
for (var i =0; i < results.Length; i++)
{
 var stringRes = results[i].GetCsv();
 File.WriteAllText($@"C:\Users\User\Desktop\ScoreCard\scorecard{i+1}.csv", stringRes);
}