• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ResultPoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ResultPoint的典型用法代码示例。如果您正苦于以下问题:C# ResultPoint类的具体用法?C# ResultPoint怎么用?C# ResultPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ResultPoint类属于命名空间,在下文中一共展示了ResultPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: createTransform

        public virtual PerspectiveTransform createTransform(ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomLeft, ResultPoint alignmentPattern, int dimension)
        {
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
            float dimMinusThree = (float) dimension - 3.5f;
            float bottomRightX;
            float bottomRightY;
            float sourceBottomRightX;
            float sourceBottomRightY;
            if (alignmentPattern != null)
            {
                bottomRightX = alignmentPattern.X;
                bottomRightY = alignmentPattern.Y;
                sourceBottomRightX = sourceBottomRightY = dimMinusThree - 3.0f;
            }
            else
            {
                // Don't have an alignment pattern, just make up the bottom-right point
                bottomRightX = (topRight.X - topLeft.X) + bottomLeft.X;
                bottomRightY = (topRight.Y - topLeft.Y) + bottomLeft.Y;
                sourceBottomRightX = sourceBottomRightY = dimMinusThree;
            }

            PerspectiveTransform transform = PerspectiveTransform.quadrilateralToQuadrilateral(3.5f, 3.5f, dimMinusThree, 3.5f, sourceBottomRightX, sourceBottomRightY, 3.5f, dimMinusThree, topLeft.X, topLeft.Y, topRight.X, topRight.Y, bottomRightX, bottomRightY, bottomLeft.X, bottomLeft.Y);

            return transform;
        }
开发者ID:hankhongyi,项目名称:zxing_for_wp8,代码行数:26,代码来源:Detector.cs


示例2: applyMirroredCorrection

 /// <summary>
 /// Apply the result points' order correction due to mirroring.
 /// </summary>
 /// <param name="points">Array of points to apply mirror correction to.</param>
 internal void applyMirroredCorrection(ResultPoint[] points)
 {
    if (!mirrored || points == null || points.Length < 3)
    {
       return;
    }
    ResultPoint bottomLeft = points[0];
    points[0] = points[2];
    points[2] = bottomLeft;
    // No need to 'fix' top-left and alignment pattern.
 }
开发者ID:n1rvana,项目名称:ZXing.NET,代码行数:15,代码来源:QRCodeDecoderMetaData.cs


示例3: AztecDetectorResult

 /// <summary>
 /// Initializes a new instance of the <see cref="AztecDetectorResult"/> class.
 /// </summary>
 /// <param name="bits">The bits.</param>
 /// <param name="points">The points.</param>
 /// <param name="compact">if set to <c>true</c> [compact].</param>
 /// <param name="nbDatablocks">The nb datablocks.</param>
 /// <param name="nbLayers">The nb layers.</param>
 public AztecDetectorResult(BitMatrix bits,
                            ResultPoint[] points,
                            bool compact,
                            int nbDatablocks,
                            int nbLayers)
    : base(bits, points)
 {
    Compact = compact;
    NbDatablocks = nbDatablocks;
    NbLayers = nbLayers;
 }
开发者ID:Redth,项目名称:ZXing.Net.Mobile,代码行数:19,代码来源:AztecDetectorResult.cs


示例4: Result

 public Result(String text, sbyte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format)
 {
     if (text == null && rawBytes == null)
     {
         throw new ArgumentException("Text and bytes are null");
     }
     this.text = text;
     this.rawBytes = rawBytes;
     this.resultPoints = resultPoints;
     this.format = format;
     resultMetadata = null;
 }
开发者ID:henningms,项目名称:zxing2.0-wp7,代码行数:12,代码来源:Result.cs


示例5: Create

        /// <summary>
        /// Initializes a new instance of the <see cref="ZXing.PDF417.Internal.BoundingBox"/> class.
        /// returns null if the corner points don't match up correctly
        /// </summary>
        /// <param name="image">The image.</param>
        /// <param name="topLeft">The top left.</param>
        /// <param name="bottomLeft">The bottom left.</param>
        /// <param name="topRight">The top right.</param>
        /// <param name="bottomRight">The bottom right.</param>
        /// <returns></returns>
        public static BoundingBox Create(BitMatrix image,
                                         ResultPoint topLeft,
                                         ResultPoint bottomLeft,
                                         ResultPoint topRight,
                                         ResultPoint bottomRight)
        {
            if ((topLeft == null && topRight == null) ||
                (bottomLeft == null && bottomRight == null) ||
                (topLeft != null && bottomLeft == null) ||
                (topRight != null && bottomRight == null))
            {
                return null;
            }

            return new BoundingBox(image, topLeft, bottomLeft, topRight, bottomRight);
        }
开发者ID:hydrayu,项目名称:imobile-src,代码行数:26,代码来源:BoundingBox.cs


示例6: BoundingBox

        /// <summary>
        /// Initializes a new instance of the <see cref="ZXing.PDF417.Internal.BoundingBox"/> class.
        /// Will throw an exception if the corner points don't match up correctly
        /// </summary>
        /// <param name="image">Image.</param>
        /// <param name="topLeft">Top left.</param>
        /// <param name="topRight">Top right.</param>
        /// <param name="bottomLeft">Bottom left.</param>
        /// <param name="bottomRight">Bottom right.</param>
        public BoundingBox(BitMatrix image, 
                           ResultPoint topLeft, 
                           ResultPoint bottomLeft,
                           ResultPoint topRight, 
                           ResultPoint bottomRight)
        {
            if ((topLeft == null && topRight == null) ||
                (bottomLeft == null && bottomRight == null) ||
                (topLeft != null && bottomLeft == null) ||
                (topRight != null && bottomRight == null))
            {
                throw ReaderException.Instance;
            }

            this.Image = image;
            this.TopLeft = topLeft;
            this.TopRight = topRight;
            this.BottomLeft = bottomLeft;
            this.BottomRight = bottomRight;
            CalculateMinMaxValues();
        }
开发者ID:Th3Ya0vi,项目名称:GameHouseUniverse,代码行数:30,代码来源:BoundingBox.cs


示例7: orderBestPatterns

            /**
           * <p>Orders an array of three ResultPoints in an order [A,B,C] such that AB < AC and
           * BC < AC and the angle between BC and BA is less than 180 degrees.
           */
          public static void orderBestPatterns(ResultPoint[] patterns) {

            // Find distances between pattern centers
            float zeroOneDistance = distance(patterns[0], patterns[1]);
            float oneTwoDistance = distance(patterns[1], patterns[2]);
            float zeroTwoDistance = distance(patterns[0], patterns[2]);

            ResultPoint pointA, pointB, pointC;
            // Assume one closest to other two is B; A and C will just be guesses at first
            if (oneTwoDistance >= zeroOneDistance && oneTwoDistance >= zeroTwoDistance) {
              pointB = patterns[0];
              pointA = patterns[1];
              pointC = patterns[2];
            } else if (zeroTwoDistance >= oneTwoDistance && zeroTwoDistance >= zeroOneDistance) {
              pointB = patterns[1];
              pointA = patterns[0];
              pointC = patterns[2];
            } else {
              pointB = patterns[2];
              pointA = patterns[0];
              pointC = patterns[1];
            }

            // Use cross product to figure out whether A and C are correct or flipped.
            // This asks whether BC x BA has a positive z component, which is the arrangement
            // we want for A, B, C. If it's negative, then we've got it flipped around and
            // should swap A and C.
            if (crossProductZ(pointA, pointB, pointC) < 0.0f) {
              ResultPoint temp = pointA;
              pointA = pointC;
              pointC = temp;
            }

            patterns[0] = pointA;
            patterns[1] = pointB;
            patterns[2] = pointC;
          }
开发者ID:andrejpanic,项目名称:win-mobile-code,代码行数:41,代码来源:GenericResultPoint.cs


示例8: decode

 // Note that we don't try rotation without the try harder flag, even if rotation was supported.
 public virtual Result decode(BinaryBitmap image, System.Collections.Generic.Dictionary <Object,Object> hints)
 {
     try
     {
         return doDecode(image, hints);
     }
     catch (ReaderException re)
     {
         bool tryHarder = hints != null && hints.ContainsKey(DecodeHintType.TRY_HARDER);
         if (tryHarder && image.RotateSupported)
         {
             BinaryBitmap rotatedImage = image.rotateCounterClockwise();
             Result result = doDecode(rotatedImage, hints);
             // Record that we found it rotated 90 degrees CCW / 270 degrees CW
             System.Collections.Generic.Dictionary <Object,Object> metadata = result.ResultMetadata;
             int orientation = 270;
             if (metadata != null && metadata.ContainsKey(ResultMetadataType.ORIENTATION))
             {
                 // But if we found it reversed in doDecode(), add in that result here:
                 orientation = (orientation + ((System.Int32) metadata[ResultMetadataType.ORIENTATION])) % 360;
             }
             result.putMetadata(ResultMetadataType.ORIENTATION, (System.Object) orientation);
             // Update result points
             ResultPoint[] points = result.ResultPoints;
             int height = rotatedImage.Height;
             for (int i = 0; i < points.Length; i++)
             {
                 points[i] = new ResultPoint(height - points[i].Y - 1, points[i].X);
             }
             return result;
         }
         else
         {
             throw re;
         }
     }
 }
开发者ID:hankhongyi,项目名称:zxing_for_wp8,代码行数:38,代码来源:OneDReader.cs


示例9: doDecode

      /// <summary>
      /// We're going to examine rows from the middle outward, searching alternately above and below the
      /// middle, and farther out each time. rowStep is the number of rows between each successive
      /// attempt above and below the middle. So we'd scan row middle, then middle - rowStep, then
      /// middle + rowStep, then middle - (2 * rowStep), etc.
      /// rowStep is bigger as the image is taller, but is always at least 1. We've somewhat arbitrarily
      /// decided that moving up and down by about 1/16 of the image is pretty good; we try more of the
      /// image if "trying harder".
      /// </summary>
      /// <param name="image">The image to decode</param>
      /// <param name="hints">Any hints that were requested</param>
      /// <returns>The contents of the decoded barcode</returns>
      virtual protected Result doDecode(BinaryBitmap image, IDictionary<DecodeHintType, object> hints)
      {
         int width = image.Width;
         int height = image.Height;
         BitArray row = new BitArray(width);

         int middle = height >> 1;
         bool tryHarder = hints != null && hints.ContainsKey(DecodeHintType.TRY_HARDER);
         int rowStep = Math.Max(1, height >> (tryHarder ? 8 : 5));
         int maxLines;
         if (tryHarder)
         {
            maxLines = height; // Look at the whole image, not just the center
         }
         else
         {
            maxLines = 15; // 15 rows spaced 1/32 apart is roughly the middle half of the image
         }

         for (int x = 0; x < maxLines; x++)
         {

            // Scanning from the middle out. Determine which row we're looking at next:
            int rowStepsAboveOrBelow = (x + 1) >> 1;
            bool isAbove = (x & 0x01) == 0; // i.e. is x even?
            int rowNumber = middle + rowStep * (isAbove ? rowStepsAboveOrBelow : -rowStepsAboveOrBelow);
            if (rowNumber < 0 || rowNumber >= height)
            {
               // Oops, if we run off the top or bottom, stop
               break;
            }

            // Estimate black point for this row and load it:
            row = image.getBlackRow(rowNumber, row);
            if (row == null)
               continue;

            // While we have the image data in a BitArray, it's fairly cheap to reverse it in place to
            // handle decoding upside down barcodes.
            for (int attempt = 0; attempt < 2; attempt++)
            {
               if (attempt == 1)
               { 
                  // trying again?
                  row.reverse(); // reverse the row and continue
                  // This means we will only ever draw result points *once* in the life of this method
                  // since we want to avoid drawing the wrong points after flipping the row, and,
                  // don't want to clutter with noise from every single row scan -- just the scans
                  // that start on the center line.
                  if (hints != null && hints.ContainsKey(DecodeHintType.NEED_RESULT_POINT_CALLBACK))
                  {
                     IDictionary<DecodeHintType, Object> newHints = new Dictionary<DecodeHintType, Object>();
                     foreach (var hint in hints)
                     {
                        if (hint.Key != DecodeHintType.NEED_RESULT_POINT_CALLBACK)
                           newHints.Add(hint.Key, hint.Value);
                     }
                     hints = newHints;
                  }
               }
               // Look for a barcode
               Result result = decodeRow(rowNumber, row, hints);
               if (result == null)
                  continue;

               // We found our barcode
               if (attempt == 1)
               {
                  // But it was upside down, so note that
                  result.putMetadata(ResultMetadataType.ORIENTATION, 180);
                  // And remember to flip the result points horizontally.
                  ResultPoint[] points = result.ResultPoints;
                  if (points != null)
                  {
                     points[0] = new ResultPoint(width - points[0].X - 1, points[0].Y);
                     points[1] = new ResultPoint(width - points[1].X - 1, points[1].Y);
                  }
               }
               return result;
            }
         }

         return null;
      }
开发者ID:arumata,项目名称:zxingnet,代码行数:96,代码来源:OneDReader(4).cs


示例10: SetTopRight

 /// <summary>
 /// If we adjust the width, set a new right corner coordinate and recalculate
 /// </summary>
 /// <param name="topRight">Top right.</param>
 internal void SetTopRight(ResultPoint topRight)
 {
     this.TopRight = topRight;
     CalculateMinMaxValues();
 }
开发者ID:Th3Ya0vi,项目名称:GameHouseUniverse,代码行数:9,代码来源:BoundingBox.cs


示例11: processFinderPatternInfo

      /// <summary>
      /// Processes the finder pattern info.
      /// </summary>
      /// <param name="info">The info.</param>
      /// <returns></returns>
      protected internal virtual DetectorResult processFinderPatternInfo(FinderPatternInfo info)
      {
         FinderPattern topLeft = info.TopLeft;
         FinderPattern topRight = info.TopRight;
         FinderPattern bottomLeft = info.BottomLeft;

         float moduleSize = calculateModuleSize(topLeft, topRight, bottomLeft);
         if (moduleSize < 1.0f)
         {
            return null;
         }
         int dimension;
         if (!computeDimension(topLeft, topRight, bottomLeft, moduleSize, out dimension))
            return null;
         Internal.Version provisionalVersion = Internal.Version.getProvisionalVersionForDimension(dimension);
         if (provisionalVersion == null)
            return null;
         int modulesBetweenFPCenters = provisionalVersion.DimensionForVersion - 7;

         AlignmentPattern alignmentPattern = null;
         // Anything above version 1 has an alignment pattern
         if (provisionalVersion.AlignmentPatternCenters.Length > 0)
         {

            // Guess where a "bottom right" finder pattern would have been
            float bottomRightX = topRight.X - topLeft.X + bottomLeft.X;
            float bottomRightY = topRight.Y - topLeft.Y + bottomLeft.Y;

            // Estimate that alignment pattern is closer by 3 modules
            // from "bottom right" to known top left location
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
            float correctionToTopLeft = 1.0f - 3.0f / (float)modulesBetweenFPCenters;
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
            int estAlignmentX = (int)(topLeft.X + correctionToTopLeft * (bottomRightX - topLeft.X));
            //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
            int estAlignmentY = (int)(topLeft.Y + correctionToTopLeft * (bottomRightY - topLeft.Y));

            // Kind of arbitrary -- expand search radius before giving up
            for (int i = 4; i <= 16; i <<= 1)
            {
               alignmentPattern = findAlignmentInRegion(moduleSize, estAlignmentX, estAlignmentY, (float)i);
               if (alignmentPattern == null)
                  continue;
               break;
            }
            // If we didn't find alignment pattern... well try anyway without it
         }

         PerspectiveTransform transform = createTransform(topLeft, topRight, bottomLeft, alignmentPattern, dimension);

         BitMatrix bits = sampleGrid(image, transform, dimension);
         if (bits == null)
            return null;

         ResultPoint[] points;
         if (alignmentPattern == null)
         {
            points = new ResultPoint[] { bottomLeft, topLeft, topRight };
         }
         else
         {
            points = new ResultPoint[] { bottomLeft, topLeft, topRight, alignmentPattern };
         }
         return new DetectorResult(bits, points);
      }
开发者ID:n1rvana,项目名称:ZXing.NET,代码行数:70,代码来源:Detector.cs


示例12: calculateModuleSizeOneWay

 /// <summary> <p>Estimates module size based on two finder patterns -- it uses
 /// {@link #sizeOfBlackWhiteBlackRunBothWays(int, int, int, int)} to figure the
 /// width of each, measuring along the axis between their centers.</p>
 /// </summary>
 private float calculateModuleSizeOneWay(ResultPoint pattern, ResultPoint otherPattern)
 {
    //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
    float moduleSizeEst1 = sizeOfBlackWhiteBlackRunBothWays((int)pattern.X, (int)pattern.Y, (int)otherPattern.X, (int)otherPattern.Y);
    //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
    float moduleSizeEst2 = sizeOfBlackWhiteBlackRunBothWays((int)otherPattern.X, (int)otherPattern.Y, (int)pattern.X, (int)pattern.Y);
    if (Single.IsNaN(moduleSizeEst1))
    {
       return moduleSizeEst2 / 7.0f;
    }
    if (Single.IsNaN(moduleSizeEst2))
    {
       return moduleSizeEst1 / 7.0f;
    }
    // Average them, and divide by 7 since we've counted the width of 3 black modules,
    // and 1 white and 1 black module on either side. Ergo, divide sum by 14.
    return (moduleSizeEst1 + moduleSizeEst2) / 14.0f;
 }
开发者ID:Bogdan-p,项目名称:ZXing.Net,代码行数:22,代码来源:Detector.cs


示例13: calculateModuleSize

 /// <summary> <p>Computes an average estimated module size based on estimated derived from the positions
 /// of the three finder patterns.</p>
 /// </summary>
 protected internal virtual float calculateModuleSize(ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomLeft)
 {
    // Take the average
    return (calculateModuleSizeOneWay(topLeft, topRight) + calculateModuleSizeOneWay(topLeft, bottomLeft)) / 2.0f;
 }
开发者ID:Bogdan-p,项目名称:ZXing.Net,代码行数:8,代码来源:Detector.cs


示例14: computeDimension

 /// <summary> <p>Computes the dimension (number of modules on a size) of the QR Code based on the position
 /// of the finder patterns and estimated module size.</p>
 /// </summary>
 private static bool computeDimension(ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomLeft, float moduleSize, out int dimension)
 {
    int tltrCentersDimension = MathUtils.round(ResultPoint.distance(topLeft, topRight) / moduleSize);
    int tlblCentersDimension = MathUtils.round(ResultPoint.distance(topLeft, bottomLeft) / moduleSize);
    dimension = ((tltrCentersDimension + tlblCentersDimension) >> 1) + 7;
    switch (dimension & 0x03)
    {
       // mod 4
       case 0:
          dimension++;
          break;
       // 1? do nothing
       case 2:
          dimension--;
          break;
       case 3:
          return true;
    }
    return true;
 }
开发者ID:Bogdan-p,项目名称:ZXing.Net,代码行数:23,代码来源:Detector.cs


示例15: getRowIndicatorColumn

 /// <summary>
 /// Gets the row indicator column.
 /// </summary>
 /// <returns>The row indicator column.</returns>
 /// <param name="image">Image.</param>
 /// <param name="boundingBox">Bounding box.</param>
 /// <param name="startPoint">Start point.</param>
 /// <param name="leftToRight">If set to <c>true</c> left to right.</param>
 /// <param name="minCodewordWidth">Minimum codeword width.</param>
 /// <param name="maxCodewordWidth">Max codeword width.</param>
 private static DetectionResultRowIndicatorColumn getRowIndicatorColumn(BitMatrix image,
                                                                        BoundingBox boundingBox,
                                                                        ResultPoint startPoint,
                                                                        bool leftToRight,
                                                                        int minCodewordWidth,
                                                                        int maxCodewordWidth)
 {
    DetectionResultRowIndicatorColumn rowIndicatorColumn = new DetectionResultRowIndicatorColumn(boundingBox, leftToRight);
    for (int i = 0; i < 2; i++)
    {
       int increment = i == 0 ? 1 : -1;
       int startColumn = (int) startPoint.X;
       for (int imageRow = (int) startPoint.Y; imageRow <= boundingBox.MaxY &&
                                               imageRow >= boundingBox.MinY; imageRow += increment)
       {
          Codeword codeword = detectCodeword(image, 0, image.Width, leftToRight, startColumn, imageRow,
                                             minCodewordWidth, maxCodewordWidth);
          if (codeword != null)
          {
             rowIndicatorColumn.setCodeword(imageRow, codeword);
             if (leftToRight)
             {
                startColumn = codeword.StartX;
             }
             else
             {
                startColumn = codeword.EndX;
             }
          }
       }
    }
    return rowIndicatorColumn;
 }
开发者ID:Woo-Long,项目名称:ZXing.Net.Mobile,代码行数:43,代码来源:PDF417ScanningDecoder.cs


示例16: calculateMinMaxValues

        /// <summary>
        /// Calculates the minimum and maximum X &amp; Y values based on the corner points.
        /// </summary>
        private void calculateMinMaxValues()
        {
            // Constructor ensures that either Left or Right is not null
            if (TopLeft == null)
            {
                TopLeft = new ResultPoint(0, TopRight.Y);
                BottomLeft = new ResultPoint(0, BottomRight.Y);
            }
            else if (TopRight == null)
            {
                TopRight = new ResultPoint(image.Width - 1, TopLeft.Y);
                BottomRight = new ResultPoint(image.Width - 1, TopLeft.Y);
            }

            MinX = (int)Math.Min(TopLeft.X, BottomLeft.X);
            MaxX = (int)Math.Max(TopRight.X, BottomRight.X);
            MinY = (int)Math.Min(TopLeft.Y, TopRight.Y);
            MaxY = (int)Math.Max(BottomLeft.Y, BottomRight.Y);

        }
开发者ID:hydrayu,项目名称:imobile-src,代码行数:23,代码来源:BoundingBox.cs


示例17: GetMinCodewordWidth

 /// <summary>
 /// Gets the minimum width of the codeword.
 /// </summary>
 /// <returns>The minimum codeword width.</returns>
 /// <param name="p">P.</param>
 private static int GetMinCodewordWidth(ResultPoint[] p)
 {
     return Math.Min(
         Math.Min(GetMinWidth(p[0], p[4]), GetMinWidth(p[6], p[2]) * PDF417Common.MODULES_IN_CODEWORD /
         PDF417Common.MODULES_IN_STOP_PATTERN),
         Math.Min(GetMinWidth(p[1], p[5]), GetMinWidth(p[7], p[3]) * PDF417Common.MODULES_IN_CODEWORD /
         PDF417Common.MODULES_IN_STOP_PATTERN));
 }
开发者ID:Th3Ya0vi,项目名称:GameHouseUniverse,代码行数:13,代码来源:PDF417Reader.cs


示例18: BoundingBox

 /// <summary>
 /// Initializes a new instance of the <see cref="ZXing.PDF417.Internal.BoundingBox"/> class.
 /// Will throw an exception if the corner points don't match up correctly
 /// </summary>
 /// <param name="image">Image.</param>
 /// <param name="topLeft">Top left.</param>
 /// <param name="topRight">Top right.</param>
 /// <param name="bottomLeft">Bottom left.</param>
 /// <param name="bottomRight">Bottom right.</param>
 private BoundingBox(BitMatrix image,
                     ResultPoint topLeft,
                     ResultPoint bottomLeft,
                     ResultPoint topRight,
                     ResultPoint bottomRight)
 {
     this.image = image;
     this.TopLeft = topLeft;
     this.TopRight = topRight;
     this.BottomLeft = bottomLeft;
     this.BottomRight = bottomRight;
     calculateMinMaxValues();
 }
开发者ID:hydrayu,项目名称:imobile-src,代码行数:22,代码来源:BoundingBox.cs


示例19: GetMinWidth

 /// <summary>
 /// Gets the minimum width of the barcode
 /// </summary>
 /// <returns>The minimum width.</returns>
 /// <param name="p1">P1.</param>
 /// <param name="p2">P2.</param>
 private static int GetMinWidth(ResultPoint p1, ResultPoint p2)
 {
     if (p1 == null || p2 == null)
     {
         return int.MaxValue;
     }
     return (int)Math.Abs(p1.X - p2.X);
 }
开发者ID:Th3Ya0vi,项目名称:GameHouseUniverse,代码行数:14,代码来源:PDF417Reader.cs


示例20: FindRowsWithPattern

 /// <summary>
 /// Finds the rows with the given pattern.
 /// </summary>
 /// <returns>The rows with pattern.</returns>
 /// <param name="matrix">Matrix.</param>
 /// <param name="height">Height.</param>
 /// <param name="width">Width.</param>
 /// <param name="startRow">Start row.</param>
 /// <param name="startColumn">Start column.</param>
 /// <param name="pattern">Pattern.</param>
 private static ResultPoint[] FindRowsWithPattern(
     BitMatrix matrix,
     int height,
     int width,
     int startRow,
     int startColumn,
     int[] pattern) {
     ResultPoint[] result = new ResultPoint[4];
     bool found = false;
     int[] counters = new int[pattern.Length];
     for (; startRow < height; startRow += ROW_STEP) {
         int[] loc = FindGuardPattern(matrix, startColumn, startRow, width, false, pattern, counters);
         if (loc != null) {
             while (startRow > 0) {
                 int[] previousRowLoc = FindGuardPattern(matrix, startColumn, --startRow, width, false, pattern, counters);
                 if (previousRowLoc != null) {
                     loc = previousRowLoc;
                 } else {
                     startRow++;
                     break;
                 }
             }
             result[0] = new ResultPoint(loc[0], startRow);
             result[1] = new ResultPoint(loc[1], startRow);
             found = true;
             break;
         }
     }
     int stopRow = startRow + 1;
     // Last row of the current symbol that contains pattern
     if (found) {
         int skippedRowCount = 0;
         int[] previousRowLoc = {(int) result[0].X, (int) result[1].X};
         for (; stopRow < height; stopRow++) {
             int[] loc = FindGuardPattern(matrix, previousRowLoc[0], stopRow, width, false, pattern, counters);
             // a found pattern is only considered to belong to the same barcode if the start and end positions
             // don't differ too much. Pattern drift should be not bigger than two for consecutive rows. With
             // a higher number of skipped rows drift could be larger. To keep it simple for now, we allow a slightly
             // larger drift and don't check for skipped rows.
             if (loc != null &&
                 Math.Abs(previousRowLoc[0] - loc[0]) < MAX_PATTERN_DRIFT &&
                 Math.Abs(previousRowLoc[1] - loc[1]) < MAX_PATTERN_DRIFT) {
                 previousRowLoc = loc;
                 skippedRowCount = 0;
             } else {
                 if (skippedRowCount > SKIPPED_ROW_COUNT_MAX) {
                     break;
                 } else {
                     skippedRowCount++;
                 }
             }
         }
         stopRow -= skippedRowCount + 1;
         result[2] = new ResultPoint(previousRowLoc[0], stopRow);
         result[3] = new ResultPoint(previousRowLoc[1], stopRow);
     }
     if (stopRow - startRow < BARCODE_MIN_HEIGHT) {
         for (int i = 0; i < result.Length; i++) {
             result[i] = null;
         }
     }
     return result;
 }
开发者ID:sfurlani,项目名称:ZXing.Net.Mobile,代码行数:73,代码来源:Detector.cs



注:本文中的ResultPoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ResultSet类代码示例发布时间:2022-05-24
下一篇:
C# ResultOperatorBase类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap