GNR607 · Course revision reference

Understanding Satellite Image Processing: From Pixels to Intelligence

A GNR607 course revision guide, from image formation and enhancement to classification, accuracy assessment, and change detection.

November 21, 2026 · 22 min read · Mathematics

A satellite image is a record of measured radiation. It does not arrive with labels saying forest, road, or water. We turn measurements into those interpretations through a sequence of choices: calibrate and align the image, improve its visibility, describe its spectral and spatial patterns, classify what we see, and assess how reliable the result is.

Course: GNR607, Principles of Satellite Image Processing · Instructor: Prof. B. Krishna Mohan, IIT Bombay.

This guide follows that sequence. It grew from my GNR607 revision notes, discussions, numerical exercises, and an image-processing project. It is a reconstruction for revision, not a verified transcript of every lecture or an official syllabus. The general machine-learning material appears near the end as supporting context.

The course in one line: radiation → sensor samples → pixels and bands → enhancement → features and objects → classification → validation → change.

How to use this guide

Read sections 1–4 to establish what the numbers in an image mean. Sections 5–9 explain how local structures and useful features emerge. Sections 10–14 connect those features to maps and decisions. The worked problems and formula sheet are for a final pass. Expand a solution only after trying it yourself; use “Print notes” to keep a copy with all solutions visible.

1. Images, sampling, and sensor resolution

A grayscale digital image is a grid \(I(r,c)\) of sampled and quantized measurements. A multispectral pixel is a vector \(x(r,c)=[B_1(r,c),\ldots,B_K(r,c)]^\top\), and the image is an array in \(\mathbb R^{H\times W\times K}\). The band values may be raw digital numbers, calibrated radiance, or surface reflectance. Those are different physical quantities; check the processing level before comparing images.

Sampling chooses spatial locations. For fixed ground coverage, halving both pixel dimensions roughly quadruples the pixel count. Quantization chooses discrete output levels: \(b\) bits allow \(2^b\) possible codes. It does not imply that the sensor can resolve all \(2^b\) levels above its noise floor.

Resolution Main question
Spatial How small a ground feature can be distinguished?
Spectral How narrow and how numerous are the wavelength bands?
Radiometric How finely can measured radiation be distinguished?
Temporal How often is the same place observed?

Pixel spacing is not the entire spatial-resolution story: optics, detector response, motion, and resampling also blur detail. Narrower bands or smaller pixels may collect fewer photons, so improving one resolution can create a signal-to-noise trade-off. Revisit time also depends on orbit, viewing geometry, and cloud cover.

Worked numerical: image storage

For 1,000 rows, 1,000 columns, four bands, and eight bits per sample, uncompressed sample storage is

\[S=1000\times1000\times4\times8/8=4{,}000{,}000\text{ bytes}.\]

That is 4 MB in decimal units, or about 3.81 MiB. Metadata, padding, compression, and file headers change actual file size. Halving pixel width and height over the same footprint gives about four times as many samples.

2. How multispectral pixels are stored

The same two-band, two-by-two image can be laid out in several ways. Let band 1 be \([1,2;3,4]\) and band 2 be \([5,6;7,8]\) in row-major order.

Layout Sample sequence Convenient access
BSQ, band sequential 1,2,3,4, 5,6,7,8 A whole band
BIL, band interleaved by line 1,2, 5,6, 3,4, 7,8 All bands for a line
BIP, band interleaved by pixel 1,5, 2,6, 3,7, 4,8 A pixel’s spectral vector

The layouts contain identical samples and require identical uncompressed sample storage when dimensions and data types match. Their distinction is access pattern, not scientific content. A file reader also needs dimensions, data type, byte order, and often georeferencing metadata.

3. Enhancement: contrast and histograms

Enhancement makes patterns easier to see. It may change display values without adding information to the original measurement. Keep a display stretch distinct from a physical reflectance correction.

A linear min–max stretch maps \(f_{\min}\) to zero and \(f_{\max}\) to 255:

\[g=255\frac{f-f_{\min}}{f_{\max}-f_{\min}}.\]

With endpoints 50 and 150, the value 100 maps to 127.5 before rounding. The formula requires different endpoints; clipping is needed for values outside the chosen range. Percentile endpoints help when isolated outliers would otherwise compress most of the display contrast.

For histogram equalization, count \(n_k\) pixels at level \(r_k\) among \(N\) pixels, set \(p_k=n_k/N\), and compute \(C_k=\sum_{j\le k}p_j\). One discrete rule is \(s_k=\lfloor(L-1)C_k\rfloor\). Rounding conventions differ, and a discrete output histogram need not become uniform.

Worked numerical: equalize four pixels

For \([0,0,1,3]\) with \(L=4\), the probabilities at levels 0–3 are \((0.5,0.25,0,0.25)\). The CDF is \((0.5,0.75,0.75,1)\). Flooring \(3C_k\) maps the observed levels \(0\mapsto1\), \(1\mapsto2\), and \(3\mapsto3\). The output is \([1,1,2,3]\). A different stated rounding rule can give different output codes.

Histogram specification tries to match a target distribution, often via CDF mapping. It is useful for visual or statistical normalization across scenes, but a matching histogram does not establish equal physical reflectance. Equalization may amplify noise or change brightness, especially if applied globally to a heterogeneous image.

4. Spatial and frequency-domain filtering

A spatial filter combines pixels in a neighborhood. A 3×3 mean kernel has nine weights of \(1/9\); it reduces fluctuations but blurs boundaries. A median filter is nonlinear and resists isolated impulse noise: the median of \([10,11,12,13,255]\) is 12, while the mean is 60.2. Gaussian smoothing places more weight near the center. Adaptive filters vary smoothing according to local statistics and noise estimates.

Correlation applies a kernel as written. Convolution reverses it in both dimensions. For the patch \([1,2;3,4]\) and kernel \([1,0;0,-1]\), aligned correlation is \(-3\) and convolution using the flipped kernel is \(3\). Symmetric kernels give the same result under matching boundary and alignment conventions. Many software libraries call an operation “convolution” while implementing correlation, so inspect the convention.

The 2D discrete Fourier transform decomposes an image into spatial frequencies:

\[F(u,v)=\sum_{x=0}^{M-1}\sum_{y=0}^{N-1}f(x,y)e^{-2\pi i(ux/M+vy/N)}.\]

Slow variation tends to occupy low frequencies; rapid transitions contribute high frequencies. This is a useful intuition, not a perfect separation: sharp boundaries affect a range of frequencies, and noise can occur at several scales. A frequency filter computes \(G(u,v)=H(u,v)F(u,v)\) and then applies the inverse transform.

For \(H(u,v)=e^{-k(u^2+v^2)}\) with \(k>0\), \(H(0,0)=1\) and higher frequencies decay toward zero. It is a Gaussian low-pass response in the stated frequency coordinates. Larger \(k\) attenuates nonzero frequencies more strongly. The complementary high-pass response is \(1-H\). A sharp ideal cutoff often creates ringing; the Gaussian transition is smoother.

5. Edges, lines, and object candidates

An edge is a strong image change; it might trace a building, road, shadow, cloud boundary, or calibration artifact. The image gradient \(\nabla I=(I_x,I_y)^\top\) has magnitude \(\sqrt{I_x^2+I_y^2}\) and direction \(\operatorname{atan2}(I_y,I_x)\). Sobel masks approximate the two components using local weighted differences.

The Laplacian \(\nabla^2I=I_{xx}+I_{yy}\) responds to rapid changes but also to noise. Laplacian of Gaussian first smooths, then takes a Laplacian; candidate edges are found from sufficiently strong zero crossings.

Canny combines Gaussian smoothing, gradient estimation, non-maximum suppression, a high and low threshold, and hysteresis. The high threshold marks confident edges; the lower threshold lets connected weak segments survive. Its output depends on scale and thresholds.

Hough line detection maps an edge point \((x,y)\) to line parameters via

\[\rho=x\cos\theta+y\sin\theta.\]

Votes accumulate where many points support one line. Standard Hough identifies line parameters; probabilistic variants often sample edge points and return finite segments. A peak is geometric evidence, not proof that a whole semantic object exists.

Project example: rectangle detection. A practical pipeline is grayscale → smoothing → Canny → selective morphology → Hough segments → geometric checks. A rectangle candidate needs two approximately parallel pairs, near-perpendicular pair orientations, plausible intersections, and size constraints. Check the source image too: shadows and roof texture can create convincing false rectangles. Canny thresholds, structuring-element shape, minimum segment length, Hough vote threshold, and gap tolerance all influence the outcome.

6. Colour and false-colour interpretation

RGB is additive light; ideal full red plus green appears yellow. CMYK is subtractive ink; ideal magenta plus yellow yields red. These are display and printing models, not the same as a sensor’s calibrated spectral bands.

HSI separates hue, saturation, and intensity. In one standard HSI convention,

\[I=(R+G+B)/3,\qquad S=1-\frac{3\min(R,G,B)}{R+G+B},\]

for nonblack input. For \((R,G,B)=(0.7,0.3,0)\), saturation is 1, or 100%, despite red being 70% of the channel sum. At black the denominator vanishes, so saturation must be defined by convention. Other colour models define saturation differently.

A false-colour composite maps selected sensor bands to visible display channels. Putting near-infrared in the red channel commonly makes healthy vegetation appear bright red because vegetation reflects NIR strongly. The displayed red is a visualization choice, not a claim that the surface emits visible red light.

7. Mathematical morphology

Morphology probes shape with a structuring element \(B\). In binary morphology, erosion \(A\ominus B\) keeps locations where the translated element fits inside foreground \(A\); dilation \(A\oplus B\) expands foreground according to \(B\). Orientation matters for nonsymmetric elements.

Opening and closing compose these operations:

\[A\circ B=(A\ominus B)\oplus B,\qquad A\bullet B=(A\oplus B)\ominus B.\]

Opening removes small foreground features; closing fills small background gaps. Under standard definitions, opening is anti-extensive, closing is extensive, and both are idempotent. With an SE containing the origin, erosion is contained in opening, which is contained in the original set; the original is contained in closing, which is contained in dilation.

For a flat grayscale element, erosion selects a local minimum and dilation a local maximum over their respective reflected neighborhoods. The same ordering holds pointwise when the SE contains the origin. A repeated dilation can propagate the image’s actual maximum across a finite connected domain. It does not invent a value of 255.

Worked numerical: cross-shaped closing

Take the 5×5 image

\[\begin{bmatrix}25&60&28&29&27\\59&56&57&20&19\\25&59&29&32&20\\20&33&28&29&27\\24&31&29&27&25\end{bmatrix}\]

and a 3×3 cross containing the center and four axial neighbors. To close the center pixel, first dilate at the center and all four axial neighbors. Those five dilated values are 59 at center, 57 above, 33 below, 59 left, and 32 right. Their minimum is 32. The computation assumes the displayed neighborhood is interior, so no boundary rule is needed. A one-step min or max on the original center neighborhood would be the wrong operation.

Hit-or-miss looks for foreground and background simultaneously:

\[A\otimes(B_1,B_2)=(A\ominus B_1)\cap(A^c\ominus B_2).\]

It can detect endpoints or corners, but one wrong required pixel can break a match. White top-hat \(I-(I\circ B)\) extracts bright structures removed by opening; black top-hat \((I\bullet B)-I\) extracts small dark structures filled by closing. Morphological gradient is dilation minus erosion. Thinning and skeletonization reduce shapes to compact line structures while attempting to preserve topology.

8. Texture and the GLCM

A histogram counts intensity values. Texture records how those values occur together in space. A gray-level co-occurrence matrix \(G(i,j)\) counts pixel pairs of levels \(i\) and \(j\) at a chosen offset. Normalize by the number of eligible pairs to obtain \(P(i,j)\); specify distance, direction, and whether pairs are symmetrized.

For \(I=[1,1;0,0]\), the immediate right-neighbor pairs are \((1,1)\) and \((0,0)\), giving \(P=\operatorname{diag}(0.5,0.5)\). Common descriptors are:

Descriptor Formula Reading
ASM \(\sum_{i,j}P(i,j)^2\) Concentration of pair probabilities
Contrast \(\sum_{i,j}(i-j)^2P(i,j)\) Local gray-level difference
Entropy \(-\sum_{i,j}P(i,j)\log_2P(i,j)\) Pair-distribution uncertainty
Homogeneity \(\sum_{i,j}P(i,j)/(1+(i-j)^2)\) Weight near the diagonal
Dissimilarity \(\sum_{i,j}|i-j|P(i,j)\) Mean absolute difference

Treat \(0\log0\) as zero. Correlation standardizes \(\sum(i-\mu_i)(j-\mu_j)P(i,j)\) by the two marginal standard deviations; it is undefined when one is zero. In the example, ASM is 0.5, contrast is zero, and entropy is one bit. Direction matters: horizontal stripes can be smooth horizontally yet variable vertically.

Sum-and-difference histograms count \(s=x+y\) and \(d=x-y\) for neighboring pixels. With \(L\) integer gray levels their storage is \(O(L)\), compared with \(O(L^2)\) for a dense GLCM. For equal marginal variances and positive covariance, centered and normalized sum and difference align with the two PCA directions. Product \(xy\) can have a large range; ratio \(x/y\) is unstable near zero.

9. PCA, bands, and class separability

PCA centers spectral vectors, computes their covariance \(\Sigma\), and diagonalizes it: \(\Sigma v_i=\lambda_i v_i\). Components are uncorrelated in the sample covariance and sorted by variance. Explained variance for component \(i\) is \(\lambda_i/\sum_j\lambda_j\). Eigenvalues \((60,25,10,3,2)\) sum to 100, so the first three retain 95% of variance.

PC1 often captures common brightness when bands are strongly positively correlated; later components may encode band contrasts. Inspect eigenvector loadings before assigning meaning. PCA preserves variance, not labels or class separation. Selecting bands retains original measurements; extracting features constructs new ones, such as PCs, ratios, indices, or texture measures.

The Hughes phenomenon describes performance that initially improves and then worsens as feature dimension grows with limited training data. A full \(n\)-band covariance matrix needs \(n(n+1)/2\) distinct parameters per class; regularization, feature reduction, and better samples can help.

For Gaussian classes, Bhattacharyya distance combines a mean-separation term and a covariance-volume term:

\[B=\tfrac18(\mu_i-\mu_j)^\top\bar\Sigma^{-1}(\mu_i-\mu_j)+\tfrac12\log\frac{|\bar\Sigma|}{\sqrt{|\Sigma_i||\Sigma_j|}},\quad\bar\Sigma=(\Sigma_i+\Sigma_j)/2.\]

One convention for Jeffries–Matusita separation is \(JM=2(1-e^{-B})\), approaching 2 as separation grows. Specify the convention because some texts use a square-root scaling. A symmetrized KL divergence is nonnegative and symmetric but need not satisfy the triangle inequality. An invertible full-dimensional PCA rotation preserves information-theoretic divergence; selecting a subset may help a finite-sample classifier while discarding information.

10. Supervised spectral classification

Supervised methods use reference-labeled examples to learn a decision rule. The feature vector may include bands, indices, texture, and spatial context. Training quality and sampling design matter as much as classifier complexity.

Method Decision rule Main limitation
Minimum distance to mean Smallest \(\|x-\mu_i\|_2\) Ignores class spread and covariance
Parallelepiped Inside each band’s class interval Overlaps and uncovered pixels
Gaussian maximum likelihood Largest \(p(x\mid C_i)P(C_i)\) Needs reliable means and covariances
K-nearest neighbors Vote among nearest training vectors Storage and distance cost; scaling matters
Spectral angle mapper Smallest angle to reference spectrum Shape based, ignores positive scale
SVM Margin-based decision surface Kernel and regularization choices

A parallelepiped class with band ranges \(20\le B_1\le40\) and \(30\le B_2\le60\) rejects \((35,65)\) because the second band is out of range. Other pixels may fit several boxes; the implementation needs a tie rule.

For Gaussian maximum likelihood with positive-definite \(\Sigma_i\), compare

\[g_i(x)=-\tfrac12(x-\mu_i)^\top\Sigma_i^{-1}(x-\mu_i)-\tfrac12\log|\Sigma_i|+\log P(C_i).\]

The first quadratic is Mahalanobis distance squared. The determinant and prior also matter. Equal covariance matrices produce linear boundaries; different covariances generally produce quadratic ones. Singular estimated covariance needs regularization or a different model. A rejection threshold can prevent forced labels.

KNN neighbors are near in feature space, not necessarily adjacent on the map. For neighbor labels \([C_1,C_1,C_2]\) at \(K=3\), predict \(C_1\). Standardizing features matters when different bands or derived measures have different scales.

Spectral angle mapper computes \(\theta=\cos^{-1}[(x^\top v)/(\|x\|\|v\|)]\) for nonzero vectors. If \(v=2x\), the angle is zero although Euclidean distance is nonzero. Atmospheric and sensor effects are not always pure scaling, so angle invariance alone does not solve cross-scene comparison.

A linear SVM uses \(w^\top x+b=0\); an RBF kernel uses \(e^{-\gamma\|x-z\|^2}\). A perceptron updates a misclassified labeled point via \(w\leftarrow w+\eta yx\), \(b\leftarrow b+\eta y\). A single linear decision surface cannot separate XOR in its original two-dimensional input space.

11. Unsupervised classification

Clustering groups pixels without land-cover labels. A spectral cluster requires interpretation before it becomes a thematic class.

K-means minimizes \(J=\sum_{k=1}^{K}\sum_{x\in C_k}\|x-\mu_k\|^2\) by alternating nearest-center assignment and center recomputation. The objective does not increase under exact alternating steps, but the final solution depends on initialization and can be local. Standard k-means fixes \(K\); ISODATA can split dispersed clusters, merge nearby clusters, and remove small clusters according to thresholds.

Worked numerical: one k-means iteration

For points \([1,2,8,9]\), start two centers at 1 and 9. Assignment gives clusters \(\{1,2\}\) and \(\{8,9\}\); new centers are 1.5 and 8.5. The sum of squared deviations is \(4(0.5)^2=1\). Assignments remain stable at those centers.

12. Confusion matrices and validation

A map’s appearance cannot establish accuracy. Compare predictions with independent reference labels and state how test locations were sampled. For a table with rows as predictions and columns as actual classes:

Predicted / actual Forest Water Row total
Forest 40 10 50
Water 20 30 50
Column total 60 40 100

Overall accuracy is \((40+30)/100=70\%\). Forest user’s accuracy is \(40/50=80\%\): of pixels labeled Forest, how many truly are Forest? It is precision. Forest producer’s accuracy is \(40/60\approx66.67\%\): of actual Forest pixels, how many did we capture? It is recall. Commission error is \(1-UA=20\%\); omission error is \(1-PA\approx33.33\%\).

Kappa compares observed agreement \(P_o\) with agreement expected from row and column marginals \(P_e\): \(\kappa=(P_o-P_e)/(1-P_e)\). Here \(P_e=[50(60)+50(40)]/100^2=0.5\), so \(\kappa=(0.7-0.5)/(1-0.5)=0.4\). Kappa is sensitive to prevalence; report the matrix and class-specific measures too.

Validation design changes the answer. Leave-one-out uses \(N-1\) training samples for each of \(N\) tests. K-fold uses each fold for validation once. Stratification preserves class proportions, but random splits of neighboring satellite pixels can leak spatial similarity into both train and test. Geographic holdouts better test transfer to new areas. The reference label, acquisition date, mapping unit, registration, and sampling frame all affect estimates. Small tests mainly increase uncertainty; they are not automatically biased. Reusing training samples or selecting only easy sites usually creates optimistic estimates.

13. Mixed pixels and spectral indices

A coarse pixel can contain multiple materials. A linear mixture model writes \(x=\sum_{k=1}^K w_ks_k+\epsilon\), with nonnegative abundances \(w_k\) summing to one. For example, \(0.6s_{veg}+0.3s_{soil}+0.1s_{water}\) represents estimated fractions, subject to the model and endmember assumptions. Multiple scattering and nonlinear interactions can violate this approximation.

NDVI is \((NIR-Red)/(NIR+Red)\) when the denominator is nonzero. Red 20 and NIR 80 give 0.6. It often tracks green vegetation, but it can saturate in dense canopies and respond to soil, atmosphere, illumination, and crop type. A seasonal NDVI curve may rise after emergence and fall during senescence, but it is not a universal yield meter.

The Green–NIR NDWI for open water is \((Green-NIR)/(Green+NIR)\): Green 60 and NIR 10 give \(50/70\approx0.714\). Another index also called NDWI uses NIR and SWIR for vegetation water content. Name the bands, not just the acronym. All normalized ratios require care when their denominators are near zero.

14. Fusion, registration, and change detection

Pansharpening combines a high-detail panchromatic image with multispectral bands. Good fusion preserves useful spectral behavior while adding spatial detail. Registration establishes corresponding ground locations; an offset can manufacture edges and changes. Subpixel alignment is often sought, but the acceptable error depends on resolution and target size.

Direct spectral change starts with \(\Delta x=x_{t_2}-x_{t_1}\) and may use \(\|\Delta x\|\) or its direction. It requires comparable calibration, band responses, spatial resolution, geometry, and season. Post-classification comparison instead compares thematic labels at the two dates and yields from–to transitions. It still depends on consistent class definitions and accurate classifications; errors can compound.

Approach Strength Main risk
Image differencing or ratioing Simple direct measurement change Radiometric and denominator artifacts
NDVI differencing Vegetation-focused trend Seasonal or atmospheric variation
Change-vector analysis Multiband magnitude and direction Feature comparability
Temporal PCA Captures joint variability PCs need interpretation
Post-classification comparison Explicit class transitions Two maps’ errors propagate

Cloud and shadow, sun/view angle, soil moisture, phenology, sensor response, and registration can all look like land-cover change. Same-sensor images still need alignment and radiometric care; cross-sensor work needs extra harmonization.

15. Supporting machine-learning concepts

These ideas support the classification sections rather than being a replacement for the remote-sensing workflow. AI is a broad field; machine learning learns patterns from data; deep learning uses multilayer neural networks. Classification predicts categories, while regression predicts numerical values. Supervised learning uses labels; clustering usually does not.

Naive Bayes assumes features are conditionally independent given the class: \(P(C\mid x)\propto P(C)\prod_jP(x_j\mid C)\). With vegetation prior 0.6 and feature likelihoods 0.8 and 0.7, its unnormalized score is 0.336. With water prior 0.4 and likelihoods 0.2 and 0.5, the score is 0.04. The normalized vegetation posterior is \(0.336/(0.336+0.04)\approx0.894\), under the model assumptions.

Decision trees split features to reduce impurity. Entropy is \(H=-\sum_i p_i\log_2p_i\); information gain subtracts weighted child entropy from parent entropy. Gini impurity is \(1-\sum_i p_i^2\). These quantities describe label mixtures, not sensor physics.

A neuron’s forward computation is \(\hat y=wx+b\) followed by an activation. Backpropagation applies the chain rule to a loss. If \(x=2,w=3,b=1,y=5\) and activation is identity, \(\hat y=7\), \(L=(\hat y-y)^2/2=2\), and \(\partial L/\partial w=(7-5)\cdot2=4\). A gradient step of size 0.1 changes \(w\) to 2.6.

16. Worked revision problems

Problem A · Which neighborhood is being used?

A classifier uses KNN on spectral vectors, and a median filter uses a 3×3 window. Do both use “nearest pixels” in the same sense?

Show solution

No. KNN compares feature vectors and can retrieve training pixels from distant map locations. The median filter uses nearby image coordinates. Combining spectral and spatial features is possible, but it must be explicit.

Problem B · Convolution and correlation

Use patch \([1,2;3,4]\) and kernel \([1,0;0,-1]\). Find aligned correlation and convolution responses.

Show solution

Correlation is \(1-4=-3\). The 180° flipped kernel is \([-1,0;0,1]\), giving convolution \(-1+4=3\). Specify the alignment and boundary rule for a whole image.

Problem C · Read an error matrix

Using section 12’s matrix, compute forest user’s accuracy, producer’s accuracy, and kappa. Then swap the row and column meaning: which interpretation changes?

Show solution

With rows predicted, \(UA=40/50=0.8\), \(PA=40/60\approx0.667\), and \(\kappa=0.4\). If rows instead mean actual, the same numerical matrix gives \(UA=40/60\) and \(PA=40/50\). Overall accuracy and kappa stay the same because the diagonal and products of marginals are unchanged by transposition.

Problem D · A spectral look-alike

A pixel spectrum is \((10,20,30)\) and a reference is \((20,40,60)\). What do SAM and Euclidean distance say?

Show solution

SAM gives zero angle because the vectors have the same direction. Euclidean distance is \(\sqrt{10^2+20^2+30^2}=\sqrt{1400}\approx37.42\). SAM compares shape under positive scaling; Euclidean distance responds to magnitude.

Problem E · Feature count versus sample count

How many distinct covariance parameters does a 12-band Gaussian class model need, before counting its mean?

Show solution

A symmetric 12×12 covariance has \(12(13)/2=78\) distinct entries. The mean adds 12 more parameters. This helps explain why full covariance estimates become fragile with small training sets.

17. Formula sheet and common mistakes

Task Formula or test
Raw sample bytes \(H\,W\,K\,b/8\) when every sample uses \(b\) bits
Stretch \(255(f-f_{min})/(f_{max}-f_{min})\)
Equalization \(s_k\approx(L-1)\sum_{j\le k}p_j\), then state rounding
Gaussian low-pass \(e^{-k(u^2+v^2)}\) for \(k>0\)
Hough line \(\rho=x\cos\theta+y\sin\theta\)
Opening / closing \((A\ominus B)\oplus B\) / \((A\oplus B)\ominus B\)
Hit-or-miss \((A\ominus B_1)\cap(A^c\ominus B_2)\)
GLCM contrast / ASM \(\sum(i-j)^2P(i,j)\) / \(\sum P(i,j)^2\)
PCA retained variance \(\sum_{i\le k}\lambda_i/\sum_j\lambda_j\)
Mahalanobis squared \((x-\mu)^\top\Sigma^{-1}(x-\mu)\)
Spectral angle \(\arccos[(x^\top v)/(\|x\|\|v\|)]\)
User / producer accuracy Correct / predicted total; correct / actual total
Kappa \((P_o-P_e)/(1-P_e)\)
NDVI / Green–NIR NDWI \((NIR-Red)/(NIR+Red)\) / \((Green-NIR)/(Green+NIR)\)

When revising, check these traps: a feature-space neighbor is not necessarily a spatial neighbor; closing requires dilation then erosion; GLCM statistics use normalized pair counts; PCA variance does not equal classification value; SAM ignores positive scale; and a direct spectral difference may reflect the atmosphere or a shifted pixel. Always identify which confusion-matrix axis is predicted, whether a classifier can reject a pixel, and whether a spectral index’s denominator is safe. Changing the class definitions can raise overall accuracy without improving the underlying map.

The whole workflow comes back to one question: what information about the ground can this measurement support? Better processing matters, but so do calibration, sampling, alignment, ground truth, and honest uncertainty.

← All writing