How are you ?
I'm Marco from AlmaPro Italy and in the next few days we will probably buy a full license (for another scanning app). Now we are testing your OMR engine but we have a doubt: how can we build a "template" to apply to every survey acquired from scanner ? Do we have to calculate the coordinates of every single box in the document and then pass to the ORM programmatically. In an old 3th party suite we can draw a template, test it and the use it in our application.
Alma Pro srl
Nice to see you again.
This is a quite good question. We have an OMR specialist in the team that is working on such issue. Currently you have to determine by yourself the bounding box size of each item, but with the anchoring mechanism you can easily determine the offset.
If you need some precision just let me know and I will ask our specialist to assist you.
Loic has asked him to help you with this.
Ok, to start, there are layers in the process of making OMR recognition apps:
1. The Form set up (which is what you are wondering about)
2. The matching of the form (alignment due to translation in scanning)
3. The recognition
Now steps 2 and 3 are handled by our sdk through the OMRDetect functions, and the FindAnchor.
The anchoring mechanism will determine how much translation the filled test has gone under in scanning, then you apply that translation to the rectangles that correspond to the OMR fields and then you run your OMRDetect function. (If you need more on this please do ask)
Now your question, what do I do with the rectangles, and how do I make a form that i can reuse over and over again?
Yes there are some sdks that will make you make a form, but here in GdPicture, we realized that our customers prefer more control over their forms. And since it is an app level design we could not disagree and force our Form template format.
That being said, we will provide a demo app that will include all of this integrated together in the next couple of months.
Here are some hints on how to do it:
You need to create a class called FormTemplate, in that class, you shall have an array of Rectangles, that you can initialize per form in the contructor, for example, if you have 20 questions, each having 4 possible answers, you will need 80 fields.
You will also need a string to recognize the form (this could be done a million other ways, id, handles, etc).
Your constructor call should look like this:
Code: Select all
FormTemplate( "Chemsitry A101, SPR13", 80)
Then you can populate the fields by passing an array of Rects to a SetRects function in the form.
Finally, you have a ready form to use over any scanned document of that form.
Now finally, how to draw the rectangles on a GdViewer, and make their values populate the form automatically.
Say you load your form onto GdViewer, there are a set of functions in the GdViewer called Highlighted Regions:
https://www.gdpicture.com/guides/gdpicture/v9/html/con ... gions.html
And there is the Rectangle Of Selection:
https://www.gdpicture.com/guides/gdpicture/v9/html/con ... ction.html
You need to use those two together.
Basically, on mouse up, you get the area of the rectangle of selection on the document using GetRectCoordinatesOnDocument, and you add a region using AddRegion.
You do this for every form field. When you are done, you save, call SetRects in your FormTemplate instance.
Now when you scan filled tests, you use the anchor mechanism to measure the offset, and just offset the rectangles in your FormTemplate by adding the offset. Then you call the OMRDetect function over the scanned image.
I know all this information could be overwhelming, but it is aimed at describing a whole application at once .
Again, we will implement all the above and more in an easy to understand manner in a demo app that you could probably adopt or use as is in the next couple of months.
I took a look at the anchor sample but i found it "complicated" for my case. I didn't understand the ROI management (es: the numericupdown value updated only if increased, ecc ...)
I have to scan some surveys, save them as tif, read x marks and show a report to the user.
I set up a single survey template, saved the anchor and mark points coordinates in an xml, but how can I create the anchor_template_id without using gdViewer ? I saw that in your sample you use conversion between inch and mm, use getregionid, and so on ..
The anchor sample uses the same idea i described for creating Rectangles on the OMR fields using the GdViewer and the mouse.
It is in mainly two steps:
1. Draw a RectangleOfSelection using Mouse, retrieve the position using GdViewer.GetRectCoordinatesOnDocument
2. Add a region using GdViewer.AddRegion using the position information obtained in 1.
Now when you create anchor, you retrieve that information by getting the positions of the region added in 2.
This means that you can skip point 2 all together, and use the coordinates in 1 and call CreateAnchorTemplate immediately, but point 2 is to make it more graphically friendly.
Finally, how to accomplish the above without a viewr (meaning without mouse selection). Extremely simple, if you know where your anchor is, just call CreateAnchorTemplate immediately, and then FindAnchor on the other documents with the anchor template returned.
As to the search area (which you saw in mm etc), i usually advise that the search area is not too big compared to the size of the original anchor. Meaning,
Left = AnchorLeft - (AnchorWidth /2)
Top = AnchorTop - (AnchorHeight /2)
Width = AnchorWidth * 2
Height = AnchorHeight *2
Of course the above is subject to change depending on your anchor in your form, which you would know better.
I hope this helps.
So, during development I design a form, scan it and find the coordinates of a rectangle that contains the anchor. Then I use the 'CreateAnchorTemplate' to create the anchor. Is it possible to save that information in binary form or something so that I can include it in my program. Now I have to include the tiff file with the template and save the needed coordinates. When the user starts scanning, my program must load the tiff file and use the 'CreateAnchorTemplate' method to create the anchor again. Is this correct?
If I could save the binary info of the anchor then I do not need to distribute the tiff file.
>>Do you have guidelines for marking the anchor and answer boxes?
Yes. In general they should contain more black pixels than white (more content). The rectangle of the anchor should be perfecty surrounding the object, or there will be extra white space.
>>When I mark an answerbox should I include some blank space around it? If I include an anchor on a form should it be round or square or .....
You surround the anchor with a rectangle, but the anchor itself could be anything. Now squares tend to yield better results (in all APIs and documents), because they scan better and there is less variation when the documents are being "quantized" by the scanners.
>>When I mark an answerbox should I include some blank space around it?
The answer lies in the documentation of the OMR functions:
All Rectangles sent to the function via array Areas can be of any size or location, as long as they:
Surround the OMR Field completely.
Do not intersect with borders of OMR field.
Do not intersect with other objects in the document.
Closer, more accurate selection of those rectangles will yield faster and more accurate results.
Who is online
Users browsing this forum: No registered users and 0 guests