No result in Accurancy

Discussions about forms processing support.
Post Reply
alexr93
Posts: 1
Joined: Wed Nov 15, 2017 7:36 pm

No result in Accurancy

Post by alexr93 » Wed Nov 15, 2017 9:26 pm

I have a problem with the Javascript code, when making the comparison after having created my template and making the comparison by area against another image always the result is 0, I do not know what I am doing wrong, they could help me with this. I insert my code

Code: Select all

<script>
var oLicenseManager = new
ActiveXObject('GdPicture14.LicenseManager');
var m_GdPictureImaging = new
ActiveXObject('GdPicture14.GdPictureImaging');
        var Mode = Object.freeze({
"FavorSpeed": 1,
"FavorQuality" : 0
        })
oLicenseManager.RegisterKEY("XXXX");
var m_TemplateImg =
m_GdPictureImaging.CreateGdPictureImageFromFile("C://…//Plantilla.jpg");
var m_AnchorLeft = 895;
var m_AnchorTop = 518;
var m_AnchorWidth = 104;
var m_AnchorHeight = 80;
var m_ROIWidth = 354;
var m_ROIHeight = 354;
var m_ROILeft = 770;
var m_ROITop = 381;
var m_TemplateAnchor =
m_GdPictureImaging.CreateAnchorTemplate(m_TemplateImg, m_AnchorLeft, m_AnchorTop, m_AnchorWidth, m_AnchorHeight);
//Imagen a Comparar
var m_CurrentImage =
m_GdPictureImaging.CreateGdPictureImageFromFile("C://…//Validar.jpg");
var anchor_left = 0;
var anchor_top = 0;
var anchor_width = 0;
var anchor_height = 0;
var accuracy = 0;
m_GdPictureImaging.FindAnchor(m_CurrentImage, m_TemplateAnchor,
Mode.FavorSpeed, m_ROILeft, m_ROITop, m_ROIWidth, m_ROIHeight, anchor_left, anchor_top, anchor_width, anchor_height, accuracy);
alert(accuracy);
</script>
Thank you!

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

Re: No result in Accurancy

Post by Loïc » Tue Nov 21, 2017 5:22 pm

Hi,

I don't think you can pass parameters by reference using Javascript + ActiveX.
But for what it's worth, maybe this is a possible solution: https://stackoverflow.com/questions/512 ... javascript

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest