How to create OMR template file (.omr) using existing image in Java

@jamesanvictoria

Certainly!

BufferedImage, InputStream and their subclasses can be used as input parameters
In the new API entries for TemplateProcessor.recognizeImage methods.


        InputStream inputStream = new FileInputStream(imagePath);

        OmrEngine engine = new OmrEngine();
        TemplateProcessor tp = engine.getTemplateProcessor(templatePath); 
        RecognitionResult rr = tp.recognizeImage(inputStream, 40);

        BufferedImage bufferedImage = javax.imageio.ImageIO.read(new File(imagePath));

        OmrEngine engine = new OmrEngine();
        TemplateProcessor tp = engine.getTemplateProcessor(templatePath); 
        RecognitionResult rr = tp.recognizeImage(bufferedImage , 40);

Hi @nikita.korobeynikov

I can confirm it works like a charm.

Many thanks again.

BTW, I have another sheet which requires template file. Do you mind creating .omr file for me?

Cheers,

Hello, @jamesanvictoria

Glad to be of assistance!
Not at all - send details here and I will create .omr file.

In a couple days there will be an update for OMR sheet designer. In new version there will be a support for different layouts and versions of OMR.

Hi @nikita.korobeynikov

Thank you as always for your collaboration.

I have a question regarding the orientation of scanned images.

Currently, we are uploading scanned images in the correct orientation, but sometimes some images are uploaded upside down, which causes detection issues.

From my understanding, the four squares in the corners help detect the scope of the sheet, but not its orientation. (Please correct me if I’m mistaken.)

Is there any way to allow the system to accept and properly process answer sheets that are scanned upside down as well?

Thank you in advance for your advice.

Hello, @jamesanvictoria

Glad to be of assistance!

We have a solution for .NET version of the library in the form of the fifth rotation point.

For Java version, there is no solution or workaround at the moment.
I will investigate it and post an estimate and release dates for the rotation support in Java.

Hi @nikita.korobeynikov,

Many thanks to your co-work again and please feel free to let me know your update all the time.

Cheers,