Esempio n. 1
0
        /// <summary>
        /// Element wise add <paramref name="mat1"/> with <paramref name="mat2"/>
        /// </summary>
        /// <param name="mat1">The first mat to be added</param>
        /// <param name="mat2">The second mat to be added</param>
        /// <returns>The sum of the two images</returns>
        public static UMat operator +(UMat mat1, UMat mat2)
        {
            UMat m = new UMat();

            CvInvoke.Add(mat1, mat2, m);
            return(m);
        }
Esempio n. 2
0
        ///<summary> Elementwise add another matrix with the current matrix </summary>
        ///<param name="mat2">The matrix to be added to the current matrix</param>
        ///<returns> The result of elementwise adding mat2 to the current matrix</returns>
        public Matrix <TDepth> Add(Matrix <TDepth> mat2)
        {
            Matrix <TDepth> res = CopyBlank();

            CvInvoke.Add(this, mat2, res, null, CvInvoke.GetDepthType(typeof(TDepth)));
            return(res);
        }
Esempio n. 3
0
 /// <summary>
 /// Element wise add <paramref name="mat"/> with <paramref name="value"/>
 /// </summary>
 /// <param name="mat">The mat to be added</param>
 /// <param name="value">The value to be added</param>
 /// <returns>The mat plus the value</returns>
 public static UMat operator +(UMat mat, MCvScalar value)
 {
     using (ScalarArray saVal = new ScalarArray(value))
     {
         UMat m = new UMat();
         CvInvoke.Add(mat, saVal, m);
         return(m);
     }
 }
Esempio n. 4
0
        ///<summary> Elementwise add a color <paramref name="val"/> to the current matrix</summary>
        ///<param name="val">The value to be added to the current matrix</param>
        ///<returns> The result of elementwise adding <paramref name="val"/> from the current matrix</returns>
        public Matrix <TDepth> Add(TDepth val)
        {
            Matrix <TDepth> res = CopyBlank();

            using (ScalarArray ia = new ScalarArray(System.Convert.ToDouble(val)))
            {
                CvInvoke.Add(this, ia, res, null, CvInvoke.GetDepthType(typeof(TDepth)));
            }
            return(res);
        }