image¶
Image processing and Mueller matrix operations.
This module provides core image processing functions including Mueller matrix calculations, retardance computation, and principal angle extraction for photoelastic analysis.
image
¶
Image processing and photoelastic forward model functions.
This module contains helper functions for polarimetric image analysis and photoelastic forward modeling, including stress-to-optical transformations.
Functions¶
DoLP(image)
¶
Calculate the Degree of Linear Polarisation (DoLP).
Source code in photoelastimetry/image.py
AoLP(image)
¶
Calculate the Angle of Linear Polarisation (AoLP).
compute_retardance(sigma_xx, sigma_yy, sigma_xy, C, nu, L, wavelength)
¶
Compute retardance for a given stress tensor and material properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma_xx
|
float or array - like
|
Normal stress component in x direction (Pa). |
required |
sigma_yy
|
float or array - like
|
Normal stress component in y direction (Pa). |
required |
sigma_xy
|
float or array - like
|
Shear stress component (Pa). |
required |
C
|
float
|
Stress-optic coefficient for the colour channel (1/Pa). |
required |
nu
|
float
|
Solid fraction (dimensionless). For solid samples, use nu=1.0. For porous samples, this represents the effective optical path length factor relative to sample thickness. |
required |
L
|
float
|
Sample thickness (m). |
required |
wavelength
|
float
|
Wavelength of light (m). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
delta |
float or array - like
|
Retardance (radians). |
Notes
The retardance formula is: δ = (2πCnL/λ) * √[(σ_xx - σ_yy)² + 4σ_xy²] where the principal stress difference determines the birefringence magnitude.
Source code in photoelastimetry/image.py
compute_principal_angle(sigma_xx, sigma_yy, sigma_xy)
¶
Compute the orientation angle of the principal stress direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma_xx
|
float or array - like
|
Normal stress component in x direction (Pa). |
required |
sigma_yy
|
float or array - like
|
Normal stress component in y direction (Pa). |
required |
sigma_xy
|
float or array - like
|
Shear stress component (Pa). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
theta |
float or array - like
|
Principal stress orientation angle (radians). |
Notes
In photoelasticity, the fast axis aligns with the maximum compressive stress direction. This formula gives the angle to the maximum tensile stress (σ_max).
Source code in photoelastimetry/image.py
mueller_matrix(theta, delta)
¶
Compute the Mueller matrix for a birefringent material.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
theta
|
float or array - like
|
Orientation angle of principal stress direction (radians). |
required |
delta
|
float or array - like
|
Retardance (radians). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
M |
ndarray
|
Mueller matrix (4x4) for scalar inputs, or (..., 4, 4) for array inputs. |
Source code in photoelastimetry/image.py
mueller_matrix_sensitivity(theta, delta)
¶
Compute derivatives of Mueller matrix elements with respect to theta and delta.
Returns:
| Name | Type | Description |
|---|---|---|
dM_dtheta |
ndarray(..., 4, 4)
|
|
dM_ddelta |
ndarray(..., 4, 4)
|
|
Source code in photoelastimetry/image.py
compute_stokes_components(I_0, I_45, I_90, I_135)
¶
Compute the Stokes vector components (S0, S1, S2) from intensity measurements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
I_0
|
array - like
|
Intensity at polarizer angle 0 degrees. |
required |
I_45
|
array - like
|
Intensity at polarizer angle 45 degrees. |
required |
I_90
|
array - like
|
Intensity at polarizer angle 90 degrees. |
required |
I_135
|
array - like
|
Intensity at polarizer angle 135 degrees. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
S0 |
array - like
|
Total intensity (sum of orthogonal components). |
S1 |
array - like
|
Linear polarisation along 0-90 degrees. |
S2 |
array - like
|
Linear polarisation along 45-135 degrees. |
Source code in photoelastimetry/image.py
compute_normalized_stokes(S0, S1, S2)
¶
Compute normalized Stokes vector components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
S0
|
array - like
|
Total intensity Stokes parameter. |
required |
S1
|
array - like
|
First linear polarisation Stokes parameter. |
required |
S2
|
array - like
|
Second linear polarisation Stokes parameter. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
S1_hat |
array - like
|
Normalized S1 component (S1/S0). |
S2_hat |
array - like
|
Normalized S2 component (S2/S0). |
Source code in photoelastimetry/image.py
simulate_four_step_polarimetry(sigma_xx, sigma_yy, sigma_xy, C, nu, L, wavelength, S_i_hat, I0=1.0)
¶
Simulate four-step polarimetry using Mueller matrix formalism.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma_xx
|
float or array - like
|
Normal stress component in x direction (Pa). |
required |
sigma_yy
|
float or array - like
|
Normal stress component in y direction (Pa). |
required |
sigma_xy
|
float or array - like
|
Shear stress component (Pa). |
required |
C
|
float
|
Stress-optic coefficient (1/Pa). |
required |
nu
|
float
|
Solid fraction (use 1.0 for solid samples). |
required |
L
|
float
|
Sample thickness (m). |
required |
wavelength
|
float
|
Wavelength of light (m). |
required |
S_i_hat
|
array - like
|
Incoming normalized Stokes vector [S1_hat, S2_hat] or [S1_hat, S2_hat, S3_hat]. |
required |
I0
|
float
|
Incident light intensity (default: 1.0). |
1.0
|
Returns:
| Type | Description |
|---|---|
Four intensity images for analyzer angles 0°, 45°, 90°, 135°
|
|