9using System.Collections.Generic;
27 G = G.DetectEdgesSharrVertical();
30 G = G.Close((13 * M.
Width + 208) / 415, (5 * M.
Height + 300) / 600);
31 G.Threshold(G.OtsuThreshold());
36 Array.Sort(Objects, (o1, o2) => o1.
MinY - o2.MinY);
38 List<ushort> Found = [];
42 float Aspect = ((float)Object.
Width) / Object.
Height;
46 float RelativeWidth = ((float)Object.
Width) / G.Width;
47 if (RelativeWidth < 0.75f)
50 int i = (5 * Math.Max(M.Width, M.Height) + 300) / 600;
52 Point[] Reduced2 = Reduced.Reduce(i);
53 if (Reduced2.Length != 4)
62 Matrix<float> SubRegion = ForOcr.
Region((ForOcr.Width - G.Width) / 2, (ForOcr.Height - G.Height) / 2, G.Width, G.Height);
75 G = G.DetectEdgesSharrVertical();
78 G = G.Close((13 * M.
Width + 208) / 415, (5 * M.
Height + 300) / 600);
79 G.Threshold(G.OtsuThreshold());
84 Array.Sort(Objects, (o1, o2) => o1.
MinY - o2.MinY);
86 List<ushort> Found = [];
90 float Aspect = ((float)Object.
Width) / Object.
Height;
94 float RelativeWidth = ((float)Object.
Width) / G.Width;
95 if (RelativeWidth < 0.75f)
104 Found.Add(Object.
Nr);
107 if (Found.Count == 0)
110 Matrix<int> SubRegion = ForOcr.
Region((ForOcr.Width - G.Width) / 2, (ForOcr.Height - G.Height) / 2, G.Width, G.Height);
Implements a Matrix, basic component for computations in Image Processing and Computer Vision.
int Height
Height of matrix (number of rows)
int Width
Width of matrix (number of columns)
Matrix< T > Region(int Left, int Top, int Width, int Height)
Returns a region of the matrix, as a new matrix.
Contains an object map of contents in an image.
ObjectInformation[] Objects
Objects found in map.
IMatrix Extract(params ushort[] Nrs)
Extracts one or more objects in the form of image from the underlying image. Only pixels pertaining t...
Static class for Object Operations, implemented as extensions.
static ? Matrix< float > ExtractMrzRegion(this Matrix< float > M)
Extracts the MRZ region of an image.
static ? Matrix< int > ExtractMrzRegion(this Matrix< int > M)
Extracts the MRZ region of an image.
Represents a point in an image.