0% found this document useful (0 votes)
68 views13 pages

Corner Detection: 7.1 Points of Interest

Uploaded by

Amjad Saeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views13 pages

Corner Detection: 7.1 Points of Interest

Uploaded by

Amjad Saeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

7

Corner Detection

Corners are prominent structural elements in an image and are there-


fore useful in a wide variety of applications, including following ob-
jects across related images (tracking), determining the correspon-
dence between stereo images, serving as reference points for precise
geometrical measurements, and calibrating camera systems for ma-
chine vision applications. Thus corner points are not only important
in human vision but they are also “robust” in the sense that they
do not arise accidentally in 3D scenes and, furthermore, can be lo-
cated quite reliably under a wide range of viewing angles and lighting
conditions.

7.1 Points of Interest


Despite being easily recognized by our visual system, accurately and
precisely detecting corners automatically is not a trivial task. A
good corner detector must satisfy a number of criteria, including
distinguishing between true and accidental corners, reliably detecting
corners in the presence of realistic image noise, and precisely and
accurately determining the locations of corners. Finally, it should
also be possible to implement the detector efficiently enough so that
it can be utilized in real-time applications such as video tracking.
Numerous methods for finding corners or similar interest points
have been proposed and most of them take advantage of the following
basic principle. While an edge is usually defined as a location in the
image at which the gradient is especially high in one direction and low
in the direction normal to it, a corner point is defined as a location
that exhibits a strong gradient value in multiple directions at the
same time.
Most methods take advantage of this observation by examining
the first or second derivative of the image in the x and y directions to
find corners (e.g., [77,102,137,154]). In the next section, we describe
in detail the Harris detector, also known as the “Plessey feature point
detector” [102], since it turns out that even though more efficient
147
© Springer-Verlag London 2016
W. Burger, M.J. Burge, Digital Image Processing, Texts in Computer Science,
DOI 10.1007/978-1-4471-6684-9_7
7 Corner Detection detectors are known (see, e.g., [210, 220]), the Harris detector, and
other detectors based on it, are the most widely used in practice.

7.2 Harris Corner Detector


This operator, developed by Harris and Stephens [102], is one of a
group of related methods based on the same premise: a corner point
exists where the gradient of the image is especially strong in more
than one direction at the same time. In addition, locations along
edges, where the gradient is strong in only one direction, should not
be considered as corners, and the detector should be isotropic, that
is, independent of the orientation of the local gradients.

7.2.1 Local Structure Matrix

The Harris corner detector is based on the first partial derivatives


(gradient) of the image function I(u, v), that is,

∂I ∂I
Ix (u, v) = (u, v) and Iy (u, v) = (u, v). (7.1)
∂x ∂y

For each image position (u, v), we first calculate the three quantities

A(u, v) = Ix2 (u, v), (7.2)


B(u, v) = Iy2 (u, v), (7.3)
C(u, v) = Ix (u, v) · Iy (u, v) (7.4)

that constitute the elements of the local structure matrix M(u, v):1
! 2 " ! "
Ix Ix Iy AC
M= = . (7.5)
Ix Iy Iy2 CB

Next, each of the three scalar fields A(u, v), B(u, v), C(u, v) is indi-
vidually smoothed by convolution with a linear Gaussian filter H G,σ
(see Sec. 5.2.7),
! " ! "
A ∗ HσG C ∗ HσG Ā C̄
M̄ = = . (7.6)
C ∗ HσG B ∗ HσG C̄ B̄

The eigenvalues 2 of the matrix M̄, defined as3


(
trace(M̄)  trace(M̄) 2
λ1,2 = ± − det(M̄)
2 2 (7.7)
1   
= · Ā + B̄ ± Ā2 − 2 · Ā · B̄ + B̄ 2 + 4 · C̄ 2 ,
2
1
For improved legibility, we simplify the notation used in the following
by omitting the function coordinates (u, v); for example, the function
Ix (u, v) is abbreviated as Ix or A(u, v) is simply denoted A etc.
2
See also Sec. B.4 in the Appendix.
3
det(M̄) denotes the determinant and trace(M̄) denotes the trace of the
matrix M̄ (see, e.g., [35, pp. 252 and 259]).
148
are (because the matrix is symmetric) positive and real. They contain 7.2 Harris Corner
essential information about the local image structure. Within an Detector
image region that is uniform (that is, appears flat), M̄ = 0 and
therefore λ1 = λ2 = 0. On an ideal ramp, however, the eigenvalues
are λ1 > 0 and λ2 = 0, independent of the orientation of the edge.
The eigenvalues thus encode an edge’s strength, and their associated
eigenvectors correspond to the local edge orientation.
A corner should have a strong edge in the main direction (cor-
responding to the larger of the two eigenvalues), another edge nor-
mal to the first (corresponding to the smaller eigenvalues), and both
eigenvalues must be significant. Since Ā, B̄ ≥ 0, we can assume that
trace(M̄) > 0 and thus |λ1 | ≥ |λ2 |. Therefore
 only the smaller of
the two eigenvalues, λ2 = trace(M̄)/2 − . . . , is relevant when
determining a corner.

7.2.2 Corner Response Function (CRF)

From Eqn. (7.7) we see that the difference between the two eigenval-
ues of the local structure matrix is
%  2
λ1 − λ2 = 2 · 0.25 · trace(M̄) − det(M̄), (7.8)

where the expression under the square root is always non-negative.


At a good corner position, the difference between the two eigenvalues
λ1 , λ2 should be as small as possible and thus the expression under
the root in Eqn. (7.8) should be a minimum. To avoid the explicit cal-
culation of the eigenvalues (and the square root) the Harris detector
defines the function
 2
Q(u, v) = det(M̄(u, v)) − α · trace(M̄(u, v)) (7.9)
= Ā(u, v) · B̄(u, v) − C̄ 2 (u, v) − α · [Ā(u, v) + B̄(u, v)]2

as a measure of “corner strength”, where the parameter α determines


the sensitivity of the detector. Q(u, v) is called the “corner response
function” and returns maximum values at isolated corners. In prac-
tice, α is assigned a fixed value in the range of 0.04 to 0.06 (max.
0.25 = 14 ). The larger the value of α, the less sensitive the detector
is and the fewer corners detected.

7.2.3 Determining Corner Points

An image location (u, v) is selected as a potential candidate for a


corner point if
Q(u, v) > tH ,
where the threshold tH is selected based on image content and typi-
cally lies within the range of 10,000 to 1,000,000. Once selected, the
corners ci = ui , vi , qi  are inserted into the sequence

C = (c1 , c2 , . . . , cN ),

which is then sorted in descending order (i.e., qi ≥ qi+1 ) according to


corner strength qi = Q(ui , vi ), as defined in Eqn. (7.9). To suppress
149
7 Corner Detection Prefilter (Alg. 7.1, line 2–3): Smoothing with a small xy-separable
filter Hp = Hpx ∗ Hpy , where ) *
Table 7.1
2
Harris corner detector—typical 1   1
parameter settings for Alg. 7.1. Hpx = · 2 5 2 and Hpy = Hpx = · 5 .
9 9
2

Gradient filter (Alg. 7.1, line 3): Computing the first partial
derivative in the x and y directions with ) *
 −0.5

hdx = −0.5 0 0.5 and hdy = hdx = 0 .
0.5

Blur filter (Alg. 7.1, line 10): Smoothing the individual components
of the structure matrix M with separable Gaussian filters
Hb = Hbx ∗ Hby with ⎡1⎤
⎢6⎥
⎢15⎥
1  1 ⎢ ⎥
· ⎢20⎥

hbx = · 1 6 15 20 15 6 1 and hby = hbx = ⎥.
64 64 ⎢⎢15⎥
⎣ ⎦
6
1

Control parameter (Alg. 7.1, line 14): α = 0.04, . . . , 0.06 (default


0.05).
Response threshold (Alg. 7.1, line 19): tH = 10 000, . . . , 1 000 000
(default 20 000).
Neighborhood radius (Alg. 7.1, line 37): dmin = 10 Pixel.

the false corners that tend to arise in densely packed groups around
true corners, all except the strongest corner in a specified vicinity
are eliminated. To accomplish this, the list C is traversed from the
front to the back, and the weaker corners toward the end of the list,
which lie in the surrounding neighborhood of a stronger corner, are
deleted.
The complete algorithm for the Harris detector is summarized
again in Alg. 7.1; the associated parameters are listed in Table 7.1.

7.2.4 Examples

Figure 7.1 uses a simple synthetic image to illustrate the most impor-
tant steps in corner detection using the Harris detector. The figure
shows the result of the gradient computation,
A C the three components
of the structure matrix M(u, v) = C B , and the values of the cor-
ner response function Q(u, v) for each image position (u, v). This
example was calculated with the standard settings as given in Table
7.1.
The second example (Fig. 7.2) illustrates the detection of corner
points in a grayscale representation of a natural scene. It demon-
strates how weak corners are eliminated in favor of the strongest
corner in a region.

150
1: HarrisCorners(I, α, tH , dmin ) 7.2 Harris Corner
Input: I, the source image; α, sensitivity parameter (typ. 0.05); Detector
tH , response threshold (typ. 20 000); dmin , minimum distance
between final corners. Returns a sequence of the strongest corners Alg. 7.1
Harris corner detector. This al-
detected in I. gorithm takes an intensity im-
age I and creates a sorted list
Step 1 – calculate the corner response function: of detected corner points. ∗ is
2: Ix ← (I ∗ hpx ) ∗ hdx  horizontal prefilter and derivative the convolution operator used
for linear filter operations. De-
3: Iy ← (I ∗ hpy ) ∗ hdy  vertical prefilter and derivative tails for the parameters Hp ,
Hdx , Hdy , Hb , α, and tH can
4: (M, N ) ← Size(I) be found in Table 7.1.
5: Create maps A, B, C, Q : M × N → R
6: for all image coordinates (u, v) do  C
Compute the local structure matrix M = A
C B :
7: A(u, v) ← (Ix (u, v))2
8: B(u, v) ← (Iy (u, v))2
9: C(u, v) ← Ix (u, v) · Iy (u, v)
Blur the components of the local structure matrix (M̄):
10: Ā ← A ∗ Hb
11: B̄ ← B ∗ Hb
12: C̄ ← C ∗ Hb
13: for all image coordinates (u, v) do  calc. corner response:
14: Q(u, v) ← Ā(u, v)· B̄(u, v)− C̄ 2 (u, v)−α·[Ā(u, v)+ B̄(u, v)]2
Step 2 – collect the corner points:
15: C←()  start with an empty corner sequence
16: for all image coordinates (u, v) do
17: if Q(u, v) > tH ∧ IsLocalMax(Q, u, v) then
18: c ← u, v, Q(u, v)  create a new corner c
19: C ← C  (c)  add c to corner sequence C
20: Cclean ← CleanUpCorners(C, dmin )
21: return Cclean
22: IsLocalMax(Q, u, v)  determine if Q(u, v) is a local maximum
23: N ← GetNeighbors(Q, u, v)  se below
24: return Q(u, v) > max(N )  true or false

25: GetNeighbors(Q, u, v)
Returns the 8 neighboring values around Q(u, v).
26: N ← (Q(u+1, v), Q(u+1, v−1), Q(u, v−1), Q(u − 1, v−1),
Q(u−1, v), Q(u−1, v+1), Q(u, v+1), Q(u+1, v+1))
27: return N
28: CleanUpCorners(C, dmin )
29: Sort(C)  sort C by desc. qi (strongest corners first)
30: Cclean ← ( )  empty “clean” corner sequence
31: while C is not empty do
32: c0 ← GetFirst(C)  get the strongest corner from C
33: C ← Delete(c0 , C)  the 1st element is removed from C
34: Cclean ← Cclean  (c0 )  add c0 to Cclean
35: for all cj in C do
36: if Dist(c0 , cj ) < dmin then
37: C ← Delete(cj , C)  remove element cj from C
38: return Cclean

151
7 Corner Detection
Fig. 7.1
Harris corner detector—
Example 1. Starting with the
original image I(u, v), the first
derivative is computed, and
then from it the components of
the structure matrix M(u, v),
with A(u, v) = Ix2 (u, v), B =
Iy2 (u, v), C = Ix (u, v) · Iy (u, v).
A(u, v) and B(u, v) represent,
respectively, the strength of
the horizontal and vertical
edges. In C(u, v), the values
are strongly positive (white) or
strongly negative (black) only
where the edges are strong in
I(u, v) A = Ix2 (u, v)
both directions (null values
are shown in gray). The cor-
ner response function, Q(u, v),
exhibits noticeable positive
peaks at the corner positions.

B = Iy2 (u, v) C = Ix Iy (u, v)

Q(u, v) Corner points

7.3 Implementation
Since the Harris detector algorithm is more complex than the al-
gorithms we presented earlier, in the following sections we explain
its implementation in greater detail. While reading the following
you may wish to refer to the complete source code for the class
HarrisCornerDetector, which is available online as part of the
imagingbook library.4
4
Package imagingbook.pub.corners.
152
7.3 Implementation
Fig. 7.2
Harris corner detector—
Example 2. A complete result
with the final corner points
marked (a). After selecting the
strongest corner points within
a 10-pixel radius, only 335 of
the original 615 candidate cor-
ners remain. Details before
(b, c) and after selection (d, e).

(a)

(b) (c)

(d) (e)

7.3.1 Step 1: Calculating the Corner Response Function

To handle the range of the positive and negative values generated by


the filters used in this step, we will need to use floating-point images
to store the intermediate results, which also assures sufficient range
and precision for small values. The kernels of the required filters,
that is, the presmoothing filter Hp , the gradient filters Hdx , Hdy ,
and the smoothing filter for the structure matrix Hb , are defined as
1D float arrays:
1 float[] hp = {2f/9, 5f/9, 2f/9};
153
7 Corner Detection 2 float[] hd = {0.5f, 0, -0.5f};
3 float[] hb =
4 {1f/64, 6f/64, 15f/64, 20f/64, 15f/64, 6f/64, 1f/64};

From the original 8-bit image (of type ByteProcessor), we first cre-
ate two copies, Ix and Iy, of type FloatProcessor:
5 FloatProcessor Ix = I.convertToFloatProcessor();
6 FloatProcessor Iy = I.convertToFloatProcessor();

The first processing step is to presmooth the image with the 1D


filter kernel hp (= hpx = hpy , see Alg. 7.1, line 2). Subsequently
the 1D gradient filter hd (= hdx = hdy ) is used to calculate the
horizontal and vertical derivatives (see Alg. 7.1, line 3). To perform
the convolution with the corresponding 1D kernels we use the (static)
methods convolveX() and convolveY() defined in class Filter:5
7 Filter.convolveX(Ix, hp); // Ix ← Ix ∗ hpx
8 Filter.convolveX(Ix, hd); // Ix ← Ix ∗ hdx
9 Filter.convolveY(Iy, hp); // Iy ← Iy ∗ hpy
10 Filter.convolveY(Iy, hd); // Iy ← Iy ∗ hdy

Now the components A(u, v), B(u, v), C(u, v) of the structure matrix
M are calculated for all image positions (u, v):
11 A = ImageMath.sqr(Ix); // A(u, v) ← Ix2 (u, v)
12 B = ImageMath.sqr(Iy); // B(u, v) ← Iy2 (u, v)
13 C = ImageMath.mult(Ix, Iy); // C(u, v) ← Ix (u, v) · Iy (u, v)
14

The components of the structure matrix are then smoothed with a


separable filter kernel Hb = hbx ∗ hby :
15 Filter.convolveXY(A, hb); // A ← (A ∗ hbx ) ∗ hby
16 Filter.convolveXY(B, hb); // B ← (B ∗ hbx ) ∗ hby
17 Filter.convolveXY(C, hb); // C ← (C ∗ hbx ) ∗ hby

The variables A, B, C of type FloatProcessor are declared in the


class HarrisCornerDetector. sqr() and mult() are static methods
of class ImageMath for squaring an image and multiplying two images,
respectively. The method convolveXY(I, h) is used to apply a x/y-
separable 2D convolution with the 1D kernel h to the image I.
Finally, the corner response function (Alg. 7.1, line 14) is calcu-
lated by the method makeCrf() and a new image (of type Float-
Processor) is created:
18 private FloatProcessor makeCrf(float alpha) {
19 FloatProcessor Q = new FloatProcessor(M, N);
20 final float[] pA = (float[]) A.getPixels();
21 final float[] pB = (float[]) B.getPixels();
22 final float[] pC = (float[]) C.getPixels();
23 final float[] pQ = (float[]) Q.getPixels();
24 for (int i = 0; i < M * N; i++) {
25 float a = pA[i], b = pB[i], c = pC[i];
26 float det = a * b - c * c; // det(M̄)
27 float trace = a + b; // trace(M̄)
28 pQ[i] = det - alpha * (trace * trace);
5
Package imagingbook.lib.image.
154
29 } 7.3 Implementation
30 return Q;
31 }

7.3.2 Step 2: Selecting “Good” Corner Points


The result of the first stage of Alg. 7.1 is the corner response func-
tion Q(u, v), which in our implementation is stored as a floating-point
image (FloatProcessor). In the second stage, the dominant corner
points are selected from Q. For this we need (a) an object type to
describe the corners and (b) a flexible container, in which to store
these objects. In this case, the container should be a dynamic data
structure since the number of objects to be stored is not known be-
forehand.

The Corner class


Next we define a new class Corner6 to represent individual corner
points c = x, y, q and a single constructor (in line 35) with float
parameters x, y for the position and corner strength q:
32 public class Corner implements Comparable<Corner> {
33 final float x, y, q;
34
35 public Corner (float x, float y, float q) {
36 this.x = x;
37 this.y = y;
38 this.q = q;
39 }
40
41 public int compareTo (Corner c2) {
42 if (this.q > c2.q) return -1;
43 if (this.q < c2.q) return 1;
44 else return 0;
45 }
46 ...
47 }

The class Corner implements Java’s Comparable interface, such that


objects of type Corner can be compared with each other and thereby
sorted into an ordered sequence. The compareTo() method required
by the Comparable interface is defined (in line 41) to sort corners by
descending q values.

Choosing a suitable container


In Alg. 7.1, we used the notion of a sequence or lists to organize
and manipulate the collections of potential corner points generated
at various stages. One solution would be to utilize arrays, but since
the size of arrays must be declared before they are used, we would
have to allocate memory for extremely large arrays in order to store
all the possible corner points that might be identified. Instead, we
make use of the ArrayList class, which is one of many dynamic data
structures conveniently provided by Java’s Collections Framework.7
6
Package imagingbook.pub.corners.
7
Package java.util.
155
7 Corner Detection The collectCorners() method
The method collectCorners() outlined here selects the dominant
corner points from the corner response function Q(u, v). The param-
eter border specifies the width of the image’s border, within which
corner points should be ignored.
48 List<Corner> collectCorners(FloatProcessor Q, float tH, int
border) {
49 List<Corner> C = new ArrayList<Corner>();
50 for (int v = border; v < N - border; v++) {
51 for (int u = border; u < M - border; u++) {
52 float q = Q.getf(u, v);
53 if (q > tH && isLocalMax(Q, u, v)) {
54 Corner c = new Corner(u, v, q);
55 C.add(c);
56 }
57 }
58 }
59 return C;
60 }

First (in line 49), a new instance of ArrayList8 is created and as-
signed to the variable C. Then the CRF image Q is traversed, and
when a potential corner point is located, a new Corner is instan-
tiated (line 54) and added to C (line 55). The Boolean method
isLocalMax() (defined in class HarrisCornerDetector) determines
if the 2D function Q is a local maximum at the given position u, v:
61 boolean isLocalMax (FloatProcessor Q, int u, int v) {
62 if (u <= 0 || u >= M - 1 || v <= 0 || v >= N - 1) {
63 return false;
64 }
65 else {
66 float[] q = (float[]) Q.getPixels();
67 int i0 = (v - 1) * M + u;
68 int i1 = v * M + u;
69 int i2 = (v + 1) * M + u;
70 float q0 = q[i1];
71 return // check 8 neighbors of q0:
72 q0 >= q[i0 - 1] && q0 >= q[i0] && q0 >= q[i0 + 1] &&
73 q0 >= q[i1 - 1] && q0 >= q[i1 + 1]
&&
74 q0 >= q[i2 - 1] && q0 >= q[i2] && q0 >= q[i2 + 1] ;
75 }
76 }

7.3.3 Step 3: Cleaning up

The final step is to remove the weakest corners in a limited area


where the size of this area is specified by the radius dmin (Alg. 7.1,
lines 29–38). This process is outlined in Fig. 7.3 and implemented by
the following method cleanupCorners().
8
The specification ArrayList<Corner> indicates that the list C may only
contain objects of type Corner.
156
C 7.3 Implementation
c3 c1
c0 c1 c2 c3 c4 c5 c6 c7 c8 c9
c6 Fig. 7.3
dmin c5 Selecting the strongest corners
c9 within a given spatial distance.
c0 (a) Sample corner positions in
Cclean the 2D plane. (b) The origi-
c4 c8 nal list of corners (C) is sorted
c7 c0 by “corner strength” (q) in
c2 descending order; that is, c0
is the strongest corner. First,
(a) (b) corner c0 is added to a new
list Cclean , while the weaker
corners c4 and c8 (which are
both within distance dmin
77 List<Corner> cleanupCorners(List<Corner> C, double dmin) { from c0 ) are removed from the
78 double dmin2 = dmin * dmin; original list C. The following
corners c1 , c2 , . . . are treated
79 // sort corners by descending q-value: similarly until no more ele-
80 Collections.sort(C); ments remain in C. None of
81 // we use an array of corners for efficiency reasons: the corners in the resulting
list Cclean is closer to another
82 Corner[] Ca = C.toArray(new Corner[C.size()]); corner than dmin .
83 List<Corner> Cclean = new ArrayList<Corner>(C.size());
84 for (int i = 0; i < Ca.length; i++) {
85 Corner c0 = Ca[i]; // get next strongest corner
86 if (c0 != null) {
87 Cclean.add(c0);
88 // delete all remaining corners cj too close to c0:
89 for (int j = i + 1; j < Ca.length; j++) {
90 Corner cj = Ca[j];
91 if (cj != null && c0.dist2(cj) < dmin2)
92 Ca[j] = null; //delete corner cj from Ca
93 }
94 }
95 }
96 return Cclean;
97 }

Initially (in line 80) the corner list C is sorted by decreasing corner
strenth q by calling the static method sort().9 The sorted sequence
is then converted to an array (line 82) which is traversed from start
to end (line 84–95). For each selected corner (c0), all subsequent
corners (cj) with a distance dmin are deleted from the sequence (line
92). The “surviving” corners are then transferred to the final corner
sequence Cclean.
Note that the call c0.dist2(cj) in line 91 returns the squared
Euclidean distance between the corner points c0 and cj , that is, the
quantity d2 = (x0 −xj )2 + (y0 −yj )2 . Since the square of the distance
suffices for the comparison, we do not need to compute the actual
distance, and consequently we avoid calling the expensive square root
function. This is a common trick when comparing distances.

7.3.4 Summary

Most of the implementation steps we have just described are initi-


ated through calls from the method findCorners() in class Harris-
CornerDetector:
98 public List<Corner> findCorners() {
9
Defined in class java.util.Collections.
157
7 Corner Detection 99 FloatProcessor Q = makeCrf((float)params.alpha);
100 List<Corner> corners =
101 collectCorners(Q, (float)params.tH, params.border);
102 if (params.doCleanUp) {
103 corners = cleanupCorners(corners, params.dmin);
104 }
105 return corners;
106 }

An example of how to use the class HarrisCornerDetector is shown


by the associated ImageJ plugin Find_Corners whose run() consists
of only a few lines of code. This method simply creates a new object of
the class HarrisCornerDetector, calls the findCorners() method,
and finally displays the results in a new image (R):
107 public class Find_Corners implements PlugInFilter {
108
109 public void run(ImageProcessor ip) {
110 HarrisCornerDetector cd = new HarrisCornerDetector(ip);
111 List<Corner> corners = cd.findCorners();
112 ColorProcessor R = ip.convertToColorProcessor();
113 drawCorners(R, corners);
114 (new ImagePlus("Result", R)).show();
115 }
116
117 void drawCorners(ImageProcessor ip,
118 List<Corner> corners) {
119 ip.setColor(cornerColor);
120 for (Corner c : corners) {
121 drawCorner(ip, c);
122 }
123 }
124
125 void drawCorner(ImageProcessor ip, Corner c) {
126 int size = cornerSize;
127 int x = Math.round(c.getX());
128 int y = Math.round(c.getY());
129 ip.drawLine(x - size, y, x + size, y);
130 ip.drawLine(x, y - size, x, y + size);
131 }
132 }

For completeness, the definition of the drawCorners() method has


been included here; the complete source code can be found online.
Again, when writing this code, the focus is on understandability and
not necessarily speed and memory usage. Many elements of the code
can be optimized with relatively little effort (perhaps as an exercise?)
if efficiency becomes important.

7.4 Exercises
Exercise 7.1. Adapt the draw() method in the class Corner (see
p. 155) so that the strength (q-value) of the corner points can also
be visualized. This could be done, for example, by manipulating
158
the size, color, or intensity of the markers drawn in relation to the 7.4 Exercises
strength of the corner.

Exercise 7.2. Conduct a series of experiments to determine how im-


age contrast affects the performance of the Harris detector, and then
develop an idea for how you might automatically determine the pa-
rameter tH depending on image content.

Exercise 7.3. Explore how rotation and distortion of the image af-
fect the performance of the Harris corner detector. Based on your
experiments, is the operator truly isotropic?

Exercise 7.4. Determine how image noise affects the performance


of the Harris detector in terms of the positional accuracy of the de-
tected corners and the omission of actual corners. Remark: ImageJ’s
menu command Process  Noise  Add Specified Noise... can be used
to easily add certain types of random noise to a given image.

159

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy