xylar / acciv

Advection-corrected Correlation Image Velocimetry
MIT License
6 stars 1 forks source link

Computing correlation location and velocity uncertainty with a given mask? #5

Closed gabyx closed 9 years ago

gabyx commented 9 years ago

Hi Xylar,

I have some related question to the ACCIV output at the end of a pass.

Is it possible to mask the correlation location/velocity uncertainty with a given image mask (binary 0,1) Such that I can then plot the histogram which considers only the values in this mask.

By looking at your plot routines the uncertainties are found in the file

combinedCorrelationTiePoints.h5

which looks as

correlationCoefficients  Dataset {17983}
correlationLocationResiduals Dataset {17983}
correlationVelocityResiduals Dataset {17983}
deltaTs                  Dataset {6}
lowerIndexDeltaT         Dataset {6}
rmsCorrelationLocationUncertainty Dataset {1}
rmsCorrelationVelocityUncertainty Dataset {1}
upperIndexDeltaT         Dataset {6}
x1                       Dataset {17983}
x2                       Dataset {17983}
y1                       Dataset {17983}
y2                       Dataset {17983}

Do the values in correlationVelocityResiduals for example correspond to x,y values in x1 and y1 ? So can I use the x1 and y1 values to look up in the image mask if the value should be masked or not? For what are the values x2,y2?

Thanks for the help!

xylar commented 9 years ago

Hi @gabyx,

The definition of a "tie point" is that it connects the location of a feature in one image (x1,y1) to the location of the same feature in a second image (x2,y2). I would suggest that you mask out a tie point if either (x1,y1) or (x2,y2) is outside your mask (or inside it, depending on if the mask is for "good" or "bad" locations). This should already be happening (tie points should already be thrown out if either end point is masked out), unless the mask you want to use is different from the mask you use on the images in ACCIV.

gabyx commented 9 years ago

Thanks, that makes sens now also according to your paper :-), perfect :-), just wanted to make sure :-) I use a different mask then in ACCIV, I run ACCIV over the whole image, and then mask the stuff :-)

So I do that manually quickly in the way you said :-)

xylar commented 9 years ago

Okay, that's one way to do it. The trouble with not masking the image inside of ACCIV is that the iterative corrections will make use of the bad vectors as well as the good ones, but that will likely only affect the area near the boundary of your particles in your case, so basically the region that would be masked out anyway.