Exemplo n.º 1
0
    /// <summary>
    /// Calibrates the camera based on the images passed using <see cref="arwCaptureChessboardCorners" />.
    /// </summary>
    /// <param name="numImages">The number images.</param>
    /// <param name="file_name">Name of the file.</param>
    /// <param name="xSize">Size of the x.</param>
    /// <param name="ySize">Size of the y.</param>
    /// <param name="projectErrorResults">The project error for each image.</param>
    /// <returns>
    /// The average projection error for all images calibrated.
    /// </returns>
    public float arwCalibChessboardCorners(int numImages, string file_name, out float[] projectErrorResults)
    {
        projectErrorResults = new float[numImages];
        GCHandle handle  = GCHandle.Alloc(projectErrorResults, GCHandleType.Pinned);
        IntPtr   address = handle.AddrOfPinnedObject();
        float    averageProjectionError = ARNativePlugin.arwCalibChessboardCorners(file_name, address);

        handle.Free();
        return(averageProjectionError);
    }