示例#1
0
        /// <summary>
        /// Detects the multi.
        /// </summary>
        /// <param name="hints">The hints.</param>
        /// <returns></returns>
        public DetectorResult[] detectMulti(IDictionary <DecodeHintType, object> hints)
        {
            var image = Image;
            var resultPointCallback =
                hints == null || !hints.ContainsKey(DecodeHintType.NEED_RESULT_POINT_CALLBACK) ? null : (ResultPointCallback)hints[DecodeHintType.NEED_RESULT_POINT_CALLBACK];
            var finder = new MultiFinderPatternFinder(image, resultPointCallback);
            var infos  = finder.findMulti(hints);

            if (infos.Length == 0)
            {
                return(EMPTY_DETECTOR_RESULTS);
            }

            var result = new List <DetectorResult>();

            foreach (FinderPatternInfo info in infos)
            {
                var oneResult = processFinderPatternInfo(info);
                if (oneResult != null)
                {
                    result.Add(oneResult);
                }
            }
            if (result.Count == 0)
            {
                return(EMPTY_DETECTOR_RESULTS);
            }
            else
            {
                return(result.ToArray());
            }
        }
        public DetectorResult[] detectMulti(Hashtable hints)
        {
            BitMatrix           image = Image;
            ResultPointCallback resultPointCallback =
                hints == null || !hints.Contains(DecodeHintType.NEED_RESULT_POINT_CALLBACK) ? null : (ResultPointCallback)hints[DecodeHintType.NEED_RESULT_POINT_CALLBACK];
            MultiFinderPatternFinder finder = new MultiFinderPatternFinder(image, resultPointCallback);

            FinderPatternInfo[] infos = finder.findMulti(hints);

            if (infos.Length == 0)
            {
                throw NotFoundException.Instance;
            }

            var result = new ArrayList();

            foreach (FinderPatternInfo info in infos)
            {
                var oneResult = processFinderPatternInfo(info);
                if (oneResult != null)
                {
                    result.Add(oneResult);
                }
            }
            if (result.Count == 0)
            {
                return(EMPTY_DETECTOR_RESULTS);
            }
            else
            {
                return((DetectorResult[])result.ToArray());
            }
        }