if i just call this while the code is running not thing happens
polynomial_fit_bicubic.correlate(training_dataSet);
if i re-initialsie everything again a couple of times it crashes. see attached screenshot
void ofApp::initialiseData(){
//2d x/y points input and 2d pan/tilt values output
training_dataSet.init(2, 2, referencePointSize);
//2d+2d makes a 4th order fit
polynomial_fit_bicubic.init(4, 2, 2,BASIS_SHAPE_TRIANGLE);
//prepare source data arrays
DataType *my_p = training_dataSet.getInput();
DataType *my_Z = training_dataSet.getOutput();
int panList_size = (sizeof(panList)/sizeof(*panList));
int tiltList_size = (sizeof(tiltList)/sizeof(*tiltList));
//fill source data arrays
for(int i=0; i<tiltList_size/3; i++){
my_p[i*2] = (int)tiltList[i*3+0];
my_p[i*2+1] = (int)tiltList[i*3+1];
my_Z[i*2] = panList[i*3+2];
my_Z[i*2+1] = tiltList[i*3+2];
}
polynomial_fit_bicubic.correlate(training_dataSet);
}
my workaround so far is to get one good fit and then generate a look-up-table.
here is the latest code: https://github.com/antimodular/ofxPolyFit-scattered