pivuq.lib

pivuq.lib.construct_subpixel_position_map(im)[source]

Construct sub-pixel position map based on 3-point Gaussian fit stencil.

Parameters:

im (np.ndarray) – Image of size \(N \times M\).

Returns:

X_sub, Y_sub – Subpixel position map of size \(N \times M\).

Return type:

np.ndarray

pivuq.lib.disparity_ensemble_statistics(D, c, weights, wr, grid_size, coeff, ROI)[source]

Numba accelerated loop for computing the disparity statistics inside a window of radius wr.

Parameters:
  • D (np.ndarray) – Disparity map \(D\) of size \(2 \times N \times M\) defined by Eq. (2) [1].

  • c (np.ndarray) – Disparity weight map \(c\) of size \(N \times M\) defined by Eq. (3) [1].

  • weights (np.ndarray) – Windowing weights of size \(N \times M\) defined by Gaussian or tophat filter.

  • wr (int) – Window radius.

  • ws (int) – Disparity resolution size.

  • coeff (float) – Confidence interval coefficient.

  • ROI (tuple) – Row and column indices of the ROI: (i_min, i_max, j_min, j_max).

Returns:

  • delta (np.ndarray) – Instantaneous error estimation map of size \(2 \times N \times M\) defined by Eq. (3) [1].

  • N (np.ndarray) – Number of peaks inside the window.

  • mu (np.ndarray) – Mean disparity map of size \(2 \times N \times M\) defined by Eq. (3) [1].

  • sigma (np.ndarray) – Standard deviation disparity map of size \(2 \times N \times M\) defined by Eq. (3) [1].

References

pivuq.lib.disparity_vector_computation(warped_image_pair, radius=2.0, sliding_window_size=16)[source]

Python implementation of Sciacchitano-Wieneke-Scarano disparity vector computation algorithm for PIV Uncertainty Quantification by image matching [1].

Parameters:
  • warped_image_pair (np.ndarray) – Warped image pair \(\hat{\mathbf{I}} = (\hat{I}_0, \hat{I}_1)^{\top}\) of size \(2 \times N \times M\).

  • radius (int, default: 2) – Discrete particle position search radius from the centroid defined by \(\varphi\).

  • sliding_window_size (int, default: 16) – Sliding window average subtraction window size.

Returns:

  • D (np.ndarray) – Disparity map \(D\) of size \(2 \times N \times M\) defined by Eq. (2).

  • c (np.ndarray) – Disparity weight map \(c\) of size \(N \times M\) defined by Eq. (3).

pivuq.lib.find_particle(im, ic, jc, radius=1)[source]

Particle peak position finder around the radius of centroid.

Parameters:
  • im (np.ndarray) – Image array of size \(N \times M\).

  • ic (int) – Row and column index of centroid.

  • jc (int) – Row and column index of centroid.

  • radius (int) – Search radius of centroid.

Returns:

Row index and column index of peak.

Return type:

int, int

pivuq.lib.find_peaks(imgPI) ndarray[source]

Particle peak position detection according to Eq. (1) [1].

Parameters:

imgPI (np.ndarray) – Image intensity product \(\Pi\) of size \(N \times M\).

Returns:

Peak map \(\varphi\) of size \(N \times M\).

Return type:

np.ndarray

pivuq.lib.sliding_avg_subtract(im, window_size) ndarray[source]

Perform sliding window average subtraction.

Parameters:
  • im (np.ndarray) – Image of size \(N \times M\).

  • window_size (int) – Window size.

Returns:

Average subtracted image of size \(N \times M\).

Return type:

np.ndarray