/// <summary>
        /// Gets element
        /// </summary>
        /// <param name="i">First coordinate</param>
        /// <param name="j">Second coordinate</param>
        /// <returns>Object at vector[i][j] location</returns>
        public ERStat GetElement(int i, int j)
        {
            ERStat output = new ERStat();

            NativeMethods.vector_vector_ERStat_getElement(ptr, i, j, output.CvPtr);
            return(output);
        }
Beispiel #2
0
        /// <summary>
        /// Converts std::vector to managed array
        /// </summary>
        /// <returns></returns>
        public ERStat[] ToArray()
        {
            int size = Size;

            if (size == 0)
            {
                return(new ERStat[0]);
            }

            ERStat[] dst = new ERStat[size];
            for (int i = 0; i < size; ++i)
            {
                dst[i] = GetElement(i);
            }
            return(dst);
        }
        /// <summary>
        /// Converts std::vector to managed array
        /// </summary>
        /// <returns></returns>
        public ERStat[][] ToArray()
        {
            int size1 = Size1;

            if (size1 == 0)
            {
                return(new ERStat[0][]);
            }
            long[] size2 = Size2;

            ERStat[][] ret = new ERStat[size1][];
            for (int i = 0; i < size1; i++)
            {
                ret[i] = new ERStat[size2[i]];
                for (int j = 0; j < size2[i]; ++j)
                {
                    ret[i][j] = GetElement(i, j);
                }
            }

            return(ret);
        }
 public double Eval(ERStat stat)
 {
     return(NativeMethods.text_ERFilter_Callback_eval(ptr, stat.CvPtr));
 }
 /// <summary>
 /// Copy-constructs ERStat with ref object
 /// </summary>
 /// <param name="refObj"></param>
 public ERStat(ERStat refObj)
     : this(refObj.CvPtr)
 {
 }