Commit b851d868 authored by Andrey Filippov's avatar Andrey Filippov

debugging partial kernel generation

parent ed19c6c4
...@@ -619,6 +619,8 @@ public static MatchSimulatedPattern.DistortionParameters DISTORTION =new MatchSi ...@@ -619,6 +619,8 @@ public static MatchSimulatedPattern.DistortionParameters DISTORTION =new MatchSi
addButton("Conf. Multifile",panelConf1,color_configure); addButton("Conf. Multifile",panelConf1,color_configure);
addButton("Conf. Simulation",panelConf1); addButton("Conf. Simulation",panelConf1);
addButton("Conf. Pattern Detection",panelConf1); addButton("Conf. Pattern Detection",panelConf1);
addButton("Waves",panelConf1);
//WavePatternGenerator
add(panelConf1); add(panelConf1);
panelConf2 = new Panel(); panelConf2 = new Panel();
...@@ -1048,6 +1050,11 @@ if (MORE_BUTTONS) { ...@@ -1048,6 +1050,11 @@ if (MORE_BUTTONS) {
} else if (label.equals("Conf. Pattern Detection")) { } else if (label.equals("Conf. Pattern Detection")) {
showPatternDetectParametersDialog(PATTERN_DETECT); showPatternDetectParametersDialog(PATTERN_DETECT);
return; return;
/* ======================================================================== */
} else if (label.equals("Waves")) {
WavePatternGenerator wpg=new WavePatternGenerator();
while(wpg.selectAndGenerate());
return;
/* ======================================================================== */ /* ======================================================================== */
} else if (label.equals("Conf. PSF")) { } else if (label.equals("Conf. PSF")) {
showPSFParametersDialog(PSF_PARS); showPSFParametersDialog(PSF_PARS);
......
...@@ -1798,12 +1798,14 @@ I* - special case when the subcamera is being adjusted/replaced. How to deal wit ...@@ -1798,12 +1798,14 @@ I* - special case when the subcamera is being adjusted/replaced. How to deal wit
500)) return -1; //perPage)) 500)) return -1; //perPage))
case 6: // start from current selection case 6: // start from current selection
selection=selected.clone(); selection=selected.clone();
break;
case 5: // start from empty selection case 5: // start from empty selection
if (!selectImageSets( if (!selectImageSets(
selection, selection,
false, // allImages, false, // allImages,
0, // star iIndex 0, // star iIndex
500)) return -1; //perPage)) 500)) return -1; //perPage))
break;
} }
for (int i=0;i<selection.length;i++) selection[i] &= requiredMatchedPointers[mapMP.get(new Integer(matchedPointers[i]))]; for (int i=0;i<selection.length;i++) selection[i] &= requiredMatchedPointers[mapMP.get(new Integer(matchedPointers[i]))];
for (int i=0;i<selection.length;i++) selection[i] &= requiredHintedMatch[mapHM.get(new Integer(hintedMatch[i]))]; for (int i=0;i<selection.length;i++) selection[i] &= requiredHintedMatch[mapHM.get(new Integer(hintedMatch[i]))];
......
...@@ -5770,7 +5770,8 @@ public class MatchSimulatedPattern { ...@@ -5770,7 +5770,8 @@ public class MatchSimulatedPattern {
double [] xyc={ double [] xyc={
this.PATTERN_GRID[v][u][0][0], this.PATTERN_GRID[v][u][0][0],
this.PATTERN_GRID[v][u][0][1], this.PATTERN_GRID[v][u][0][1],
(this.gridContrastBrightness==null)?1.0:this.gridContrastBrightness[0][v][u] (this.PATTERN_GRID[v][u][0].length>2)?this.PATTERN_GRID[v][u][0][2]:
((this.gridContrastBrightness==null)?1.0:this.gridContrastBrightness[0][v][u])
}; };
return xyc; // this.PATTERN_GRID[uv[1]][uv[0]][0]; return xyc; // this.PATTERN_GRID[uv[1]][uv[0]][0];
} }
...@@ -5779,7 +5780,8 @@ public class MatchSimulatedPattern { ...@@ -5779,7 +5780,8 @@ public class MatchSimulatedPattern {
double [] xyc={ double [] xyc={
this.PATTERN_GRID[uv[1]][uv[0]][0][0], this.PATTERN_GRID[uv[1]][uv[0]][0][0],
this.PATTERN_GRID[uv[1]][uv[0]][0][1], this.PATTERN_GRID[uv[1]][uv[0]][0][1],
(this.gridContrastBrightness==null)?1.0:this.gridContrastBrightness[0][uv[1]][uv[0]] (this.PATTERN_GRID[uv[1]][uv[0]][0].length>2)?this.PATTERN_GRID[uv[1]][uv[0]][0][2]:
((this.gridContrastBrightness==null)?1.0:this.gridContrastBrightness[0][uv[1]][uv[0]])
}; };
return xyc; // this.PATTERN_GRID[uv[1]][uv[0]][0]; return xyc; // this.PATTERN_GRID[uv[1]][uv[0]][0];
} }
...@@ -6623,7 +6625,7 @@ public class MatchSimulatedPattern { ...@@ -6623,7 +6625,7 @@ public class MatchSimulatedPattern {
* @return {{Au, Bu, Cu}.{Av, Bc, Cv}}; where Umeas=Au*Uhint+Bu*Vhint+Cu, Vmeas=Av*Uhint+Bv*Vhint+Cv * @return {{Au, Bu, Cu}.{Av, Bc, Cv}}; where Umeas=Au*Uhint+Bu*Vhint+Cu, Vmeas=Av*Uhint+Bv*Vhint+Cv
*/ */
public double [][] calcGridMatchMatrix (double [][][] hintGrid, double searchAround){ public double [][] calcGridMatchMatrix (double [][][] hintGrid, double searchAround){
double [][][] measuredUV=mapEstimatedToMeasured(hintGrid, searchAround); double [][][] measuredUV=mapEstimatedToMeasured(hintGrid, searchAround); // contrast - minimal of the ones around
if (this.debugLevel>2){ if (this.debugLevel>2){
double [][] pixels=new double[9][measuredUV.length*measuredUV[0].length]; double [][] pixels=new double[9][measuredUV.length*measuredUV[0].length];
int index=0; int index=0;
...@@ -7247,6 +7249,31 @@ y=xy0[1] + dU*deltaUV[0]*(xy1[1]-xy0[1])+dV*deltaUV[1]*(xy2[1]-xy0[1]) ...@@ -7247,6 +7249,31 @@ y=xy0[1] + dU*deltaUV[0]*(xy1[1]-xy0[1])+dV*deltaUV[1]*(xy2[1]-xy0[1])
int numNewDefined=0; int numNewDefined=0;
// System.out.println("this.PATTERN_GRID.length="+this.PATTERN_GRID.length+"this.PATTERN_GRID[0.length="+this.PATTERN_GRID[0].length); // System.out.println("this.PATTERN_GRID.length="+this.PATTERN_GRID.length+"this.PATTERN_GRID[0.length="+this.PATTERN_GRID[0].length);
// System.out.println("this.targetUV.length="+this.targetUV.length+"this.targetUV[0.length="+this.targetUV[0].length); // System.out.println("this.targetUV.length="+this.targetUV.length+"this.targetUV[0.length="+this.targetUV[0].length);
if (this.debugLevel>0){
double [][] debugReplace=null;
String [] debugTiltes={"deltaX","deltaY","Contrast", "measX","measY", "targetU","targetV"};
debugReplace=new double[7][this.PATTERN_GRID.length*this.PATTERN_GRID[0].length];
for (int i=0;i<debugReplace.length;i++) Arrays.fill(debugReplace[i],Double.NaN);
for (int v=0;v<this.PATTERN_GRID.length;v++) for (int u=0;u<this.PATTERN_GRID[v].length;u++) {
double [][] cell=this.PATTERN_GRID[v][u];
if ((cell !=null) && (cell.length>0) &&(cell[0] !=null) && (cell[0].length>1)){
int tu=this.targetUV[v][u][0]-minU;
int tv=this.targetUV[v][u][1]-minV;
if ((tu>=0) && (tv>=0) && (tv<grid.length) && (tu<grid[tv].length) && (grid[tv][tu]!=null)) {
int index=v*this.PATTERN_GRID[0].length+u;
debugReplace[0][index]=grid[tv][tu][0]-this.PATTERN_GRID[v][u][0][0];
debugReplace[1][index]=grid[tv][tu][1]-this.PATTERN_GRID[v][u][0][1];
debugReplace[2][index]=this.PATTERN_GRID[v][u][0][2];
debugReplace[3][index]=this.PATTERN_GRID[v][u][0][0];
debugReplace[4][index]=this.PATTERN_GRID[v][u][0][1];
debugReplace[5][index]=tu;
debugReplace[6][index]=tu;
}
}
}
SDFA_INSTANCE.showArrays(debugReplace, this.PATTERN_GRID[0].length, this.PATTERN_GRID.length, true, "replaceGridXYWithProjected", debugTiltes);
}
for (int v=0;v<this.PATTERN_GRID.length;v++) for (int u=0;u<this.PATTERN_GRID[v].length;u++) { for (int v=0;v<this.PATTERN_GRID.length;v++) for (int u=0;u<this.PATTERN_GRID[v].length;u++) {
double [][] cell=this.PATTERN_GRID[v][u]; double [][] cell=this.PATTERN_GRID[v][u];
if ((cell !=null) && (cell.length>0) &&(cell[0] !=null) && (cell[0].length>1)){ if ((cell !=null) && (cell.length>0) &&(cell[0] !=null) && (cell[0].length>1)){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment