Skip to content
CS-803 (A) · Image Processing and Computer Vision/Quick Revision Short Notes

Image Processing and Computer Vision (CS-803 (A)) - Unit 3 Short Notes

How unit 3 is examined

This unit covers measuring and describing regions and boundaries and matching them to models; spatial moments, signature properties and the distance relational approach carry the marks.

Region properties

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. A labeled image assigns every pixel an integer label, and all pixels with the same label form one region; region properties are numbers measured for each label to describe that region.

Key points.

  1. Area is the count of pixels carrying the label, $A=\sum_{(x,y)\in R}1$.
  2. Perimeter is the number of boundary pixels (or boundary steps) of the region, found by tracing its border.
  3. The centroid is the mean pixel position, $\bar{x}=\frac{1}{A}\sum x$ and $\bar{y}=\frac{1}{A}\sum y$.
  4. Compactness is $P^2/A$ (or $4\pi A/P^2$); it is smallest for a circle, so it separates round objects from elongated ones.
  5. Topological properties, such as the number of holes and the Euler number $E=C-H$ (components minus holes), do not change when the region is stretched.
  6. Moment-based properties (orientation, eccentricity) are computed from the spatial moments of the region.

Steps. Label the image, scan once accumulating area, sums of $x$ and $y$ and border count per label, then compute centroid and compactness from those sums.

Asked: [7 marks] (May 2023) Discuss how to measure the properties of the region in a labeled image?

External points

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. External points (extrema) are the extreme pixels of a region: the topmost, bottommost, leftmost and rightmost points, taken from its boundary.

Key points.

  1. The extreme points give the bounding box, whose width and height are $x_{max}-x_{min}$ and $y_{max}-y_{min}$.
  2. The ratio of region area to bounding-box area (extent) measures how fully the region fills its box.
  3. The extreme points and the line joining the two farthest of them give the region's length and rough orientation.
  4. They are cheap to find in one scan, so they are used for quick object location and size checks.

Spatial moments

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. Region analysis is the study of a segmented region through measured properties (size, position, orientation, shape) so that it can be described and recognised. ==The spatial moment of order $(p+q)$ of a region is $m_{pq}=\sum_x\sum_y x^p y^q f(x,y)$, where $f=1$ inside a binary region.==

Formula.

$$m_{pq}=\sum_x\sum_y x^p y^q f(x,y),\quad \mu_{pq}=\sum_x\sum_y (x-\bar{x})^p(y-\bar{y})^q f(x,y)$$

$$\text{Area}=m_{00},\quad \bar{x}=\frac{m_{10}}{m_{00}},\ \bar{y}=\frac{m_{01}}{m_{00}},\quad \theta=\tfrac12\tan^{-1}\!\frac{2\mu_{11}}{\mu_{20}-\mu_{02}}$$

Key points.

  1. The zeroth moment $m_{00}$ is the area of a binary region (total intensity for a gray region).
  2. The first moments $m_{10},m_{01}$ divided by $m_{00}$ give the centroid.
  3. Central moments $\mu_{pq}$ are taken about the centroid, so they are translation invariant.
  4. Second-order central moments $\mu_{20},\mu_{02},\mu_{11}$ give the spread and the orientation $\theta$ of the principal axis.
  5. Normalised central moments $\eta_{pq}=\mu_{pq}/\mu_{00}^{\gamma}$ with $\gamma=\frac{p+q}{2}+1$ are also scale invariant.
  6. Hu's seven combinations of $\eta_{pq}$ are rotation invariant too, so they describe shape whatever the position, size or angle.

Example. Pixels $(1,1),(2,1),(3,1),(1,2),(2,2)$: $m_{00}=5$, $\bar{x}=9/5=1.8$, $\bar{y}=7/5=1.4$; $\mu_{20}=2.8$, $\mu_{02}=1.2$, $\mu_{11}=-0.6$, so $\theta=\tfrac12\tan^{-1}(-1.2/1.6)=-18.4^\circ$. Area 5, centroid (1.8, 1.4), orientation $-18.4^\circ$.

Answer frame. Open by defining region analysis, then moments; write the $m_{pq}$ and $\mu_{pq}$ formulas; develop points 1-6 in order (area, centroid, central, orientation, normalised, Hu); add the small example; close by saying moment features describe shape independent of position, size and rotation.

Asked: [7 marks] (Dec 2024, Jun 2025) Define region analysis and describe the concept of spatial moments. Explain spatial moments and gray-level moments in region analysis; how are these properties used in object recognition?

Mixed spatial gray-level moments

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. Mixed spatial gray-level moments use both position and gray value: $m_{pq}=\sum_x\sum_y x^p y^q\, g(x,y)$, where $g(x,y)$ is the pixel intensity.

Key points.

  1. Unlike binary moments, each pixel is weighted by its gray level, so $m_{00}$ is the total intensity and the centroid is the intensity centre of mass.
  2. Central and normalised forms are defined exactly as for spatial moments, using $g$ in place of $f$.
  3. They capture texture and brightness distribution as well as shape.
  4. They are used as intensity features for recognising objects whose shape alone is ambiguous.

Signature properties

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. Boundary analysis describes an object by its boundary curve. A signature is a 1-D function of the boundary, such as the distance from the centroid to each boundary point plotted against angle, $r(\theta)$. <mark>Signature properties are boundary measures (length, curvature, bending energy, shape numbers, Fourier descriptors) that describe shape from the boundary alone.</mark>

Diagram.

<figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u3-01" viewBox="0 0 492.8 80" width="492.8" height="80" role="img" aria-label="Boundary analysis (B boundary, S signature, P properties, M matching or recognition)"><style>#dsfig-u3-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u3-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u3-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u3-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u3-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u3-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u3-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u3-01 .t{fill:#16181D;font-weight:500}#dsfig-u3-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u3-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u3-01 .dot{fill:#16181D}#dsfig-u3-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u3-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u3-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u3-01 .ah{fill:#454C5A}#dsfig-u3-01 .ah.hi{fill:#2340B8}#dsfig-u3-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u3-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u3-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u3-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u3-01 .e{stroke:#B1B7C3}html.dark #dsfig-u3-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u3-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u3-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u3-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u3-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u3-01 .t{fill:#E6E8ED}html.dark #dsfig-u3-01 .t.inv{fill:#0F1115}html.dark #dsfig-u3-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u3-01 .dot{fill:#E6E8ED}html.dark #dsfig-u3-01 .ann{fill:#8FA3FF}html.dark #dsfig-u3-01 .lbl{fill:#858D9C}html.dark #dsfig-u3-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u3-01 .ah{fill:#B1B7C3}html.dark #dsfig-u3-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u3-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u3-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u3-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah7" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh7" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M59,40 L156.6,40" marker-end="url(#ah7)"/><path class="e" d="M196.6,40 L294.2,40" marker-end="url(#ah7)"/><path class="e" d="M334.2,40 L431.8,40" marker-end="url(#ah7)"/><g class="wl"><rect x="70.9" y="31" width="75.9" height="18" rx="9"/><text class="t" x="108.8" y="40" dy=".35em" text-anchor="middle">signature</text></g><g class="wl"><rect x="205.3" y="31" width="82.2" height="18" rx="9"/><text class="t" x="246.4" y="40" dy=".35em" text-anchor="middle">properties</text></g><g class="wl"><rect x="360.5" y="31" width="47.1" height="18" rx="9"/><text class="t" x="384" y="40" dy=".35em" text-anchor="middle">match</text></g><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">B</text><circle class="n" cx="177.6" cy="40" r="18"/><text class="t" x="177.6" y="40" dy=".35em" text-anchor="middle">S</text><circle class="n" cx="315.2" cy="40" r="18"/><text class="t" x="315.2" y="40" dy=".35em" text-anchor="middle">P</text><circle class="n" cx="452.8" cy="40" r="18"/><text class="t" x="452.8" y="40" dy=".35em" text-anchor="middle">M</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Boundary analysis (B boundary, S signature, P properties, M matching or recognition)</figcaption></figure>

Key points.

  1. Boundary length is the number of boundary steps (diagonal steps count $\sqrt2$), and it gives the perimeter.
  2. Curvature is the rate of change of tangent direction along the boundary; sharp corners have high curvature.
  3. Bending energy is the sum of squared curvature over the boundary, $BE=\frac1L\sum k(s)^2$, and it is lowest for a circle.
  4. A centroid-distance signature $r(\theta)$ is translation invariant, and it becomes scale invariant after normalising by the maximum $r$.
  5. Rotation only shifts the signature along the angle axis, so shape numbers and Fourier descriptors of the signature can be made rotation invariant.
  6. Fourier descriptors (low-order coefficients of the boundary) and boundary moments give compact features for matching.

Steps. Trace the boundary, encode it (chain code or signature), compute length, curvature and energy, normalise, then compare features with stored models.

Answer frame. Open by defining boundary analysis and signature; draw the flow diagram; develop points 1-6 in order; close by stating that these invariant features let a boundary be matched to a model for recognition.

Asked: [7 marks] (May 2023, Dec 2024) What is boundary analysis? Discuss the properties in analyzing the boundary. Explain the role of signature properties and shape numbers in boundary analysis.

Shape numbers

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. A shape number is the smallest-magnitude circular rotation of the chain code's first difference, so it is a boundary code independent of the starting point.

Key points.

  1. The chain code (4- or 8-direction) records each boundary step as a direction digit.
  2. The first difference counts anticlockwise direction changes between successive digits (modulo 4 or 8), which makes the code rotation invariant.
  3. Rotating the difference code to the minimum-value integer removes the dependence on the start point.
  4. The number of digits is the shape order, and two shapes match when their shape numbers are equal.

Distance relational approach

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. A distance is a function $d(p,q)$ that measures how far two pixels are apart. <mark>The distance relational approach represents an object as a set of primitives with the distances and relations between them, and matches it to a model by comparing these relations.</mark>

Key points.

  1. Euclidean distance is $d_E=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$, the straight-line distance.
  2. City-block distance is $d_4=|x_1-x_2|+|y_1-y_2|$, counting horizontal and vertical steps only.
  3. Chessboard distance is $d_8=\max(|x_1-x_2|,|y_1-y_2|)$, allowing diagonal steps.
  4. A distance transform replaces each object pixel by its distance to the nearest background pixel, and it gives shape and matching measures.
  5. In image matching, the object's primitives and their pairwise distances form a relational description that is compared with each model's description.
  6. The best match is the model whose relation distances differ least from the observed ones, so the match tolerates small errors.

Example. For $(1,1)$ and $(4,5)$: $d_E=5$, $d_4=7$, $d_8=4$.

Basis Distance relational Ordered structural
Description Distances between primitives Sequence of primitives
Order Not required Order must be kept
Invariance Good for translation, rotation Depends on start point
Complexity Compares many pairs One ordered comparison
Limit Loses sequence Fails with missing primitives

Answer frame. Open by defining distance and naming the three measures; write their formulas; develop points 4-6 for the relational approach; add the comparison table if ordered structural matching is asked; close with the distance example.

Asked: [7 marks] (May 2023, Jun 2025) What is distance in image processing? Discuss the distance relational approach in image matching framework. Explain it and compare it with ordered structural matching.

Ordered structural matching

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. Ordered structural matching compares an object with a model as an ordered sequence of primitives (for example boundary segments), matching primitive by primitive in order.

Key points.

  1. The object is described by a structural list such as an ordered chain of line and arc primitives around the boundary.
  2. Matching aligns the two sequences, trying cyclic shifts because the start point is unknown.
  3. Each primitive pair is compared by type and attributes, and the match score is the number of agreements.
  4. It is simple, but a missing or extra primitive breaks the order.

View class matching

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. View class matching recognises a 3-D object by grouping all its 2-D views into classes of similar appearance and matching the image to a stored view class.

Key points.

  1. The possible viewpoints of a model are sampled over a viewing sphere.
  2. Views with the same visible features form one view class, represented by a canonical view.
  3. Matching compares image features with each class representative rather than with every viewpoint.
  4. It suits objects with few characteristic views, and it reduces matching cost.

Models database organization

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. The models database stores the object models (features, relations, view classes) organised so that the right model can be found quickly.

Key points.

  1. Each model entry holds features, relations and, for 3-D objects, its view classes.
  2. Models are indexed by simple features, such as area or number of holes, to reject most models early.
  3. Related models are grouped in a hierarchy, so matching moves from coarse to fine.
  4. Good organisation keeps matching time low as the database grows.

Last-minute revision

  • Labeled image: each region has one integer label; area is the pixel count of that label.
  • Compactness $=P^2/A$; the circle is the most compact shape.
  • Euler number $E=C-H$ (components minus holes).
  • $m_{pq}=\sum x^p y^q f(x,y)$; area $=m_{00}$; centroid $=(m_{10}/m_{00},\,m_{01}/m_{00})$.
  • Central moments $\mu_{pq}$ are translation invariant; $\eta_{pq}=\mu_{pq}/\mu_{00}^{(p+q)/2+1}$ is scale invariant.
  • Orientation $\theta=\frac12\tan^{-1}\frac{2\mu_{11}}{\mu_{20}-\mu_{02}}$; Hu gives 7 rotation-invariant moments.
  • Signature is $r(\theta)$, the centroid distance against angle.
  • Boundary properties: length, curvature, bending energy, shape number, Fourier descriptors.
  • Shape number is the minimum rotation of the chain-code first difference.
  • $d_E$ is the straight line, $d_4$ the city block, $d_8$ the chessboard; for (1,1),(4,5) they are 5, 7, 4.
  • Distance relational matching compares relation distances; ordered structural matching compares primitive sequences.

Memory hooks

  • Moments: "Zero is area, first is place, second is spin" ($m_{00}$, $m_{10}$/$m_{01}$, $\mu_{20}$/$\mu_{02}$/$\mu_{11}$).
  • Boundary properties: "Long, Curvy, Bendy, Numbered" (length, curvature, bending energy, shape number).
  • Distances: Euclid flies, city-block walks the streets, chessboard moves like a king.
  • Central = shift-proof, normalised = size-proof, Hu = spin-proof.

Coverage checklist

  • Region properties: labeled-image properties question (May 2023).
  • External points: covered by definition and key points; no past question.
  • Spatial moments: define region analysis and spatial and gray-level moments (Dec 2024, Jun 2025).
  • Mixed spatial gray-level moments: gray-level part of the Jun 2025 question.
  • Signature properties: boundary analysis and signature properties (May 2023, Dec 2024).
  • Shape numbers: shape-number part of the Dec 2024 question.
  • Distance relational approach: distance and relational approach (May 2023, Jun 2025).
  • Ordered structural matching: comparison part of the Jun 2025 question.
  • View class matching: no past question.
  • Models database organization: no past question.
Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in