WVgreens, // wave vectors (same units as the pixels array)
// patternDetectParameters.corrRingWidth, // ring (around r=0.5 dist to opposite corr) width
0.1, // contrastSelectSigma
0.5, // contrastAverageSigma
2.0, // distortionParameters.contrastSelectSigmaCenter, // Gaussian sigma to select correlation centers (fraction of UV period), 0.1
0.1, // distortionParameters.contrastSelectSigma, // Gaussian sigma to select correlation centers (fraction of UV period), 0.1
// 0.1, // contrastSelectSigma
// 0.5, // contrastAverageSigma
0.0, // x0, // center coordinates
0.0, //y0,
title)[0]; // title base for optional plots names
...
...
@@ -20320,7 +20331,8 @@ use the result to create a rejectiobn mask - if the energy was high, (multiplica
gd.addNumericField("Correlation minimal contrast for initial search (absolute)", distortionParameters.correlationMinAbsoluteInitialContrast, 3);
gd.addNumericField("Decrease contrast of cells that are too close to the border to be processed in refinement pass", distortionParameters.scaleFirstPassContrast, 3);
gd.addNumericField("Gaussian sigma to select correlation centers (fraction of UV period), 0.1", distortionParameters.contrastSelectSigma, 3);
gd.addNumericField("Gaussian sigma to select correlation center in pixels, 2.0", distortionParameters.contrastSelectSigmaCenter, 3);
gd.addNumericField("Gaussian sigma to select correlation off-centers (fraction of UV period), 0.1", distortionParameters.contrastSelectSigma, 3);
gd.addNumericField("Gaussian sigma to average correlation variations (as contrast reference), 0.5", distortionParameters.contrastAverageSigma, 3);
beforeXY[0]+=distortionParameters.correlationDx;// offset, X (in pixels)
beforeXY[1]+=distortionParameters.correlationDy;// offset y (in pixels)
...
...
@@ -9203,18 +9002,6 @@ dbgThis=true;
}
}
/*
if ((min_span<uv_threshold) && (window2!=null)) { // trying to increase only twice
thisCorrelationSize*=2;
min_span*=2;
thisWindow=window2;
if ((min_span<uv_threshold) && (window4!=null)) {
thisCorrelationSize*=2;
min_span*=2;
thisWindow=window4;
}
}
*/
setCorrelationSizesUsed(thisCorrelationSize);
if((debug_level>(debug_threshold-2))&&(thisCorrelationSize>distortionParameters.correlationSize))System.out.println("**** u/v span too small, increasing FFT size to "+thisCorrelationSize);
if(fast)centerXY=correlationMaximum(// maybe twice actual size if
modelCorr,
distortionParameters.correlationMaxOffset,
(debug_level>(debug_threshold+0))&&(numNeib==0));// low-pass filtering should already be done
elsecenterXY=correlationMaximum(
modelCorr,
distortionParameters.correlationRadius,
distortionParameters.correlationThreshold,//double threshold, // fraction of maximum (slightly less than 1.0) to limit the top part of the maximum for centroid
if(debug_level>(debug_threshold+0))System.out.println(">---correctedPatternCrossLocation: before x="+IJ.d2s(beforeXY[0],3)+" y="+IJ.d2s(beforeXY[1],3));
if(debug_level>(debug_threshold+0))System.out.println(">+++correctedPatternCrossLocation: after x="+IJ.d2s(result[0],3)+" y="+IJ.d2s(result[1],3));
if((debug_level>(debug_threshold-2))&&(thisCorrelationSize>distortionParameters.correlationSize))System.out.println("**** u/v span too small, increasing FFT size to "+thisCorrelationSize);
RectanglecenterCross=correlationSelection(
beforeXY,// initial coordinates of the pattern cross point
double[]barray=simulationPattern.simulatePatternFullPatternSafe(// Is it the most time-consuming part? should it be done once and then only extraction separate?
if(fast)centerXY_new=correlationMaximum(// maybe twice actual size if
modelCorr_new,
distortionParameters.correlationMaxOffset,
(debug_level>(debug_threshold+0))&&(numNeib==0));// low-pass filtering should already be done
elsecenterXY_new=correlationMaximum(
modelCorr_new,
distortionParameters.correlationRadius,
distortionParameters.correlationThreshold,//double threshold, // fraction of maximum (slightly less than 1.0) to limit the top part of the maximum for centroid
if(fast)centerXY=correlationMaximum(// maybe twice actual size if
modelCorr,
distortionParameters.correlationMaxOffset,
(debug_level>(debug_threshold+0))&&(numNeib==0));// low-pass filtering should already be done
elsecenterXY=correlationMaximum(modelCorr,
elsecenterXY=correlationMaximum(
modelCorr,
distortionParameters.correlationRadius,
distortionParameters.correlationThreshold,//double threshold, // fraction of maximum (slightly less than 1.0) to limit the top part of the maximum for centroid