Every image processing course starts with operations that look at one pixel at a time. This lab covers the four ideas the rest of the subject builds on: the histogram, point transformations, histogram equalization and Otsu's threshold. Each one is on screen as an equation and as a result, and you can use your own photograph for all of them.
Gonzalez & Woods, 4th ed. §3.3 Histogram Processing, eq. 3-7 (p. 133) · Burger & Burge — Histograms and image statistics
Below is an 8×8 image with only eight grey levels (3 bits). The bars count how many pixels hold each level, and that is the whole idea. Click a pixel to raise its value and right-click to lower it. Point at a bar to see which pixels it is counting.
nk is the number of pixels with grey level rk. M×N is the size of the image, so dividing by it turns counts into fractions. That lets you compare images of different sizes, and the fractions always add up to exactly 1. Read pr(rk) as the probability that a randomly chosen pixel has level rk.
A photograph uses 256 levels instead of 8, but it is counted the same way. The tall bars show which levels dominate the picture, and the width of the histogram shows how much of the 0–255 range the picture actually uses.
Gonzalez & Woods, 4th ed. §3.2 Some Basic Intensity Transformation Functions (pp. 122–132) · Burger & Burge — Point operations
A point transformation replaces each grey level r with a new level s. The output depends only on the pixel's own value, never on its neighbours or its position. That means the whole operation is one curve, drawn below. Point at any pixel in the image and its path through the curve is traced for you.
Gonzalez & Woods, 4th ed. §3.3: Histogram Equalization (p. 134), Local Histogram Processing (p. 149) · Burger & Burge — Point operations: histogram equalization
In section 02 you chose the curve yourself. Equalization builds the curve from the image's own histogram: the transformation is the cumulative histogram, scaled up to the full range. Levels that many pixels share get pulled apart, and levels that few pixels use get squeezed together.
The sum is the fraction of pixels at or below level k. That fraction is always between 0 and 1 and never decreases as k rises. Multiplying by L − 1 stretches it to the full grey scale, and rounding gives an integer output level. Below, the table works through the 8×8 grid from section 01 one step at a time. Edit that grid and the table recalculates.
Global equalization uses one curve for the entire image, so a bright window and a dark corner get the same treatment. CLAHE (contrast-limited adaptive histogram equalization) computes a separate curve for each tile and blends neighbouring curves together so no seams show. Its clip limit caps how tall any one bar can grow before its curve is built. This stops a nearly uniform region, such as clear sky, from having its faint noise stretched into strong texture.
Gonzalez & Woods, 4th ed. §10.3: Optimum Global Thresholding Using Otsu’s Method (p. 747), eqs. 10-61 to 10-64 · Burger & Burge — Automatic thresholding
Thresholding is the most extreme point transformation: every level at or below T becomes 0, and every level above it becomes 255. The hard part is choosing T. Otsu's method tries every possible threshold. For each one it measures how far apart the means of the two resulting classes are, weighted by how many pixels fall in each class. It keeps the threshold where that separation is largest, and it needs nothing except the histogram.
P1(k) is the fraction of pixels at or below k. m(k) is the cumulative mean up to k, and mG is the mean of the whole image. The between-class variance σB2 is large when the two classes sit far apart. Dividing it by the image's total variance σG2 gives η, a score from 0 to 1 for how well the image splits into two groups at all.