com.google.zxing.pdf417.detector.Detector.findVertices180(com.google.zxing.common.BitMatrix)

Here are the examples of the csharp api class com.google.zxing.pdf417.detector.Detector.findVertices180(com.google.zxing.common.BitMatrix) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: ZXing-CSharp
Source File: Detector.cs
public DetectorResult detect(System.Collections.Hashtable hints)
		{
			// Fetch the 1 bit matrix once up front.
			BitMatrix matrix = image.BlackMatrix;
			
			// Try to find the vertices assuming the image is upright.
			ResultPoint[] vertices = findVertices(matrix);
			if (vertices == null)
			{
				// Maybe the image is rotated 180 degrees?
				vertices = findVertices180(matrix);
				if (vertices != null)
				{
					correctCodeWordVertices(vertices, true);
				}
			}
			else
			{
				correctCodeWordVertices(vertices, false);
			}
			
			if (vertices != null)
			{
				float moduleWidth = computeModuleWidth(vertices);
				if (moduleWidth < 1.0f)
				{
					throw ReaderException.Instance;
				}
				
				int dimension = computeDimension(vertices[4], vertices[6], vertices[5], vertices[7], moduleWidth);
				if (dimension < 1)
				{
					throw ReaderException.Instance;
				}
				
				// Deskew and sample image.
				BitMatrix bits = sampleGrid(matrix, vertices[4], vertices[5], vertices[6], vertices[7], dimension);
				return new DetectorResult(bits, new ResultPoint[]{vertices[4], vertices[5], vertices[6], vertices[7]});
			}
			else
			{
				throw ReaderException.Instance;
			}
		}