axCvEdge2.PX and axCvEdge2.PY Problem

The values of axCvEdge2.PX/PY are 0 all the time when I try to find a label on the selected area.
How can I get the PX and PY values?
Thank you!

axCVdisplay2.GetSelectedArea(ref x0, ref y0, ref x1, ref y1, ref x2, ref y2);
axCvEdge2.Image = axCVimage2.Image;

axCvEdge2.X0 = x0; 
axCvEdge2.X1 = x1; 
axCvEdge2.X2 = x2; 
axCvEdge2.Y0 = y0; 
axCvEdge2.Y0 = y1; 
axCvEdge2.Y0 = y2;
if (checkBoxPositive.Checked == true)
    axCvEdge2.Polarity1 = EdgePolarity.POLARITY_POSITIVE;
    axCvEdge2.Polarity1 = EdgePolarity.POLARITY_NEGATIVE;
axCvEdge2.Threshold1 = Convert.ToDouble(m_TextThreshold.Text);
axCVdisplay2.AddLabel("X", false, 255, 0, Convert.ToInt32(axCvEdge2.PX), Convert.ToInt32(axCvEdge2.PY));
axCvEdge2.Polarity1 = EdgePolarity.POLARITY_NEGATIVE;

As you can see here, the 2010 tutorial Edge uses this:

axCVdisplay3.GetSelectedArea(ref x0, ref y0, ref x1, ref y1, ref x2, ref y2);
Cvb.Image.SetArea(x0, y0, x1, y1, x2, y2, out scanArea);

bool located = Cvb.Edge.TFindFirstEdge(axCVimage3.Image, 0, 1000, scanArea, System.Convert.ToDouble(m_TrackThreshold.Value.ToString()), checkBoxPositive.Checked, out result);
if (located)
    axCVdisplay3.AddLabel("X", false, 255, 0, (int)result.x, (int)result.y);

And that works, but we are not sure if Cvb.Edge.TFindFirstEdge is using foundations, because our dongles do not allow Foundations, only AX.

Hi @George,

the code you posted is only making adjustments to the parameters of the Edge OCX - it is not actually calling any processing functions and therefore the result properties (amongst them PX and PY) cannot be expected to have useful values.

The Edge tool today is part of the Foundation package. If you are using a resonably recent version of :cvb: and a reasonably recent dongle, then I don’t see why you should not be able to use TFindFirstEdge and similar functions.

(btw: posted code looks better if you enclose it in tripe-backticks before and after the code)

Hello Illusive,
Our dongles do not support Foundations.
So are you telling me that Cvb.Edge.TFindFirstEdge is part of foundations now and we can not use them?

We just upgraded our old parallel dongles to usb from Stemmer, these have edge and minos tools attached to them, and we can not use Cvb.Edge.TFindFirstEdge or the execute functions which was included in your AX Tutorials from 2004 but now you have moved it to Foundations…is that true?
Illusive, we need to use Cvb.Edge.TFindFirstEdge so…what is the solution to this?
Thank you

Hi @George

The Edge tool became part of the Foundation Package in the 11.00.000 release of :cvb: in 2011. Before that, the Edge tool was an individual tool.

I’d need more input on that before I can comment here:

  1. What dongle (Sentinel/SafeNet/Rainbow or CodeMeter?)
  2. What code are you referring to? Do you mean a “CVC Edge Magic Number”? These do only refer to (and work with) up to and including CVB 10.2 - all versions > 11.0 will need a Foundation Package license instead.
  3. What exactly do you mean with “an error with our dongles when we use that code”?