Best shape to detect upper-left corner of a table
Kresimir Majdenic from Croatia  [38 posts]
2 years
Need to find X,Y coordinates of upper-left corner of each table in [Temporary 2.jpg]. I use Object_Recognition module -> Shape. Train sequence is run for [marker - jpg (10).jpg].

By your experience is it a good marker (shape) or you think there are "better" shapes and object recognition options [Object_recognition.jpg]?

Steven Gentner from United States  [1370 posts] 2 years

You may find better luck using the Align_Image module which was built to align pages like this with a know template (i.e. unfilled version). The advantage to using this module is that it will use the entire page as an alignment process which yields best results.


As this module can also transform the image into the template image you can be guaranteed that certain objects will always be in the same location. Thus extracting information after this module is a matter of using absolute coordinates for testing.

This is based on the assumption that you are interested in capturing the X marks?

If you need help with that module please post an empty form that can be used as a template to align successive images to.

Kresimir Majdenic from Croatia  [38 posts] 2 years
Yes, I am interested in X marks - need to know X,Y coordinates where X marks exists [ToAnalyze - 02.jpg]. Template is [TemplateImage - 02.jpg]

Steven Gentner from United States  [1370 posts] 2 years

See the attached. Load in the test.jpg image and see the results in the VBScript.

Align Image - takes care of any movement in new images so we can assume things will be where they are supposed to be.

Sample_Color - samples the min intensity in each block which is used in the VBScript to determine if a mark is there.

You will have to duplicate this for the next 2 columns. I would recommend using a better template that is correctly rotated.

Would you allow us to  use your images for a tutorial that explains more about how this is done?

The latest version of RR is needed for this to run correctly.

Kresimir Majdenic from Croatia  [38 posts] 2 years
First of all thank you very much for your kind reply and effort. And yes of course you can use that for your tutorial.

Your solution works nice :)

I will have to test that approach on several more tables. Table I've send you was taken with camera and is an image of an paper. It was newly printed and carefully handled paper but as you know paper gets wrinkled, twisted, jammed by people during regular handling procedures therefore I have to test which approach gives best results in "regular" situation.

From what I can see it takes 829 ms for align process ... it's a little bit more than an object recognition (aprox. 150ms) ... but if it turns out that this approach gives good results in a single pass then it is a faster solution.

Furthermore I forgot to mention that markings (X, check mark or a smugged dot) can be put in all of rectangular subdivisions of an each item. Technically it is possible to have table filled with marks [Template - 02.jpg] ... I guess it should not be a problem to cover that case too?

Steven Gentner from United States  [1370 posts] 2 years
Yes, it is always a good idea to test any solution on as many images as you can. Especially in the case of paper that has been handled by people.

In the case of performance, your images are larger than needed. Normally we would scale that down to a smaller image size since the X marks are still visible. Doing alignment on smaller images will run a lot quicker.

Yes, the technique can be used to analyze all 4 parts of the table .. it was not obvious that this was a requirement from your images. It will actually help to reduce the noise since the dividing dots can be removed which can sometimes cause the min value to be close to what an X mark would be. See the spacing parameter which can be used to sample only the inner part of any grid element.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index