 # Geometry of the Hough transforms with applications to synthetic data

In the framework of the Hough transform technique to detect curves in images, we provide a bound for the number of Hough transforms to be considered for a successful optimization of the accumulator function in the recognition algorithm. Such a bound is consequence of geometrical arguments. We also show the robustness of the results when applied to synthetic datasets strongly perturbed by noise. An algebraic approach, discussed in the appendix, leads to a better bound of theoretical interest in the exact case.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## Introduction

The Hough transform is a standard technique for feature extraction used in image analysis and digital image processing. Such a technique was first used to detect straight lines in images

. It is based on the point-line duality as follows: points on a straight line, defined by an equation in the image plane with the usual natural parametrization, correspond to lines in the parameter space that intersect in a single point. This point uniquely identifies the coefficients in the equation of the original straight line (analogous procedures to detect circles and ellipses in images have been introduced in ). From a computational point of view, this result gives us a procedure to recognize straight lines in -dimensional images in which discontinuity regions in the image are highlighted through an edge detection algorithm; the parameter space is discretized in cells and an accumulator function is defined on it, whose maximum provides us with the parameters’ values that identify the line.

Thanks to algebraic geometrical arguments, the Hough transform definition has been extended to include special classes of curves [2, 12]. In , a characterization of families of irreducible algebraic plane curves of the same degree for which is defined a Hough-type correspondence is provided. In fact, given a family of algebraic curves, a general point in the image plane corresponds to an algebraic locus, , in the parameter space. The families such that, as varies on a given curve from , satisfy the regularity condition that the hypersurfaces meet in one and only one point (which in turn defines the curve ), are called Hough regular. This paper is a sequel of . Indeed, in  the Hough transform technique was performed for the automated recognition of cubic and quartic curves, and the accuracy of the detection was tested against synthetic data. Here, the aim is to reduce the amount of the dataset to be taken into account. Furthermore, the power of this procedure is then tested on -dimensional astronomical and medical real images in .

Let be a Hough regular family of algebraic plane curves . Let’s highlight here the steps of the standard recognition algorithm, of a given profile of interest in a real image, on which the Hough transform technique for such families of plane curves is founded. We refer to [2, Section 6], [12, Section 4], and also [14, Section 5] for complete details.

A pre-processing step of the algorithm consists of the application of a standard edge detection technique on the image (see  for a detailed description of this operator). This step reduces the number of points of interest highlighting the profile of which one has to compute the Hough transform. Then a discretization of the parameter space is required, which possibly exploits bounds on the parameter values computed by using either the Cartesian or the parametric form of the curve in the image space. A last step constructs the accumulator function after a discretization of the parameter space. The value of the accumulator in a cell of the discretized space corresponds to the number of times the Hough transforms of selected points of interest reach that cell. As a final outcome of the algorithm, the parameter values characterizing the curve best approximating the profile in the image space correspond to the parameter values identifying the cell where the accumulator function reaches its maximum.

Thus, in practice, the computational burden associated to the accumulator function computation and optimization leads to the need of reducing as most as possible the number of points of interest to be considered. By using classical geometrical arguments we provide in Proposition 2.4, and in an exact context, a bound which quite significantly decreases the number of Hough transforms of points making true the regularity condition . This suggests to significantly bound the number of Hough transforms to be considered to recognize curves in images. Indeed, such a bound applies quite efficiently in concrete examples, and it turns out to be quite robust both in presence of noisy background and against random perturbation of points’ locations, as shown in Section 4. This significantly enhances the results of [2, Section 6], with special regard to robustness in presence of noisy background.

A better understanding of the behavior of the equations defining the Hough transforms in the parameter space leads to a refinement of Proposition 2.4. This algebraic approach provides a much better bound, called (see Proposition A.4, Appendix A), which appears of purely theoretical interest since such a bound can be even too strong for practical purposes. Indeed, let be a curve from a family potentially approximating a profile . Since can be very small (for instance, in the examples provided in Appendix A), random perturbations of point’s locations on may produce a dataset of points not properly highlighting the profile .

The paper is organized as follows. In Section 1 we recall some background material. Section 2 is devoted to the proof of the bound mentioned above. We then provide several examples in Section 3. In Section 4, applications to synthetic data for four families of curves (the same considered in ) show the efficiency and the robustness of the result. Finally, our conclusions are offered in Section 5.

## 1 Preliminaries

Most of the results in this section hold over an infinite integral ring . However, unless otherwise specified, we restrict to the case of interest in the applications, assuming either or the fields of real or complex numbers.

For every -tuples of independent parameters , let

 fλ(x)=∑i1,…,inxi11…xinngi1…in(λ),0≤i1+⋯+in≤d, (1)

be a family of non-constant irreducible polynomials in the indeterminates , of a given degree (not depending on ), whose coefficients are the evaluation in of polynomials in a new series of indeterminates . Let , and let assume that is a hypersurface for each parameter belonging to a Euclidean open subset (of course, this is always the case if the base field is ). Clearly, if , such hypersurfaces are irreducible, that is, they consist of a single component, since the polynomials of the family are assumed to be irreducible in . If , the case of interest in the applications, we assume that is a real hypersurface, that is, a hypersurface over with a real -dimensional component in the affine space (see [4, Theorem 4.5.1] for explicit conditions equivalent to our assumption).

Since the polynomials are irreducible over , the zero loci are irreducible up to components of dimension , that is, they consist of a single -dimensional component (see [14, Remark 1.5] for related comments in the cases and , respectively).

So, we assume to be a family of irreducible hypersurfaces with possibly a finite set of lower dimensional components which share the degree.

###### Definition 1.1.

Let be a family of hypersurfaces as above, and let be a point in the image space . Let be the locus defined in the affine -dimensional parameter space by the polynomial equation

 fp(Λ)=∑i1,…,inx1(p)i1…xn(p)ingi1…in(Λ)=0,0≤i1+⋯+in≤d.

We say that is the Hough transform of the point with respect to the family . If no confusion will arise, we simply say that is the Hough transform of .

See also Appendix A for more details on degree and dimension of the Hough transform.

Summarizing, the polynomials family defined by (1) leads to a polynomial whose evaluations at points and give back the equations of and , respectively. That is,

 Hλ:F(x;λ)=fλ(x)=0andΓp(F):F(p;Λ)=fp(Λ)=0.

And, clearly, the following “duality condition” holds true:

 p∈Hλ⟺fλ(x1(p),…,xn(p))=F(x1(p),…,xn(p);λ1,…,λt)=0⟺λ∈Γp(F). (2)

One may note that one classically refers to the variety defined by the polynomial as incidence correspondence, or incidence variety. It consists of the pairs of points such that or, equivalently, . In particular, denoting by , the restrictions to of the product projections , on the two factors, one has and, similarly, (see also ).

The following general facts hold true (see [2, Theorem 2.2, Lemma 2.3], [3, Section 3]).

1. The Hough transforms , when the point varies on , all pass through the point .

2. Assume that the Hough transforms , when varies on , have a point in common other than , say . Thus the two hypersurfaces , coincide.

3. (Regularity property) The following conditions are equivalent:

1. For any hypersurfaces , in , the equality implies .

2. For each hypersurface in , one has .

A family which meets one of the above equivalent conditions (a), (b) is said to be Hough regular.

From now on throughout the paper, we consider the case . Let , and let be a family of irreducible real curves in the image plane , of equation

 fλ(x,y)=d∑i,j=0xiyjgij(λ),0≤i+j≤d, (3)

and satisfying the assumptions and the properties mentioned above (in particular, the ’s are affine plane curves over with infinitely many points in the affine plane over , see also [16, Chapter 7]).

Given a profile of interest in the image plane, the Hough approach detects a curve from the family

best approximating the profile by using well-established pattern recognition techniques for the recognition of curves in images (see

[2, Sections 6, 7] and also [12, Sections 4, 5]). From a theoretical point of view, the detection procedure can be highlighted as follows.

1. Choose a set of points ’s of interest in the image plane .

2. In the parameter space find the intersection of the Hough transforms corresponding to the points ’s. That is, compute which identifies a (unique) point, .

3. Return the curve uniquely determined by the parameter .

Because of the presence of noise and approximations (due to the floating point numbers representation encoding the real coordinates) of the points ’s extracted from a digital image, and consequently on their Hough transforms , in practice in most cases it happens that ; though we notice that there are regions in the parameter space with high density of Hough transform crossings. Therefore, from a practical point of view, Step II is usually performed using the so called “voting procedure”, a discretization approach that consists of the following three steps.

• Find a proper discretization of a suitable bounded region contained in the open set of the parameter space.

• Construct on an accumulator function, that is, a function that, for each Hough transform and for each cell of the discretized region, records and sums the “vote” , if crosses the cell, and the “vote” otherwise.

• Look for the cell associated to the maximum, say , of the accumulator function; as suggested by the general results recalled above, the center of that cell is an approximation of the coordinates of the intersection point (see [2, Section 6] and [12, Section 4]). Of course, such an approximation is determined up to the chosen discretization of .

Furthermore, in practice, Step I is performed by using a finite number of points of interest. Then it is natural to ask, even from a theoretical point of view, how many points are sufficient to uniquely identify .

### 1.1 Reduction to a finite intersection

Let be a curve from the family . In general, note that any (infinite) intersection clearly reduces to a finite intersection of the same type. This simply because is a Noetherian ring (since or is Noetherian, it follows from the Hilbert basis theorem), so that, since every ascending chain of ideals in is eventually stationary (e.g., see ), the ideal generated by the polynomials defining the Hough transforms , , has a finite number, say , of generators of “Hough transform type” (and, clearly, a minimal finite number, say , of generators not necessarily of this type we are looking for). The natural question this raises is:

In the exact case, minimize the number of points ’s belonging to a curve from the family such that

 T=⋂pj∈Cλ,j∈JΓpj(F),

with belonging to a finite set of indices. Coming to real applications, this may significantly reduce the time-consuming step of the recognition algorithm (see [12, Section 4] and also [18, Section 5]), as shown in Section 4. Clearly, whenever the family is Hough regular.
Forgetting about the regularity property, one may ask whether for any belonging to . For instance, in the case of families of real plane curves, we may ask if any point in identifies the curve to be detected, this way extending the general fact II as in the detection procedure highlighted above (compare with Proposition 2.4).

## 2 A geometrical bound

From now on throughout the paper, we consider the real case we are interested in. Let , , , be a family of real plane curves in of equation (3). By simplicity of notation, for families of curves in with parameters we set and , so that and will denote the parameter space, respectively.

Consider the projective closure of in the complex projective plane of equation

 ¯¯¯¯¯Cλ:fλ(x0,x1,x2)=0,

where is the homogenization of with respect to , obtained by setting , . Note that is still an irreducible curve of degree , since is irreducible over . We observe that the family is contained in a linear (or algebraic) system of curves.

###### Definition 2.1.

We say that the set is the base locus of the family of projective curves in . We define

 Baff={p∈A2(x,y)(C)|p∈Cλ∀λ∈U}andB∞={p∈ℓ∞:x2=0|p∈¯¯¯¯¯Cλ∀λ∈U},

where is the line at infinity.

Clearly, . We note that, under the irreducibility assumption on the curves from the family , both and consist of a finite number of points; we respectively denote by and the number of points of such sets. In particular, .

As far as the Hough transform is concerned, note also that for each real point . Hence, in practical applications, one has to disregard the (real) points .

Let us point out the (although obvious) fact that whenever for some points , in the image space, then for each the curve , which contains the point , has to pass through as well.222For practical purposes, whenever , then one of the two points , is disregarded from the context.

First, let us consider the special (though relevant) case when the parameters linearly occur in equation .

###### Lemma 2.2.

Let be a family of real curves of degree in . Assume that the polynomial expressions as in are linear in the parameters . Let . Then the following conditions are equivalent:

1. For any curve from the family there exist real points such that the equations defining the Hough transforms in the parameter space are linearly independent, .

2. The family is Hough regular and .

###### Proof.

The defining equations of the set give rise to a linear system of equations in variables , all of them vanishing at . By the assumption that the equations , , are linearly independent, the rank of the matrix associated to the system equals , whence , so that is Hough regular by the equivalent condition (b) of the regularity property.

Arguing by contradiction, assume that there exists a curve from the family such that for any points the equations defining the Hough transforms , , are linearly dependent. Then they give rise to a linear system of equations in variables with infinitely many real solutions. Let one of them. By duality condition (2) it then follows that , whence . Thus, passing to the projective closures, one has . Therefore, restricting to the affine plane , it must be in , whence in since the two curves are real. This contradicts the Hough regularity assumption. ∎

The following example shows that the assumption on the defining equations to be linearly independent in statement of the above lemma is needed.

###### Example 2.3.

Consider the family of cubic curves of equation

 Ca,b:y2=x3+ax+b,

for real parameters . Take the cubic , , and the points , on . Then , so that the set coincides with the line in the parameter plane . Moreover, for , this showing that given does not follow that .

Let us consider now the general case. A simple geometrical argument, based on Bézout theorem, leads to a natural finite bound. Even though it is not sharp, as the examples in Section 3 show, it looks of interest for practical purposes (see Section 4, and also [5, Section 2]).

###### Proposition 2.4.

Let be a family of real curves of degree in . Let be the base locus of the associated family of projective curves in , and set . For any curve from the family take arbitrarily chosen real distinct points , . Let , and set . Then:

1. for each .

2. .

3. If the family is Hough regular, then .

###### Proof.

For a given (real) point , consider the curves , . Since , duality condition (2) assures that , . It thus follows that the projective closure curves , in the complex projective plane (which have in common the points of the base set ) meet in at least

 νopt+#B(C)=d2−#B(C)+1+#B(C)=d2+1

(distinct) points of . On the other hand, the assumptions that the family consists of irreducible curves sharing the degree implies that the curves , don’t have common components. Thus, Bézout’s theorem (see e.g. [1, §4.2]) allows us to conclude that . Therefore, restricting to the affine plane , it must be in , whence in since the two curves are real. This proves the first assertion.

In order to prove the second assertion, we only have to prove the inclusion . If this is clear, since by duality condition (2). Now, let’s consider the case . By contradiction, we assume that there exists , with , such that . Therefore, there exists a point such that . By duality condition (2) this is equivalent to say that , contradicting assertion .

Finally, assuming Hough regularity for the family , it then follows , whence , which completes the proof. ∎

###### Example 2.5.

Consider in the family of conics of equation

 a(x2+y2+1)+b(x2+x+y)=0,

for real parameters . Since , are defined up to a non-zero constant, the family is in fact a pencil of conics. We then have , so that . This means that, for each single point taken on a fixed conic of the pencil, one has

 Topt=Γp(F):(x2p+y2p+1)A+(x2p+xp+yp)B=0.

Therefore, by Proposition 2.4(1), for any belonging to the line one has . This agrees with the fact that the family is clearly not Hough regular, since for each .

## 3 Examples of interest

In this section we provide the examples we come back on in next Section 4. Such examples belong to classes of curves of interest in astronomical and medical imaging, and widely used in recent literature to best approximate bone profiles and typical solar structures such as coronal loops (for instance, see [2, 12, 13]). These families of curves mainly come from atlas of plane curves as , as well as from knowledge of classical tools in algebraic geometry.

We use the notation as in the previous sections. Moreover, for a point in the image plane , we denote by its homogeneous coordinates in the real projective plane .

###### Example 3.1.

(Descartes Folium) Consider the family of cubic rational curves defined by the equation

 Ca,b:3axy−x3−by3=0, (4)

for some real parameters , such that (for , such a cubic is classically known as the Descartes Folium). Such a curve has a node at the origin and a loop in the first (respectively, second) quadrant if (respectively, ) (see also [2, Section 3] for a more detailed description).

Passing to homogeneous coordinates we have

 ¯¯¯¯¯¯¯¯Ca,b:3ax0x1x2−x30−bx31=0.

The base locus of the family consists of the points such that the polynomial

 3ax0(p)x1(p)x2(p)−x0(p)3−bx1(p)3

is identically zero in . Then if and only if it is a solution of the system

 x0x1x2=x30=x31=0,

so that . Therefore the bound from Proposition 2.4 becomes

 νopt=d2−#B(C)+1=9−1+1=9.

On the other hand, according to Lemma 2.2, for any pair of points , , one has in fact

 Γp1(F)∩Γp2(F)={λ}

as soon as the equations , are linearly independent.

###### Example 3.2.

(Elliptic curves) Consider the family of unbounded cubic curves of equation

 Ca,b,m:y2=mx3+ax+b, (5)

for non-zero real parameters , , . Non-singular curves from the family have genus and are called elliptic curves. For , one refers to equation (5) as the Weierstrass equation of the curve (see [12, §3.2]).

For any point , the Hough transform is the plane , in the parameter space , of equation

 fp(A,B,M):xpA+B+x3pM−y2p=0.

Let and take the points , on the curve . Then is the line in , which contains the point . Among the curves corresponding to the point , choose for instance . One then sees that and , meet in exactly six points (pairwise symmetric to the -axis) in the image plane .

According to Lemma 2.2, as soon as one takes a third point on such that the equations , , are linearly independent (in particular, since ) one gets

 Γp1(F)∩Γp2(F)∩Γp3(F)={λ}.
###### Example 3.3.

(Quartic curve with a triple point) Consider the family of quartic curves defined by the equation

 Ca,b:y(x−ay)2−b(x2+y2)2=0, (6)

for real parameters , with . The curve

has a triple point at the origin, so it is a rational curve. As to the variance, the curve

is contained in the semi-circumference with center and radius (see [2, §4.1 and Section 7]). Passing to homogeneous coordinates we have

 ¯¯¯¯¯¯¯¯Ca,b:x1(x0−ax1)2x2−b(x20+x21)2=0.

The base locus of the family consists of the points such that

 a2x1(p)3x2(p)−2ax0(p)x21(p)x2(p)−b(x0(p)2+x1(p)2)2+x1(p)x0(p)2x2(p)

is an identically zero polynomial in . Then if and only if it is a solution of the system

 x21x2=x0x21x2=(x20+x21)2=x1x20x2=0,

so that . Therefore the bound from Proposition 2.4 becomes

 νopt=d2−#B(C)+1=16−3+1=14.
###### Example 3.4.

(Quartic curve with a tacnode) Consider the family of quartic curves defined by the equation

 Ca,b:y2(x−a)2−byx2+x4=0, (7)

for real parameters , with . The curve has a cusp at the origin , with cuspidal tangent the line and intersection multiplicity (such a singularity is called a tacnode) and one more singular point at the infinity, so it is a rational curve.

The real points of such curves present a single closed loop and a loop closed at the infinity (see [2, §4.3 and Section 7]). Passing to homogeneous coordinates we have

 ¯¯¯¯¯¯¯¯Ca,b:x21(x0−ax2)2−bx1x20x2+x40=0.

The base locus of the family consists of the points such that the polynomial

 a2x1(p)2x2(p)2−2ax0(p)x1(p)2x2(p)−bx0(p)2x1(p)x2(p)+x0(p)4+x0(p)2x1(p)2=0

is identically zero in . Then if and only if it is a solution of the system

 x31x22=x0x21x2=x20x1x2=x40+x20x21=0,

so that . Therefore the bound from Proposition 2.4 becomes

 νopt=d2−#B(C)+1=16−4+1=13.

## 4 Applications to synthetic data

In this section we show the efficiency of the bound discussed in Section 2 for four families of curves considered in . In particular, we show the robustness of the results when applied to dataset strongly perturbed by noise. We keep the same notation as in [2, Section 6].

From now on, we consider the following set of curves selected from four families: the Descartes Folium of equation (4) with , , the elliptic curve of equation (5) with , , the quartic curve with triple point of equation (6) with , ; and the quartic curve with tacnode of equation (7) with , . These are exactly the same curves considered in [2, Section 6]; from now on, we also refer to them as “the given curves”. As stated in Section 1, for a successful recognition of the given curves, we need to find the intersection of the Hough transforms in order to identify The voting procedure requires some steps: first of all, we need to bound the parameter space, selecting minimum and maximum values for the parameters to be considered. In the following we indicate these values with , , , and for and , respectively. Then, we discretize the region in the parameter space, choosing the cell size along the axis, and the cell size along the axis. The number of cells along the axis of the parameter space is then computed as:

 Na=⌊amax−aminδa⌋,

and an analogous formula holds for

All the values considered in the four cases are collected in Table 1. The parameter spaces are built in such a way that each of them contains a cell corresponding to the pair employed to select the curves. In this way, we can achieve an exact recognition, where the error between the original parameters and the recognized ones is equal to zero. Further, it is worth noting that to make the comparison with the results presented in  more reliable, in the four cases under consideration we have sampled the same regions of the plane and considered the same discretizations of the parameter spaces, as previously done in .