Ejemplo n.º 1
0
 /// <summary>
 /// modifies geometry of array without copying the data
 /// </summary>
 /// <param name="newcn"></param>
 /// <param name="newndims"></param>
 /// <param name="newsz"></param>
 /// <returns></returns>
 public MatND Reshape(int newcn, int newndims = 0, int[] newsz = null)
 {
     if (disposed)
         throw new ObjectDisposedException("MatND");
     MatND dst = new MatND();
     CppInvoke.MatND_reshape(ptr, newcn, newndims, newsz, dst.CvPtr);
     return dst;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// assigns "s" to the selected elements of array
 /// (or to all the elements if mask==MatND())
 /// </summary>
 /// <param name="s"></param>
 /// <param name="mask"></param>
 /// <returns></returns>
 public MatND SetTo(CvScalar s, MatND mask = null)
 {
     if (disposed)
         throw new ObjectDisposedException("MatND");
     IntPtr maskPtr = (mask == null) ? IntPtr.Zero : mask.CvPtr;
     MatND dst = new MatND();
     CppInvoke.MatND_setTo(ptr, s, maskPtr, dst.CvPtr);
     return dst;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// converts data to the specified data type.
 /// calls m.create(this->size(), rtype) prior to the conversion
 /// </summary>
 /// <param name="dst"></param>
 /// <param name="rtype"></param>
 /// <param name="alpha"></param>
 /// <param name="beta"></param>
 /// <returns></returns>
 public void ConvertTo(MatND dst, MatrixType rtype, double alpha = 1, double beta = 0)
 {
     if (disposed)
         throw new ObjectDisposedException("MatND");
     CppInvoke.MatND_convertTo(ptr, dst.CvPtr, rtype, alpha, beta);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// copies those matrix elements to "m" that are marked with non-zero mask elements.
 /// </summary>
 /// <param name="m"></param>
 /// <param name="mask"></param>
 public void CopyTo(MatND m, MatND mask)
 {
     if (disposed)
         throw new ObjectDisposedException("MatND");
     if (m == null)
         throw new ArgumentNullException("m");
     if (mask == null)
         throw new ArgumentNullException("mask");
     CppInvoke.MatND_copyTo2(ptr, m.CvPtr, mask.CvPtr);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// creates a complete copy of the matrix (all the data is copied)
 /// </summary>
 /// <returns></returns>
 public MatND Clone()
 {
     if (disposed)
         throw new ObjectDisposedException("MatND");
     MatND outValue = new MatND();
     CppInvoke.Mat_clone(ptr, outValue.CvPtr);
     return outValue;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// sub-array selection; only the header is copied
 /// </summary>
 /// <param name="ranges"></param>
 /// <returns></returns>
 public virtual MatND this[CvSlice[] ranges]
 {
     get
     {
         MatND result = new MatND();
         CppInvoke.MatND_opRange(ptr, ranges, result.CvPtr);
         return result;
     }
 }