Exemple #1
0
        /// <summary>
        /// CvSparseMatデータから初期化
        /// </summary>
        /// <param name="m">CvSparseMat 行列構造体へのポインタ.</param>
#else
        /// <summary>
        /// converts old-style CvSparseMat to the new matrix; the data is not copied by default
        /// </summary>
        /// <param name="m">Old style CvSparseMat object</param>
#endif
        public SparseMat(CvSparseMat m)
        {
            if (m == null)
            {
                throw new ArgumentNullException(nameof(m));
            }
            m.ThrowIfDisposed();
            ptr = NativeMethods.core_SparseMat_new4(m.CvPtr);
            if (ptr == IntPtr.Zero)
            {
                throw new OpenCvSharpException();
            }
        }
Exemple #2
0
        /// <summary>
        /// CvSparseMatデータから初期化
        /// </summary>
        /// <param name="m">CvSparseMat 行列構造体へのポインタ.</param>
#else
        /// <summary>
        /// converts old-style CvSparseMat to the new matrix; the data is not copied by default
        /// </summary>
        /// <param name="m">Old style CvSparseMat object</param>
#endif
        public SparseMat(CvSparseMat m)
        {
            if (m == null)
            {
                throw new ArgumentNullException("m");
            }
            m.ThrowIfDisposed();
            ptr = NativeMethods.core_SparseMat_new4(m.CvPtr);
            if (ptr == IntPtr.Zero)
            {
                throw new OpenCvSharpException();
            }
            NotifyMemoryPressure(SizeOf);
        }
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="mat"></param>
 /// <returns></returns>
 public static SparseMat FromCvSparseMat(CvSparseMat mat)
 {
     return(new SparseMat(mat));
 }