Ejemplo n.º 1
0
 /// <summary>
 /// 像素坐标转换为物理坐标
 /// </summary>
 /// <param name="pixelP"></param>
 /// <param name="physicalP"></param>
 public void TransferPixelToPhysical(ProVision.Communal.PixelCoordinate pixelP, out ProVision.Communal.WorldCoordinate physicalP)
 {
     physicalP = new Communal.WorldCoordinate()
     {
         X = pixelP.Row, Y = pixelP.Col, Z = 0
     };
     if (CaliSolution != null &&
         CaliSolution.IsEffective)
     {
         HalconDotNet.HTuple row, col, x, y;
         row = new HalconDotNet.HTuple(pixelP.Row);
         col = new HalconDotNet.HTuple(pixelP.Col);
         HalconDotNet.HOperatorSet.AffineTransPoint2d(_p2whomMat2D, row, col, out x, out y);
         physicalP.X = x.D;
         physicalP.Y = y.D;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 物理坐标转换为像素坐标
 /// </summary>
 /// <param name="physicalP"></param>
 /// <param name="pixelP"></param>
 public void TransferPhysicalToPixel(ProVision.Communal.WorldCoordinate physicalP, out ProVision.Communal.PixelCoordinate pixelP)
 {
     pixelP = new Communal.PixelCoordinate()
     {
         Row = 0, Col = 0
     };
     if (CaliSolution != null &&
         CaliSolution.IsEffective)
     {
         HalconDotNet.HTuple row, col, x, y;
         x = new HalconDotNet.HTuple(physicalP.X);
         y = new HalconDotNet.HTuple(physicalP.Y);
         HalconDotNet.HOperatorSet.AffineTransPoint2d(_w2phomMat2D, x, y, out row, out col);
         pixelP.Row = row.D;
         pixelP.Col = col.D;
     }
 }