Contour Analysis for Image Recognition in C#The theory of contour analysis and its practical application to image recognition and OCRSource code and demo include all needed Open. CV libs. Project requires . Automatic number plate recognition has two essential. Using the Our License Plate Recognition system within the. The ANPR system uses a fuzzy matching algorithm to compensate for possible errors in the. NET Framework 4. Introduction. The article describes the theoretical bases of the contour analysis and aspects of its practical application for image recognition. The article also includes library for operation with the contour analysis, and a demo- example. The first part of the article contains the main definitions and theorems of the contour analysis. I tried to select the principal moments which allow to understand quickly enough an essence of the contour analysis, and to begin its application in practice. Also, I added something from myself. In the core, it concerns some aspects of the theory, and also problems of optimization of algorithms of the contour analysis. The second part of the article is devoted to it. In the same place results of work of algorithms are brought, problems and deficiencies of the given method are described. The third part describes C# library Contour. Analysis. Part 1: Bases of the Contour Analysis. What is Necessary for the Contour Analysis (CA)The CA allows to describe, store, compare and find the objects presented in the form of the exterior outlines - contours. It is supposed that the contour contains the necessary information on the object shape. Interior points of the object are not accepted to attention. It restricts area of applicability of algorithms of a CA, but reviewing only contours allows to pass from two- dimensional space of the image - to space of contours and by that to lower computing and algorithmic complexity. CA allows to effectively solve the main problems of a pattern recognition - transposition, turn and a rescaling of the image of object. CA methods are invariant to these transformations. The Main Concepts. At first, we define such an object contour. The contour is a boundary of object, a population of points (pixels), separating object from a background.
In systems of computer vision, some formats of coding of a contour are used - the code of Freeman, two- dimensional coding, polygonal coding are most known. But all these formats of coding are not used in a CA. Instead, in a CA the contour is encoded by the sequence consisting of complex numbers. On a contour, the point which is called as starting point is fixed. Then, the contour is scanned (is admissible - clockwise), and each vector of offset is noted by a complex number a+ib. Where a - point offset on x axis, and b - offset on y axis. Offset is noted concerning the previous point. Owing to the physical nature of three- dimensional objects, their contours are always closed and cannot have self- intersection. It allows to define unambiguously a way of bypass of a contour (to within a direction - on or counter- clockwise). License Plate Recognition with OpenCV 3 . ASL Finger spelling recognition using C# OpenCV wrapper - Duration. Contour Analysis for Image Recognition in C#. The General Algorithm of Recognition. Automatic Number Plate Recognition, ANPR, NPR, LPR, License plate, License Plate Recognition, OCR, Car Number OCR, Vehicle Plate Reader, License Id Reader, Number Plate, Parking lot, Access Control, Traffic surveillance. The last vector of a contour always leads to the starting point. Each vector of a contour we will name elementary vector (EV). And sequence of complex- valued numbers - vector- contour (VC). Vectors- contours we will designate the big Greek letters, and their elementary a vector - small Greek letters. Thus, vector- contour ? Because operations over a contour as over a vector of complex numbers possesses remarkable mathematical properties, in comparison with other modes of coding. Basically, complex coding is close to two- dimensional coding where the contour is defined as a population of the EVs presented in the two- dimensional coordinates. But a difference between operation of scalar product for vectors and for complex numbers - are various. This circumstance also gives priority to CA methods. Properties of Contours. The sum of an EV of a closed contour is equal to zero. It is trivial - as the elementary vectors result in starting point, their sum is equal to a zero- vector. The contour- vector does not depend on parallel transposition of the source image. As the contour is encoded relative to starting point, this mode of coding is invariant to shift of an initial contour. Image turn on certain angle is equivalent to turn of each EV of a contour on the same angle. The starting point modification conducts to VC cycle shift. As EVs are encoded concerning the previous point, it is clear that at a modification of starting point, the sequence of an EV will be the same, but the first EV will be what begins in the starting point. The source image rescaling can be considered as multiplication of each EV of a contour to scale factor. Scalar Product of Contours. As scalar product of contours, . That is the number of the elementary vectors in contours should coincide. The scalar product of usual vectors and scalar product of complex numbers - differ. If we multiplied an EV as simple a vector, their scalar product would look so: Compare this formula to the formula (2) and you note that: Outcome of scalar product of vectors is the real number. And outcome of product of complex numbers - a complex number. The real part of scalar product of complex numbers coincides with scalar product of appropriate vectors. That is complex product includes vectorial scalar product. And now let's remember linear algebra. To be exact - physical sense and properties of scalar product. The scalar product is equal in the linear algebra to product of lengths of vectors on a cosine of the angle in between. It means that two perpendicular vectors will always have zero scalar product, collinear a vector - opposite, will give maximum value of scalar product. These properties of product allow to use it as a certain measure of closeness of vectors. If it is more - the less angle between vectors, the . For perpendicular vectors - it is lowered to zero, and further becomes negative for the vectors directed every which way. It appears, scalar product (1) also possesses similar properties. Let's introduce one more concept - the normalized scalar product (NSP): Where ? We recall physical sense of multiplication of complex numbers. At multiplication of complex numbers, their lengths are multiplied, and arguments (angles) - are added. The scale and turn is defined by a complex number . Thus, the real part a NSP will give us a cosine of the angle between contours, and the norm of NSP will be always equal to 1. Similarly, if we increase a VC by some real coefficient (scale) we also receive NSP=1 (it simply to see from the formula (4)). Note: Norm of NSP is invariant to transposition, rotation and scaling of contours. So, the norm of the normalized scalar product of contours gives unity only in the event that these two contours are equal to within turn and a scale. Otherwise, the norm of NSP it will be strict less unity. It is a central conclusion of a CA. Actually, the norm a NSP is an invariant on transposition, rotation and scaling of contours. If there are two identical contours their NSP always gives a unity, is not dependent on where contours are, what their angle of rotation and a scale. Similarly, if contours are various, their NSP will be strict less 1, and also independent of a place, rotation and a scale. Note: Norm of NSP is measure of contours closeness. The norm gives a measure of a likeness of contours, and argument a NSP (equal atan(b/a)) - gives us an angle of rotation of contours rather each other. Correlation Functions of Contours. In the previous chapter, we ascertained that the NSP is extremely useful formula for search of contours similar among themselves. Unfortunately, there is one circumstance not allowing to use it directly. And this circumstance - a starting point choice. The matter is that the equality (6) is reached only if starting points of contours - coincide. If contours are identical, but the EV reference begins with other starting point the norm the NSP of such contours will not be equal to a unity. The matter is that the equality (6) is reached only if starting points of contours - coincide. If contours are identical, but the EV reference begins with other starting point the norm the NSP of such contours will not be equal to a unity. Let's introduce the concept of intercorrelation function (ICF) of two contours: Where N(m) - a contour received from N by cycle shift by its EV on m of elements. For an example, if N = (n. N(1) = (n. 2, n. 3, n. N(2) = (n. 3, n. 4, n. What does intercorrelation function show? Values of this function show contours . Therefore us will interest values of this function only in limits from 0 to k- 1. Let's discover the magnitude having the maximum norm among values an ICF: From determinations a NSP and an ICF, it is clear that . The Autocorrelation function is an ICF for which N=. As a matter of fact is a scalar product of a contour most on itself at various shifts of starting point: Let's consider some properties an ACF: The ACF does not depend on a choice of starting point of a contour. Really, we look at determination of a scalar product (1). As we see, the starting point modification leads simply to a modification of the order of summable elements and does not result to a sum modification. This conclusion is not so obvious but if to ponder upon sense an ACF it is clear. The norm an ACF is symmetric concerning a central reference k/2. As the ACF is the total of pairwise products of an EV of a contour each pair meets two times on an interval from 0 to k. And recalling that for complex numbers (a, b) = (b, a)*, we receive that an ACF(1) = ACF(3)*, where * - a conjugate complex number sign. And as . For an example, we bring graphics an ACF for some contours. In pictures, the norm the ACF is represented by dark blue color (an ACF it is represented only for an interval from 0 to k/2). As we see, all contours, except last have symmetry to turn that the ACF leads to symmetry. The last contour of such symmetry has no, and the graph its ACF - is not symmetric. In a sense, it is possible to consider a contour ACF as characteristic of the shape of a contour. So, shapes, close to a circle have the uniform values of the norm an ACF (see a picture for a circle).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2017
Categories |