Exemplo n.º 1
0
        /// <summary> <p>Detects a QR Code in an image, simply.</p>
        /// 
        /// </summary>
        /// <param name="hints">optional hints to detector
        /// </param>
        /// <returns> {@link DetectorResult} encapsulating results of detecting a QR Code
        /// </returns>
        /// <throws>  ReaderException if no QR Code can be found </throws>
        public virtual DetectorResult detect(Dictionary<DecodeHintType, Object> hints)
        {
            resultPointCallback = hints == null
                                      ? null
                                      : (ResultPointCallback) hints[DecodeHintType.NEED_RESULT_POINT_CALLBACK];

            var finder = new FinderPatternFinder(image, resultPointCallback);
            FinderPatternInfo info = finder.find(hints);

            return processFinderPatternInfo(info);
        }
Exemplo n.º 2
0
      /// <summary>
      ///   <p>Detects a QR Code in an image, simply.</p>
      /// </summary>
      /// <param name="hints">optional hints to detector</param>
      /// <returns>
      ///   <see cref="DetectorResult"/> encapsulating results of detecting a QR Code
      /// </returns>
      public virtual DetectorResult detect(IDictionary<DecodeHintType, object> hints)
      {
         resultPointCallback = hints == null || !hints.ContainsKey(DecodeHintType.NEED_RESULT_POINT_CALLBACK) ? null : (ResultPointCallback)hints[DecodeHintType.NEED_RESULT_POINT_CALLBACK];

         FinderPatternFinder finder = new FinderPatternFinder(image, resultPointCallback);
         FinderPatternInfo info = finder.find(hints);
         if (info == null)
            return null;

         return processFinderPatternInfo(info);
      }