Anchor template not working

Discussions about machine vision support in GdPicture.
Post Reply
lordnedox
Posts: 16
Joined: Sun Oct 10, 2010 5:13 am

Anchor template not working

Post by lordnedox » Mon Apr 04, 2011 8:50 am

Hi,
i'm trying to run the OMR-Anchor sample without being able to make it work.

The problem i think is because calling:
m_GdPictureImaging.CreateAnchorTemplate( m_TemplateImg, m_AnchorLeft, m_AnchorTop, m_AnchorWidth, m_AnchorHeight );

always returns 0, while m_GdPictureImaging.GetStat( )returns OK.

I tried with JPGs and PNGs, even with the one found at this URL https://www.gdpicture.com/products/plugi ... essing.php. The result is always the same.

Trying to proceed width the method FindAnchor will result on a "Error: 2" message box (invalid parameter).

Could you please let me know what i'm missing? Is there any requirement on the file type (resolution, file size, file type) ?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Anchor template not working

Post by Loïc » Mon Apr 04, 2011 10:02 am

Hi,

Please could you attach the image from which you are trying to create a template anchor and also give us parameter values used ?

lordnedox
Posts: 16
Joined: Sun Oct 10, 2010 5:13 am

Re: Anchor template not working

Post by lordnedox » Mon Apr 04, 2011 10:49 am

As I said, i used the sample found in GdPicture Imaging folder, without modifications (except for the license number).

I tried with different files, but i got the same behaviour even with this image: https://www.gdpicture.com/images/gdpicture-omr.png , which you suggested in another post.

In this image, the area i try to select is the one marked in blue. I checked the coordinate returned by the viewer and seem ok, but CreateAnchorTemplate still return 0.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Anchor template not working

Post by Loïc » Mon Apr 04, 2011 11:03 am

Hi,

You are right. We have a problem with color image that we just fixed for the next minor release.
We are currently able to handle 1bpp image only, but we will support any kind of bitmap in a couple of days max...

Kind regards,

Loïc

lordnedox
Posts: 16
Joined: Sun Oct 10, 2010 5:13 am

Re: Anchor template not working

Post by lordnedox » Mon Apr 04, 2011 12:24 pm

Thank you very much for you quick reply, actually we always process 1BPP images but for testing purposes I was trying a color image.
Will look forward for your next release.

Regards

Normando
Posts: 11
Joined: Thu Sep 22, 2011 6:01 pm
Location: Madrid , Spain

Re: Anchor template not working

Post by Normando » Wed Oct 19, 2011 4:35 pm

In what version fix this problem? 8.3 the last?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Anchor template not working

Post by Loïc » Wed Oct 19, 2011 4:37 pm

I don't remember now, but the current version available for download have this issue fixed.

Normando
Posts: 11
Joined: Thu Sep 22, 2011 6:01 pm
Location: Madrid , Spain

Re: Anchor template not working

Post by Normando » Wed Oct 19, 2011 5:19 pm

Hi Loïc, thank you

I have a problem when use findAnchor, always return invalid parameter

I create a template with L=74, T=39, W=73, H=107
TemplateId = m_objImaging.CreateAnchorTemplate(iImgRefClone, L, T, W, H)

I Try to findanchor with the same values and return values at zero
status = m_objImaging.FindAnchor(iImgDocClone, TemplateId, ModoOMR, L, T, W, H, _xr, _yr, _wr, _hr, Coincide)

THIS ALWAYS RETURN INVALID PARAMETER
But if i use -> status = m_objImaging.FindAnchor(iImgDocClone, TemplateId, ModoOMR, 0, 0, WIDTH of IiMageDocClone, Height of iImgDocClone , ....) returns OK

i'm lost

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Anchor template not working

Post by Loïc » Wed Oct 19, 2011 6:10 pm

Hi,

Please create a ticket on our helpdesk platform attaching sample application & image that demonstrate the problem. See: https://www.gdpicture.com/support/getting-support-from-our-team

Kind regards,

Loïc

Normando
Posts: 11
Joined: Thu Sep 22, 2011 6:01 pm
Location: Madrid , Spain

Re: Anchor template not working

Post by Normando » Tue Oct 25, 2011 5:49 pm

Hi Lorïc

Thank you very much for you fastest response and solution

One more question....

When i uses findanchortemplate over two totaly diferent images i got a very hight accuracy return values.(like 97%)

What is the accuracy level that i can say "the image is not located"?

Thanks

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Anchor template not working

Post by Loïc » Tue Oct 25, 2011 5:57 pm

Hi,

You can consider good matching an accuracy between 90% & 100% if the template is correctly defined. From the reference guide:
To maximize detection speed and accuracy, the Anchor region must contain less than 50% of white pixels and must have as less white margins as possible.
Let me know if you need further information.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest