public final class PivUtil
extends java.lang.Object
Constructor and Description |
---|
PivUtil() |
Modifier and Type | Method and Description |
---|---|
static javax.media.jai.PlanarImage |
correlate(javax.media.jai.PlanarImage piA,
javax.media.jai.PlanarImage piB)
Calculates the two dimensional cross-correlation function of two images.
|
static void |
createRandomParticleVolumes(java.io.BufferedWriter bwA,
java.io.BufferedWriter bwB,
double vx,
double vy,
double vz,
double a,
double b,
double c,
int np,
double dp,
double w)
Creates random particle position volumes of a Poiseuille flow.
|
static java.lang.String[] |
createReferenceData(java.lang.String outputFileName,
double vx,
double vy,
double vz,
double a,
double b,
double c,
double dp,
double w,
int nsp,
double dsp,
double scaleX,
double scaleY,
int x0,
int y0,
int hx,
int hy,
int nx,
int ny,
double topZ,
boolean header)
Creates reference vector data of a Poiseuille flow.
|
static float[][] |
divideByWeightingFunction(float[][] subCorrMat,
int xOffset,
int yOffset,
int w,
int h)
Divides the correlation matrix by a pyramid weighting function.
|
static double[] |
gaussianPeakFit(float[][] subCorrMat,
int x,
int y)
Gaussian peak fit.
|
static double[] |
gaussianPeakFit(javax.media.jai.PlanarImage subCorrMat,
int i,
int j)
Gaussian peak fit.
|
static double[] |
getGaussianPeak(javax.media.jai.PlanarImage subCorrMat,
int x,
int y,
int w,
int h)
Searches for the highest value in a correlation matrix.
|
static double[] |
getParabolicPeak(javax.media.jai.PlanarImage subCorrMat,
int x,
int y,
int w,
int h)
Searches for the highest value in a correlation matrix.
|
static int[] |
getPeak(float[][] subCorrMat)
Finds the highest value in a correlation matrix.
|
static int[] |
getPeak(float[][] subCorrMat,
int x,
int y,
int w,
int h)
Finds the highest value in a correlation matrix (i=y, j=x)
|
static int[] |
getPeak(javax.media.jai.PlanarImage subCorrMat,
int x,
int y,
int w,
int h)
Finds the highest value in a correlation matrix (i=y, j=x)
|
static int[] |
getPeak(javax.media.jai.PlanarImage subCorrMat,
javax.media.jai.ROI roi)
Finds the highest value in a correlation matrix (i=y, j=x)
|
static double[] |
parabolicPeakFit(float[][] subCorrMat,
int x,
int y)
Parabolic peak fit.
|
static double[] |
parabolicPeakFit(javax.media.jai.PlanarImage subCorrMat,
int i,
int j)
Parabolic peak fit.
|
public static javax.media.jai.PlanarImage correlate(javax.media.jai.PlanarImage piA, javax.media.jai.PlanarImage piB)
piA
- The first image (e.g. interrogation area).piB
- The second image (e.g. interrogation area).public static float[][] divideByWeightingFunction(float[][] subCorrMat, int xOffset, int yOffset, int w, int h)
subCorrMat
- The biased correlation functionxOffset
- If this matrix is merely a search area within a larger
correlation matrix, this is the offset of the search area.yOffset
- If this matrix is merely a search area within a larger
correlation matrix, this is the offset of the search area.w
- Width of the original correlation matrix.h
- Height of the original correlation matrix.public static double[] getGaussianPeak(javax.media.jai.PlanarImage subCorrMat, int x, int y, int w, int h)
subCorrMat
- A single correlation matrix.x
- the x coordinate of the search areay
- the y coordinate of the search areaw
- width of the search areah
- height of the search areapublic static double[] getParabolicPeak(javax.media.jai.PlanarImage subCorrMat, int x, int y, int w, int h)
subCorrMat
- A single correlation matrix.x
- the x coordinate of the search areay
- the y coordinate of the search areaw
- width of the search areah
- height of the search areapublic static int[] getPeak(float[][] subCorrMat, int x, int y, int w, int h)
subCorrMat
- A single correlation matrix.x
- the x coordinate of the search areay
- the y coordinate of the search areaw
- width of the search areah
- height of the search areapublic static int[] getPeak(float[][] subCorrMat)
subCorrMat
- A single correlation matrix.public static int[] getPeak(javax.media.jai.PlanarImage subCorrMat, int x, int y, int w, int h)
subCorrMat
- A single correlation matrix.x
- the x coordinate of the search areay
- the y coordinate of the search areaw
- width of the search areah
- height of the search areapublic static int[] getPeak(javax.media.jai.PlanarImage subCorrMat, javax.media.jai.ROI roi)
subCorrMat
- A single correlation matrix.roi
- Limit the search area to a region of interest.public static double[] gaussianPeakFit(float[][] subCorrMat, int x, int y)
subCorrMat
- some two dimensional data containing a correlation peakx
- the horizontal peak positiony
- the vertical peak positionpublic static double[] gaussianPeakFit(javax.media.jai.PlanarImage subCorrMat, int i, int j)
subCorrMat
- some two dimensional data containing a correlation peaki
- the horizontal peak positionj
- the vertical peak positionpublic static double[] parabolicPeakFit(float[][] subCorrMat, int x, int y)
subCorrMat
- some two dimensional data containg a correlation peakx
- the horizontal position of the correlation peaky
- the vertical position of the correlation peakpublic static double[] parabolicPeakFit(javax.media.jai.PlanarImage subCorrMat, int i, int j)
subCorrMat
- some two dimensional data containg a correlation peaki
- the horizontal position of the correlation peakj
- the vertical position of the correlation peakpublic static void createRandomParticleVolumes(java.io.BufferedWriter bwA, java.io.BufferedWriter bwB, double vx, double vy, double vz, double a, double b, double c, int np, double dp, double w)
bwA
- A buffered writer for the random particle positions.bwB
- A buffered writer for the diplaced particle positions.vx
- The x dimension of the particle volume (real units).vy
- The y dimension of the particle volume (real units).vz
- The z dimension of the particle volume (real units).a
- Eularian nutation angle of the particle volume (rad).b
- Eularian rotation angle of the particle volume (rad).c
- Eularian precession angle of the particle volume (rad).np
- Number of particles.dp
- Maximum displacement (real units).w
- With of flow domain (fraction of vx, vy).public static java.lang.String[] createReferenceData(java.lang.String outputFileName, double vx, double vy, double vz, double a, double b, double c, double dp, double w, int nsp, double dsp, double scaleX, double scaleY, int x0, int y0, int hx, int hy, int nx, int ny, double topZ, boolean header)
outputFileName
- A file name for the output data, will be numbered
automatically.vx
- The x dimension of the particle volume (real units).vy
- The y dimension of the particle volume (real units).vz
- The z dimension of the particle volume (real units).a
- Eularian nutation angle of the particle volume (rad).b
- Eularian rotation angle of the particle volume (rad).c
- Eularian precession angle of the particle volume (rad).dp
- Maximum displacement (real units).w
- Width of flow domain (fraction of vx, vy).nsp
- Number of scan planes.dsp
- distance between scan planes (unit: real).scaleX
- horizontal scaling (pixel/real units).scaleY
- vertical scaling (pixel/real units).(This parameter is just
added for future compatibility. For the moment, pixels are
assumed to be square: scaleX = scaleY = scaleZ)x0
- x-position of first vector.y0
- y-position of first vector.hx
- horizontal vector spacing.hy
- vertical vector spacing.nx
- number of horizontal nodes.ny
- number of vertical nodes.topZ
- position of first (top) scan plane.header
- creates a tecplot header if true.