Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Strain Window

Kernel Warping showed how dictk's locate_warp reduced the standard deviation for the 2% stretch to 1161 microstrain. locate_subpixel gave 16531 microstrain on the same stretch, and VIC-2D gave 1385 microstrain. Neither the locate_subpixel nor the locate_warp result used strain smoothing, the topic of this page. This page shows that strain smoothing reduces the strain error further.

Strain spread starts with tracking error. Every tracked point carries an error. A strain needs a derivative of displacement, and the derivative divides the error by the point spacing. For example, a 0.01 px error between two points 5 px apart puts 2000 microstrain ( microstrain) into the slope.

The Q4 elements behind the 1161 microstrain each differentiate across four neighboring points, 5 px apart. In contrast, a strain window differentiates across more points. It fits one plane to the displacements of every point in a square of neighboring points. The fit averages their errors, so the strain error drops. A 15x15-point window averages across 225 points.

The averaging has a cost. The plane assumes the strain is uniform across the window. If the real strain changes inside the window, the fit blurs that change into one number. Each point stands for a cell one spacing wide, so a window with points per side covers a side length of times the spacing. At 5 px point spacing:

  • A 3x3 window averages 9 points and blurs over a side length of 15 px ( px).
  • A 15x15 window averages 225 points and blurs over a side length of 75 px ( px).
  • A 19x19 window averages 361 points and blurs over a side length of 95 px ( px).

This page builds the strain window in three steps. In 1D, a row of three points shows the idea with three numbers. A 3x3 example then adds the second axis and gives the 2D result. Finally, a general window extends the 2D result to points per side. At , it recovers the 3x3 result. The page then compares the window's noise with the Q4 finite element's noise.

The Measured Result runs dictk.strain_window with a 15x15-point window on Kernel Warping's tracked positions:

  • At the 1560 points with a full window, the standard deviation falls from 1161 microstrain to 39 microstrain.
  • At all 2862 points (1560 full-window points + 1302 edge and corner points), the standard deviation falls from 1161 microstrain to 91 microstrain. The 1302 edge and corner points truncate their windows. Their spread alone is 117 microstrain.

Notation

SymbolUnitsMeaning
pxgrid spacing
pointswindow half-width: the window reaches points out from its center along each axis
pointspoints per window side, always odd so the window centers on a tracked point
pointscolumn and row of a point within the window, each from to
pxthe point's and position relative to the window center
pxtracked and displacement
px at column and row
pxfitted at the window center
dimensionlessfitted gradient of at the window center
1/pxweight of in the fitted and
dimensionlessthe displacement gradient, as in Finite Element Method
pxstandard deviation of each point's tracking error

In an image,

  • runs across the page from left to right. The displacement points in the direction. Column grows from left to right.
  • runs down the page from top to bottom. The displacement points in the direction. Row grows from top to bottom.

The steps below fit . The fit for uses the same weights, as Fit for shows.

1D Example

Consider three points on the axis. Index them by . Point sits at relative to the middle point. The three points have tracked displacements , , and . Figure 10.1-1 shows the three points and their displacements.

three filled orange dots on a horizontal X axis at X = -h, 0, and h, labeled below with index c = -1, 0, and 1. Two gray double arrows mark the equal spacing h between neighboring dots. Above each dot, an orange arrow points right to a hollow orange dot at the displaced position. The arrows are labeled u_-1, u_0, and u_1, and grow longer from left to right
Figure 10.1-1: The 1D Example. Filled dots mark the reference positions . Hollow dots mark the displaced positions . The displacements are illustrative, 0.30, 0.52, and 0.58 times .

Fit a straight line through the displacements. At , the line predicts

The slope of the line is . The intercept of the line is , the fitted displacement at the middle point, where . Figure 10.1-2 shows the line through the three displacements of Figure 10.1-1.

plot of displacement u against position X, with X ticks at -h, 0, and h and u ticks at 0.30h, 0.52h, and 0.58h. Three orange dots mark u_-1, u_0, and u_1. A black fitted line passes just above u_-1 and u_1 and below u_0. A hollow square on the line at X = 0 marks the intercept u-hat_0. A blue right triangle under the line, between -h and 0, marks a run delta X and a rise du/dX times delta X. Short dashed red segments join each dot to the line
Figure 10.1-2: The least-squares line through the three displacements of Figure 10.1-1. The hollow square marks the intercept . The blue triangle shows the slope . The dashed red segments are the residuals: , , and .

That is two unknowns, and , for three points. Least squares picks the two unknowns that minimize the sum of the three squared residuals:

At the minimum, the derivative of with respect to each unknown is zero. The derivative with respect to is

Rearranged, that gives the first normal equation:

The derivative with respect to the slope is

Dividing by and rearranging gives the second normal equation:

In matrix form, the two normal equations are

The sums are , , and . So the matrix is

The zero off the diagonal decouples the two unknowns:

The slope is the central difference. The middle point gets zero weight in it.

Noise

How much does tracking error move the slope? Work it out in six steps.

Step 1: model the error. Each tracked displacement is the true displacement plus an error:

The three errors , , and are independent. Each has mean 0 and standard deviation , so each has variance .

Step 2: find the error in the slope. Substitute step 1 into the slope:

The true part has no randomness. So the slope's variance is the variance of the slope error alone. The middle point's error does not appear, because the middle point has zero weight.

Step 3: recall two variance rules. For a constant and independent errors and :

Variances add for a difference too, because the sign flips with and .

Step 4: apply the first rule to each term. The slope error has two terms, and . Each one is an error scaled by :

Step 5: apply the second rule to add them.

Step 6: take the square root. The standard deviation is

For example, take px and px. The slope's standard deviation is , or 1414 microstrain.

A slope's noise reads as strain noise because, at small strain, . For a uniaxial stretch, , so . At the 2% stretch on these pages, that factor is . So log strain noise runs 2% below slope noise. This page quotes slope noise. From Gradient to Strain gives the full chain from slopes to strain.

The slope uses only 2 of the 3 points. The 3x3 window below averages three such rows. Before the 3x3 result, Q4 Baseline derives a Q4 element's noise for comparison in 2D.

Q4 Baseline

Finite Element Method computes strain from Q4 elements. Every strain on the earlier pages comes from them. This section derives a Q4 element's noise. The window sections below compare against it, for two reasons.

  • Q4 is the method dictk uses now. Kernel Warping measured its 1161 microstrain spread with gauss_point_log_strains, which evaluates Q4 elements. A window must beat that to earn a place in dictk.
  • Q4 sets the unit of improvement. The 1D slope's noise scales with . The Q4 element's and the window's do too. One number for each turns every comparison into a ratio.

Gauss-Point Gradient

Take a square Q4 element with side . Its nodes 1 to 4 sit at , , , and . At the two Gauss points with , its gradient is

So and . The edge nearer the Gauss point gets the larger weight. The two Gauss points at swap and . Figure 10.1-3 shows the weights. The script computes them with dictk.element.

a square Q4 element in local coordinates xi and eta from -1 to 1. Four large colored circles mark the nodes. Node 1 at (-1, -1) shows -0.211 in red, node 2 at (+1, -1) shows +0.211 in blue, node 3 at (+1, +1) shows +0.789 in blue, and node 4 at (-1, +1) shows -0.789 in red. Two blue crosses mark the Gauss points at eta = +1/sqrt(3). Two smaller gray crosses mark the Gauss points at eta = -1/sqrt(3)
Figure 10.1-3: Weight of each node in at the Gauss points with , the blue crosses, in units of . Red weights are negative and blue weights are positive. The top nodes sit nearer these Gauss points, so they carry 0.789. The bottom nodes carry 0.211.

Q4 Noise

The weights satisfy and . Each node enters once, with weight or . The variance rules from the 1D Example's Noise give

All four Gauss points give the same value, because each one uses the same four weights in a different order.

The earlier pages build each Q4 element from 4 neighboring tracked points, so . The standard deviation is then . For px and px, that is 2309 microstrain. The 1D Example's central difference gives 1414 microstrain at the same and . The 2D Example compares the 3x3 window with both.

2D Example

The smallest square window with a center point holds 3x3 = 9 points. It is the general window with .

Setup

The points sit on a grid with spacing . Point sits at and relative to the center point . The window fits a plane through the 9 tracked displacements:

That is three unknowns, , , and , for nine points. Figure 10.1-4 shows the plane through nine displacements. It extends Figure 10.1-2 from a line to a plane.

3D plot of displacement u above a 3 by 3 grid of gray dots on the X-Y floor, with X and Y ticks at -h, 0, and h. A faint blue tilted plane rises toward positive X and positive Y. Nine orange dots sit above the grid points, each joined to the plane by a short dashed red segment, some above the plane and some below. Each orange dot carries its label, u_c,r, from u_-1,-1 to u_1,1. A very light gray rectangle on the floor is the plane's shadow, parallel to the x and y axes, and it covers all nine gray dots. Gray shadows of the plane's lines cross the floor through the dots, darker for the two bold center lines. Two bold blue lines cross the plane through its center, labeled du/dX along x and du/dY along y. A hollow blue square at the crossing marks u-hat_0
Figure 10.1-4: The least-squares plane through nine displacements on the 3x3 grid. The hollow square marks the intercept . The bold blue line along has slope . The bold blue line along has slope . The dashed red segments are the residuals, from to in magnitude. The displacements are illustrative. They sample a true plane with intercept and slopes in and in . Each one adds a Gaussian error with , drawn with random seed 107.

Normal Equations

Least squares minimizes the sum of the nine squared residuals:

As in the 1D Example, each derivative of is zero at the minimum. Write for the residual inside the parentheses. The three derivatives are

Dividing each by and rearranging gives three normal equations. In matrix form, they are

Each sum runs over the 9 points:

  • .
  • . Three points sit at each of , , and , so they cancel. for the same reason.
  • . Flipping to flips the product's sign, so the points cancel in pairs.
  • . for the same reason.

So the matrix is

The matrix is diagonal, so each equation holds only one unknown.

Solution

Each unknown divides one right-side entry by one diagonal entry:

Figure 10.1-5 draws the weights. In , the right column enters with , the left column with , and the middle column with 0. Group the sum by row. Each row contributes . In , the bottom row enters with , the top row with , and the middle row with 0. Group that sum by column. Each column contributes . So

  • is the mean of three central differences, one per row. The window differentiates along and averages along .
  • is the mean of three central differences, one per column. The window differentiates along and averages along .
three square panels, each a 3 by 3 grid of dots with column c and row r from -1 to 1. The left panel shows 9 orange dots labeled with their (c, r) index, with a ring around the center (0, 0). The middle panel shows the weights for du/dX: -1 in red for the left column, 0 in gray for the middle column, +1 in blue for the right column. The right panel shows the weights for du/dY: -1 in red for the top row, 0 in gray for the middle row, +1 in blue for the bottom row
Figure 10.1-5: The 3x3 window. Left: the 9 points, indexed by column and row . Middle: the weight of each point in , in units of . Right: the weight of each point in , in the same units.

Fit for

Every entry of the matrix in the normal equations is a sum over , , and . No entry holds a displacement. So the fit for uses the same matrix. Only the right side changes, from to . The same diagonal entries give

The weights match Figure 10.1-5. They multiply instead of .

Noise in the 3x3 Window

The solution writes as a weighted sum with . Independent errors give

The standard deviation is . The row of three points gave . Averaging three independent rows divides that by , and .

The weights for are . Their squares sum to the same , so also has standard deviation . The fit for uses the same weights. If the errors in have the same , and have too.

A Monte Carlo simulation checks the formula. The grid spacing is px. The true field has px, , and . Each of 10,000 draws adds an independent Gaussian error with px to all 9 displacements, with random seed 0. That is illustrative. It is not measured from a tracker. A tracker's errors also correlate between neighboring points, as Noise in a General Window shows.

The formula gives 816 microstrain. The 10,000 Monte Carlo draws give 819 microstrain. A Q4 element gives 2309 microstrain, 2.8 times more. Q4 Noise derives that value.

Figure 10.1-6 shows the 10,000 fitted slopes.

a histogram of the fitted du/dX over 10000 Monte Carlo draws, centered on a dashed red line at the true value of 20000 microstrain. A blue band of plus or minus 819 microstrain marks the 3x3 window. A wider pale red band of plus or minus 2309 microstrain marks a Q4 element and covers nearly the whole histogram
Figure 10.1-6: Fitted of the 3x3 window over 10,000 Monte Carlo draws, in microstrain. The dashed red line is the true value. The blue band is standard deviation of the 3x3 window. The pale red band is standard deviation of a Q4 element, from Q4 Noise.

General Window

A general window holds points, with . The steps match the 3x3 window's. Each result reduces to the 3x3 result at .

Setup

Columns and rows each run from to . The fit is the same plane:

That is three unknowns for points. For and px, the window holds 225 points. Its extent is px, because each point stands for a cell wide. The two outermost points sit px apart. This page uses the extent for the region a window blurs over, and the outer-point distance for the footprint that Window versus Q4 compares with a Q4 element.

Normal Equations

The residual sum , its derivatives, and the matrix form match the 3x3 window's. Only the limits change: every sum now runs from to . One sum appears repeatedly. Call it :

The window's sums follow from it:

  • .
  • , by the same cancellations as the 3x3 window.
  • , because each of the rows contributes . is the same.

So the matrix is

At : and , so the diagonal is .

Solution

At , the weights are and .

The weight grows linearly with . The outermost columns, at , carry the largest weights. A displacement from the center changes by times any change in slope, so it gets times the weight of a point at . The weight does not depend on . So the estimator fits one line per row and averages the row slopes. Figure 10.1-7 shows the weights for , 2, and 3. The script also solves the normal equations directly and compares:

weight of column largest gap to direct solve
13260.0e+00
2510500.0e+00
37281964.3e-19
three square heat maps of du/dX weights for windows of 3 by 3, 5 by 5, and 7 by 7 points. Each cell shows its column index c, from red negative values on the left through white zero in the middle column to blue positive values on the right. Every row is identical. The panel titles give the weights as c over 6h, c over 50h, and c over 196h
Figure 10.1-7: The weight of each point in for , 2, and 3. Each cell shows . The title gives the weight, . The square marks the window center.

The weights depend only on and . They do not depend on the images. So one set of weights serves every interior window, and for both and .

Noise in a General Window

Independent errors give

The standard deviation is

At , it is . The standard deviation falls as . Each row's line fit contributes . A row has points, and its outer points sit from the center, so grows as . Averaging the rows contributes the remaining .

The table compares the formula with a Monte Carlo simulation of 4000 random draws per window and with the Q4 element's . Figure 10.1-8 plots the same comparison for from 3 to 19:

WindowFormula, units of Monte Carlo, 4000 draws, units of Reduction vs Q4
3x3
()
0.40820.4086
7x7
()
0.07140.0707
11x11
()
0.02870.0289
15x15
()
0.01540.0155
19x19
()
0.00960.0097
log-scale plot of the standard deviation of du/dX, in units of sigma over h, against window points per side n from 3 to 19. A black formula curve falls from 0.41 at n = 3 to 0.0096 at n = 19. Blue Monte Carlo dots sit on the curve. A dashed red horizontal line marks the Q4 element at 1.155
Figure 10.1-8: Standard deviation of for independent errors, in units of , against . The black curve is the formula. The blue dots are a Monte Carlo simulation of 4000 random draws per window. The dashed red line is a Q4 element of side , from Q4 Baseline.

If the tracking errors were independent, the reduction at would cut Kernel Warping's 1161 microstrain to 15.5 microstrain. That compares the window with a Q4 element on the same grid. Window versus Q4 splits it by source.

Measured Result measures 39 microstrain at the interior points, 2.5 times more. The tracking error is not independent. Kernel Warping found a wave with a 51 px period. Points 5 px apart sit 35° apart on that wave's cycle, so their errors correlate at . Frequency Response computes the fraction of a wave's slope that a window passes.

Uniform Weights

Every point here gets the same weight in the sum of squared residuals. For independent errors with equal variance, uniform weights give the lowest variance of any linear unbiased estimator. A tent or Gaussian weight would reduce the influence of each window's outer points. Both are candidate refinements for a later stage. Neither appears here.

Window versus Q4

Q4 Baseline derived a Q4 element's noise, . Noise in a General Window derived the window's. This section compares the two at any window size. Two points frame the comparison.

  • Q4 shows where the gain comes from. A Q4 element fits 4 coefficients to 4 displacements. The fit is exact, so it averages nothing. A 15x15 window fits 3 coefficients to 225 displacements. That redundancy does the averaging.
  • A fair comparison controls for footprint. On a grid with spacing , a Q4 element spans . A 15x15 window spans between its outer points. That larger footprint alone accounts for of the window's lead. It also blurs the strain field. Equal Footprint holds the footprint fixed. Q4 at Equal Resolution holds the resolution fixed, which is the fairer test.

Equal Spacing

A Q4 element at gives 2309 microstrain. The 3x3 window gives 816 microstrain, 2.8 times less, at the same px and px. Dividing the Q4 standard deviation by the general window's standard deviation gives the ratio for any window size:

The ratio is 2.8 at and 74.8 at . It gives the gain dictk would see by replacing its Q4 elements with windows on the same grid. It does not split that gain by source.

Equal Footprint

A 15x15 window at px spans 70 px between its outer points. A Q4 element at spans 5 px. To remove the footprint gain, give the Q4 element the window's footprint. Its corners then sit on the window's 4 corner points, and . Figure 10.1-9 shows the three choices on one grid.

three panels, each a 15 by 15 grid of points with columns and rows from -7 to 7. Left: all 225 points orange inside a blue square, titled 15x15 window, std 0.0154 sigma over h. Middle: 4 orange points at the corners of one small red square cell near the center, the other points light gray, titled Q4 equal spacing, std 1.1547. Right: 4 orange points at the grid corners joined by a large red square, the other points light gray, titled Q4 equal footprint, std 0.0825
Figure 10.1-9: The tracked points each method uses on one 15x15 grid. Left: the window uses all 225. Middle: a Q4 element at equal spacing uses 4 neighbors, 1 cell wide. Right: a Q4 element at equal footprint uses the 4 corner points, 14 cells wide. Each title gives the standard deviation of in units of .

With , the ratio becomes

The ratio is 1.41 at and 5.35 at , and it approaches as grows. The two ratios differ by exactly , the ratio of the footprints. At , . The 14 comes from the footprint. The 5.35 comes from the fit. The window fits 225 displacements by least squares. The Q4 element interpolates 4 exactly.

Counting points alone suggests . Two effects turn that into . First, the window's interior points sit closer to its center. A change in slope moves a point in column by an amount proportional to . So each point adds information about the slope in proportion to . A point at adds 1/49 as much as a point at . The 15 points at add none. Over one row, , so the 225 points carry as much as 85.7 points in the outer columns would. That costs the window a factor . Second, the Q4 element weights its corners unequally, with and . Equal weights of 0.5 would give instead of . That costs the Q4 element a factor 1.155. Together, .

windowQ4, equal spacingQ4, equal footprintequal-spacing ratioequal-footprint ratio
30.40821.15470.57742.81.41
70.07141.15470.192516.22.69
150.01541.15470.082574.85.35
190.00961.15470.0642120.26.68

All values are in units of . The Q4 columns come from dictk.element and match within 2e-16.

Figure 10.1-10 plots the window and both Q4 elements, at equal spacing and at equal footprint, for from 3 to 19.

log-scale plot of the standard deviation of du/dX, in units of sigma over h, against window points per side n from 3 to 19. A dashed red line holds at 1.155 for the equal-spacing Q4 element. A solid red line with hollow squares falls from 0.58 at n = 3 to 0.064 at n = 19 for the equal-footprint Q4 element. A solid blue line with dots falls faster, from 0.41 to 0.0096, for the window. At n = 15, labels give the values 1.1547, 0.0825, and 0.0154, and gray double arrows split the gap into 14× footprint, between the two red lines, and 5.35× fit, between the lower red line and the blue line
Figure 10.1-10: Standard deviation of against for the window and for Q4 elements at equal spacing and at equal footprint. At , the gray arrows split the equal-spacing ratio into a footprint gain and a least-squares fit gain. The labels give each series' value at , in units of .

A larger footprint lowers noise and blurs the field. Two methods with the same footprint can still blur by different amounts. Q4 at Equal Resolution checks whether the favors the window.

From Gradient to Strain

Fitting and gives the four components of the displacement gradient at the window center:

The fit uses reference positions and , so this is the Lagrangian gradient. The rest follows Continuum Mechanics:

This page reports the log strain , to match the figures on the pages before it. The fit is linear in the displacements. The strain is not, because and are nonlinear. So the noise formulas above hold exactly for . For strain they hold to first order. The 1D Example's Noise showed that log strain noise runs 2% below slope noise at the 2% stretch on these pages.

Fitting the current positions instead of and gives directly as the slope. Both routes agree, because the reference positions and are exactly linear in and .

Bias and Resolution

A window reduces variance and blurs the real field. Frequency Response measures that blur on a sine wave. Q4 at Equal Resolution measures a Q4 element's blur on the same wave.

Frequency Response

Take , with wavenumber . The wave varies along only, so every row of the window is identical. The General Window averages its row slopes, so one row's slope gives the window's:

In the continuum limit, the points become an interval from to . Each point stands for a cell wide, so , half the window's extent. With , the sums become integrals:

The numerator comes from integration by parts. The true slope at the window center is . Dividing by it gives the ratio of the fitted slope to the true slope:

The small- limit follows from a Taylor expansion, . The wave's phase does not change . A wave shifted by splits into plus . The part is even about the center, so the odd weight integrates it to zero. The fitted slope and the true slope then both scale by .

first reaches zero where , at . For and px, px, so that zero falls at a period of px.

Integrating the same numerator by parts for a general shows what the fit does. Take as the antiderivative of . It vanishes at , so the boundary term drops out:

The weight is positive and integrates to 1. So the fit averages the true gradient with a parabolic weight. The weight peaks at the center and falls to zero at . is that average applied to the wave's gradient, .

The discrete fit skips the continuum limit. It gives .

Figure 10.1-11 plots against the wave period for and px. Kernel Warping found a bias wave in locate_subpixel with a 51 px period:

At a 51 px period, the discrete fit gives = -0.0167. The continuum formula with gives -0.0173. The discrete crosses zero at a 52.4 px period. It reaches 0.5 at 94 px and 0.9 at 230 px.

So the window keeps 1.7% of that wave's slope, and reverses its sign. The 51 px period sits 1.4 px below the zero crossing. The 1.7% holds for that period only.

plot of T, fitted slope over true slope, against wave period from 20 to 400 px for a 15 by 15 window at 5 px spacing. A wide light gray continuum band and a thin dark navy discrete line overlap, with the line running down the middle of the band. Both oscillate near zero below 60 px, cross zero near 52 px, and rise toward 1, reaching 0.9 near 230 px. A red dot marks the 51 px wave at T = -0.017. A dotted vertical line marks the 75 px window extent
Figure 10.1-11: Frequency response of a 15x15 window at px. The wide gray band is the continuum formula with . The thin navy line is the discrete least-squares fit. The two differ by at most 0.004 in , at an 81 px period, so the line stays inside the band. The red dot marks Kernel Warping's 51 px bias wave. The dotted line marks the 75 px window extent.

Q4 at Equal Resolution

For the same wave , a Q4 element of side sees no change in . So its bottom-edge difference equals its top-edge difference , and all four Gauss points return the same gradient. Its ratio to the true slope at the element center is

The window's falls as . At equal footprint, the Q4 element blurs more:

The window keeps half the slope of a 94 px wave. The equal-footprint Q4 element, 70 px on a side, needs a 116 px wave for the same. A Q4 element matches the window's 94 px at 56.7 px on a side. Its standard deviation is then 0.102 , 6.6 times the window's 0.0154.

So matching resolution instead of footprint raises the window's lead from to . Equal resolution holds the half-power period fixed at 94 px, so it is the fairer comparison. At equal resolution, the equal-spacing lead splits into from the footprint and from the fit.

Both Q4 elements also pass more of a short wave with its sign reversed. Each one's bottoms out at , the minimum of . The 70 px element reaches it at a 49 px period, and the 56.7 px element at 40 px. The window's bottoms out at , at a 41 px period. Figure 10.1-12 plots all three responses.

plot of T, fitted slope over true slope, against wave period from 20 to 400 px. A blue curve for the 15 by 15 window crosses T = 0.5 at 94 px, marked by a blue dot. A solid red curve for a Q4 element with a 70 px side crosses T = 0.5 later, at 116 px, marked by a red dot. A dashed red curve for a Q4 element with a 56.7 px side nearly overlaps the blue curve above T = 0. Below T = 0, both red curves dip to -0.217, the solid one at a 49 px period and the dashed one at 40 px. The blue curve dips only to -0.088, at 41 px. A dotted gray line marks T = 0.5
Figure 10.1-12: Frequency response of a 15x15 window at px against two Q4 elements. The solid red curve has the window's 70 px footprint. The dashed red curve has the side that matches the window's 94 px half-power period. The legend gives each one's standard deviation of . The dots mark where each solid curve keeps half the slope.

Window Edges

Near the grid boundary, the window truncates. Every tracked point still gets a strain. A truncated window loses the cancellations, so and no longer vanish. The matrix is no longer diagonal, and the fit solves the full normal equations. Figure 10.1-13 shows interior, edge, and corner windows for .

three panels showing a 7 by 7 window near the top-left corner of a grid of gray dots, with the area outside the grid shaded. Interior: 49 filled orange points, the window center and centroid coincide, std factor 1.00. Edge: the window centers on a point in the left column, 21 points fall outside the grid as hollow circles, 28 remain, the red centroid cross sits 1.5 columns right of the center, std factor 2.37. Corner: 33 points fall outside, 16 remain, the centroid sits 1.5 columns right and 1.5 rows down, std factor 3.13
Figure 10.1-13: Interior, edge, and corner windows for . Filled points enter the fit. Hollow points fall outside the grid. The square marks the window center, where the strain is reported. The red cross marks the centroid of the kept points, where the fit measures the gradient. Each title gives the standard deviation of relative to the interior window.

Truncation has two costs. It loses precision, and it moves where the fit measures the gradient. Take the gradient of a window that lost its half, with columns left.

Variance. The slope variance is divided by , where is the mean column of the kept points. That sum falls from to . The standard deviation rises by the factor

At , the factor is 2.58. At a corner, the window also keeps only rows. The factor becomes

which is 3.54 at . At , the factors are 2.37 and 3.13, as Figure 10.1-13 shows.

In units of , a 15x15 window's standard deviation is 0.0154 in the interior, 0.0398 on an edge, and 0.0545 at a corner. The Q4 element gives 1.155. The edge value is 29 times lower than that. The corner value is 21 times lower.

Location. The fitted slope is a weighted average of the true gradient over the kept points, as Equation 10.1-19 shows. The weights peak at the kept points' centroid and fall to zero at their ends. In a full window, that centroid is the window center. In a truncated window, it sits inward. At and px, that is 17.5 px. So an edge point reports the strain averaged around a point 17.5 px inside the specimen. If the strain grows by per pixel toward the edge, the edge value reads too low.

Uniform stretch has , so this bias vanishes there. At a hole or a notch, the strain peaks at the edge, so the window underreports the peak.

Overlapping Windows

A window can step by 1 point, so every tracked point gets a strain. Or it can step by points, so no two windows share a point.

At a step of 1, neighboring windows share of their points. For , that is 210 of 225. Their errors correlate. The standard deviation across the field then describes the spread of the strain field. It does not describe the uncertainty of independent measurements. Every field spread on this page names its step.

Measured Result

dictk.strain_window.log_strains runs the window on Kernel Warping's tracked positions. The grid has 53x54 points at 5 px spacing. The current image stretches the reference 2% in , so the true is microstrain. The window has , so . It steps by 1 point. The Q4 row repeats Kernel Warping's baseline on the same positions.

SourcePointsMean (µε)Std (µε)Min (µε)Max (µε)
Q4, Gauss points110241985111611656223160
Q4, interior Gauss points59281985511811656223160
15x15 window, all points286219769911946520047
15x15 window, interior156019803391969819903
15x15 window, truncated1302197301171946520047
Analytical, 198030

Each of the interior row's 1560 points has a full 15x15 window. Their standard deviation is 39 microstrain. Q4 gives 1161 microstrain on the same positions, so the window cuts the spread . Over the same interior region, Q4 gives 1181 microstrain, so the holds for matched points too. The interior mean matches to within 1 microstrain. The Q4 mean sits 48 microstrain above it.

The 39 microstrain leaves out 45.5% of the grid. Those 1302 points sit within 7 points of an edge, so their windows truncate. Their standard deviation is 117 microstrain, 3.0 times the interior value. Their mean sits 73 microstrain below . Over all 2862 points, the standard deviation is 91 microstrain. A full strain field includes its edges, so 91 microstrain is the spread a reader of that field sees.

Strain Field

Figure 10.1-14 redraws Kernel Warping's Q4 field next to the 15x15 window's field. Both panels use the VIC-2D colorbar from Kernel Warping, from 17560 to 22360 microstrain in 16 bands:

SourceInside colorbarBands touched
locate_warp + Q497.4%16 of 16
locate_warp + 15x15 window100.0%3 of 16

Each colorbar band spans 300 microstrain.

two strain maps over the gray speckled current image, sharing one 16-band VIC-2D colorbar from 17560 to 22360 microstrain. Left: the Q4 field at 11024 Gauss points shows vertical stripes in every color from magenta to red. Right: the 15x15 window field at 2862 points is a single mint-green band, 19660 to 19960 microstrain, across the interior. A cyan stripe covers grid columns 2 to 4 near the left edge, and column 0 is a brighter green. A cyan stripe covers columns 47 to 52 along the right edge
Figure 10.1-14: on Kernel Warping's tracked positions, over the current image. (a) Q4 elements at 11024 Gauss points. (b) The 15x15 window at 2862 tracked points. Both panels share VIC-2D's colorbar.

The Q4 field touches all 16 bands, and 2.6% of its Gauss points fall outside the colorbar. The window field touches 3 bands. All 1560 of its interior points fall in one band, from 19660 to 19960 microstrain. The cyan stripes along the left and right sides are truncated columns. Each interior square in panel (b) comes from a fit to 225 tracked positions. Each Q4 Gauss point in panel (a) comes from 4.

Edges and Corners

Window Edges predicts how truncation raises the spread for independent errors. The table tests that prediction on the measured field. It groups the 2862 points by distance to the grid boundary. counts columns to the nearest left or right edge. counts rows to the nearest top or bottom edge. Both stop at , where the window no longer truncates. The table reports the root-mean-square (RMS) error of against . The RMS includes bias, and the standard deviation does not. The independent prediction comes from std_factors. The last column gives the largest fraction of a 51 px wave's slope that each window passes, over all phases of the wave.

WindowPointsRMS error (µε)Measured / interiorIndependent prediction51 px wave slope passed
interior771560391.001.001.7%
edge07801584.032.5852.3%
near edge17801924.882.1642.5%
near edge27802355.981.8433.0%
near edge37802376.041.6024.1%
near edge47801804.571.4016.0%
near edge57801132.881.248.9%
near edge6780411.041.113.0%
edge7078461.171.371.7%
corner0041874.763.5452.3%

The column-mean displacement error has an RMS of 0.0076 px. A window fit of it predicts the column-mean error with correlation 0.9997.

The independent-error model underpredicts every edge group. At the edge column, , the RMS error is 158 microstrain, 4.03 times the interior's 39. The model predicts 2.58. The worst group sits 3 columns in. Its RMS error is 237 microstrain, 6.04 times the interior. The model predicts 1.60 there.

edges add 17% to the interior RMS. The top and bottom rows give 46 microstrain, 1.17 times the interior, below the predicted 1.37. The 4 corner points give 187 microstrain, 4.76 times the interior, against a predicted 3.54. The corners also sit at . Their 187 microstrain sits within 29 microstrain of the edge's 158.

The tracking error accounts for the gap. Kernel Warping found that the error follows a wave in with a 51 px period. Panel (a) of Figure 10.1-15 shows the strain error as vertical stripes. It depends on , not on . Panel (b) averages each column over the 40 rows with a full window. The column-mean displacement error has an RMS of 0.0076 px. A window fit of that error predicts the column-mean error with correlation 0.9997.

two panels. Left: a map of E11 minus ln 1.02 over the 53 by 54 grid, on a red-blue scale from -338 to +338 microstrain. The error forms vertical stripes. The leftmost column is dark red, the next six columns are blue, and the rightmost seven columns are dark blue. A dashed rectangle encloses the interior points with a full window, where every point stays within 105 microstrain. Right: column-mean E11 error against grid column 0 to 52. Blue dots follow a black line closely. The curve starts at +174 at column 0, dips to -210 at column 3, oscillates between -70 and +58 between the dashed lines at columns 6.5 and 45.5, then falls to -287 at column 50
Figure 10.1-15: (a) The error of a 15x15 window at each tracked point. The dashed rectangle encloses the 1560 points with a full window. (b) The column-mean error over the 40 rows with a full window. The blue dots are measured. The black line is a window fit of the column-mean displacement error. The dashed lines separate truncated columns from full ones.

A full window passes 1.7% of the wave's slope. The 51 px period sits 1.4 px from the window's zero crossing at 52.4 px. A truncated window loses that cancellation. At the edge, it passes up to 52.3%. Three columns in, it passes up to 24.1%. These are upper bounds over the wave's phase. Each group holds only 2 columns, one per side. Its RMS depends on where those 2 columns fall on the wave, so it need not peak at the edge. Here it peaks at .

The truncated points' 73 microstrain mean offset has the same cause. Their columns sample the wave at phases that do not cancel. Within 5 columns of an edge, the RMS error runs 2.9 to 6.0 times the interior's. So a field-wide spread from this tracker should report interior and edge points separately.

Window Size

The 15x15 window gives the smallest interior spread of the 9 windows from 3x3 to 19x19. The sweep below reruns the same positions with from 1 to 9, stepping by 1 point.

The independent-error prediction scales Q4's 1161 microstrain by the window's factor from Noise in a General Window. That scaling sets to microstrain, so px at px. The tracking error is not independent. Its column-mean wave has an RMS of 0.0076 px, against 0.0029 px row to row. So this is fitted to Q4's result. It is not a measured independent tracking error.

The measured-error prediction combines two parts in quadrature. The first part fits each window to the column-mean displacement error from Edges and Corners. The second part treats the row-to-row displacement error as independent. That is an approximation. The table's last column is the discrete of Frequency Response for a 51 px wave.

WindowInterior pointsInterior std (µε)All-points std (µε)Independent prediction (µε)Measured-error prediction (µε) at 51 px
3x3
()
2652 (92.7%)945967410.5926+0.938
5x5
()
2450 (85.6%)751784142.2750+0.800
7x7
()
2256 (78.8%)56560171.8566+0.620
9x9
()
2070 (72.3%)38641243.3385+0.425
11x11
()
1892 (66.1%)21824228.9215+0.241
13x13
()
1722 (60.2%)7912620.774+0.089
15x15
()
1560 (54.5%)399115.534-0.017
17x17
()
1406 (49.1%)7610112.176-0.074
19x19
()
1260 (44.0%)82989.782-0.087

The row-to-row displacement error has a standard deviation of 0.0029 px.

Figure 10.1-16 plots the table's four spread columns.

log-scale plot of the standard deviation of E11 in microstrain against window points per side n from 3 to 19. A solid blue independent-error prediction with dots falls smoothly from 410 at n = 3 to 9.7 at n = 19. Filled orange diamonds for interior points fall from 945 at n = 3 to a minimum of 39 at n = 15, marked by an arrow, then rise to 76 at n = 17 and 82 at n = 19. A dark green dash-dot measured-error prediction passes through the diamonds. Hollow purple triangles for all points sit above the diamonds, with a minimum of 91 at n = 15
Figure 10.1-16: Standard deviation of against window size on Kernel Warping's tracked positions. The orange diamonds use interior points only. The hollow purple triangles use all 2862 points. The blue line assumes independent errors, the same curve as Figure 10.1-8 and Figure 10.1-10 scaled to microstrain. The green dash-dot line comes from the measured displacement error. The arrow marks the 15x15 window's 39 microstrain.

The 39 microstrain is a dip, not a trend. The 13x13 window gives 79 microstrain, and the 17x17 window gives 76. Both are twice the 15x15 value. The 19x19 window gives 82 microstrain, so it averages 1260 points to do worse than 1560 points at . The 51 px column shows why. falls from at to at , and then to at . The window passes the least of the wave's slope at , and that wave dominates the error.

The independent-error prediction misses that shape. It falls at every step, from 410 microstrain at to 9.7 at . The measured spread sits 2.3 times above it at , 2.5 times at , and 8.5 times at . The measured-error prediction stays within 19 microstrain of the measured spread at , and within 5 microstrain from to 19.

The all-points spread also bottoms out at , at 91 microstrain. Its minimum is shallower. The 17x17 and 19x19 windows give 101 and 98 microstrain, because those windows truncate at 1456 and 1602 of the 2862 points.

The best window size depends on the error's period. This tracker's error follows a 51 px wave, and a 15x15 window at 5 px spacing happens to land 1.4 px from that wave's zero crossing. A tracker or image with a different error period would move the dip. Choosing needs a sweep like this one, on data with a known answer.

Continue to Discontinuities.