当前位置: 首页>>代码示例>>C#>>正文


C# CvMat.ToArray方法代码示例

本文整理汇总了C#中CvMat.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# CvMat.ToArray方法的具体用法?C# CvMat.ToArray怎么用?C# CvMat.ToArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CvMat的用法示例。


在下文中一共展示了CvMat.ToArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SerializableCvMat

 public SerializableCvMat(CvMat mat)
 {
     this.Cols = mat.Cols;
     this.Rows = mat.Rows;
     this.ElemType = mat.ElemType;
     this.Array = mat.ToArray();
 }
开发者ID:guozanhua,项目名称:KinectMotionCapture,代码行数:7,代码来源:SerializableCvMat.cs

示例2: CalculateReprojectionError

    private double CalculateReprojectionError(List<Vector3> _imagePositions, int pointsCount, CvMat imagePoints, CvMat objectPoints, CvMat intrinsic, CvMat distortion, CvMat rotation_, CvMat translation_)
    {
        // openCV SSD taken from http://stackoverflow.com/questions/23781089/opencv-calibratecamera-2-reprojection-error-and-custom-computed-one-not-agree

        CvMat imagePointsOut = PutImagePointsIntoCVMat(_imagePositions, pointsCount); // will be overwritten, but should be correct size. Hacky and slow imp
        Cv.ProjectPoints2(objectPoints, rotation_, translation_, intrinsic, distortion, imagePointsOut);

        var ar1 = imagePoints.ToArray();
        var ar2 = imagePointsOut.ToArray();
        double diff = 0.0f;
        for (int i = 0; i < pointsCount; i++)
        {
            diff = diff + System.Math.Pow(System.Math.Abs(ar1[i].Val0 - ar2[i].Val0), 2.0) + System.Math.Pow(System.Math.Abs(ar1[i].Val1 - ar2[i].Val1), 2.0);
        }
        diff = System.Math.Sqrt(diff / pointsCount);
        return diff;
    }
开发者ID:guozanhua,项目名称:UnityProjectionMapping,代码行数:17,代码来源:Calibration.cs


注:本文中的CvMat.ToArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。