Ejemplo n.º 1
0
 /// <summary>
 /// Assignment operator. This is O(1) operation, i.e. no data is copied
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public SparseMat AssignFrom(SparseMat m)
 {
     ThrowIfDisposed();
     if (m == null)
     {
         throw new ArgumentNullException(nameof(m));
     }
     NativeMethods.core_SparseMat_operatorAssign_SparseMat(ptr, m.CvPtr);
     return(this);
 }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <param name="value"></param>
 public void Write(string name, SparseMat value)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     if (value == null)
     {
         throw new ArgumentNullException(nameof(value));
     }
     NativeMethods.core_FileStorage_write_SparseMat(ptr, name, value.CvPtr);
     GC.KeepAlive(value);
 }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="defaultMat"></param>
        /// <returns></returns>
        public SparseMat ReadSparseMat(SparseMat defaultMat = null)
        {
            var value = new SparseMat();

            try
            {
                NativeMethods.core_FileNode_read_SparseMat(ptr, value.CvPtr, Cv2.ToPtr(defaultMat));
            }
            catch
            {
                value.Dispose();
                throw;
            }
            return(value);
        }
Ejemplo n.º 4
0
 internal Indexer(SparseMat parent)
     : base(parent)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// not used now
 /// </summary>
 /// <param name="m"></param>
 /// <param name="type"></param>
 public void AssignTo(SparseMat m, int type = -1)
 {
     ThrowIfDisposed();
     NativeMethods.core_SparseMat_assignTo(ptr, m.CvPtr, type);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// multiplies all the matrix elements by the specified scale factor alpha and converts the results to the specified data type
 /// </summary>
 /// <param name="m"></param>
 /// <param name="rtype"></param>
 /// <param name="alpha"></param>
 public void ConvertTo(SparseMat m, int rtype, double alpha = 1)
 {
     ThrowIfDisposed();
     NativeMethods.core_SparseMat_convertTo_SparseMat(ptr, m.CvPtr, rtype, alpha);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// copies all the data to the destination matrix. All the previous content of m is erased.
 /// </summary>
 /// <param name="m"></param>
 public void CopyTo(SparseMat m)
 {
     ThrowIfDisposed();
     NativeMethods.core_SparseMat_copyTo_SparseMat(ptr, m.CvPtr);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="parent"></param>
 internal SparseMatIndexer(SparseMat parent)
 {
     this.parent = parent;
 }