コード例 #1
0
      /// <summary>
      /// Creates a WhiteRectangleDetector instance
      /// </summary>
      /// <param name="image">The image.</param>
      /// <param name="initSize">Size of the init.</param>
      /// <param name="x">The x.</param>
      /// <param name="y">The y.</param>
      /// <returns>
      /// null, if image is too small, otherwise a WhiteRectangleDetector instance
      /// </returns>
      public static WhiteRectangleDetector Create(BitMatrix image, int initSize, int x, int y)
      {
         var instance = new WhiteRectangleDetector(image, initSize, x, y);

         if (instance.upInit < 0 || instance.leftInit < 0 || instance.downInit >= instance.height || instance.rightInit >= instance.width)
         {
            return null;
         }

         return instance;
      }
コード例 #2
0
      /// <summary>
      /// Creates a WhiteRectangleDetector instance
      /// </summary>
      /// <param name="image">barcode image to find a rectangle in</param>
      /// <param name="initSize">initial size of search area around center</param>
      /// <param name="x">x position of search center</param>
      /// <param name="y">y position of search center</param>
      /// <returns>
      /// null, if image is too small, otherwise a WhiteRectangleDetector instance
      /// </returns>
      public static WhiteRectangleDetector Create(BitMatrix image, int initSize, int x, int y)
      {
         var instance = new WhiteRectangleDetector(image, initSize, x, y);

         if (instance.upInit < 0 || instance.leftInit < 0 || instance.downInit >= instance.height || instance.rightInit >= instance.width)
         {
            return null;
         }

         return instance;
      }
コード例 #3
0
        /// <summary>
        /// Creates a WhiteRectangleDetector instance
        /// </summary>
        /// <param name="image">The image.</param>
        /// <returns>null, if image is too small, otherwise a WhiteRectangleDetector instance</returns>
        public static WhiteRectangleDetector Create(BitMatrix image)
        {
            var instance = new WhiteRectangleDetector(image);

            if (instance.upInit < 0 || instance.leftInit < 0 || instance.downInit >= instance.height || instance.rightInit >= instance.width)
            {
                return(null);
            }

            return(instance);
        }
コード例 #4
0
      /// <summary>
      /// Creates a WhiteRectangleDetector instance
      /// </summary>
      /// <param name="image">The image.</param>
      /// <returns>null, if image is too small, otherwise a WhiteRectangleDetector instance</returns>
      public static WhiteRectangleDetector Create(BitMatrix image)
      {
         if (image == null)
            return null;

         var instance = new WhiteRectangleDetector(image);

         if (instance.upInit < 0 || instance.leftInit < 0 || instance.downInit >= instance.height || instance.rightInit >= instance.width)
         {
            return null;
         }

         return instance;
      }