Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[1fcd25]: src / hugin1 / hugin / AutoCtrlPointCreator.cpp Maximize Restore History

Download this file

AutoCtrlPointCreator.cpp    548 lines (473 with data), 21.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
// -*- c-basic-offset: 4 -*-
/** @file AutoCtrlPointCreator.cpp
*
* @brief implementation of AutoCtrlPointCreator Class
*
* @author Pablo d'Angelo <pablo.dangelo@web.de>
*
* $Id$
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <config.h>
#include "panoinc_WX.h"
#include "panoinc.h"
#include <fstream>
#ifdef __GNUC__
#include <ext/stdio_filebuf.h>
#endif
#include "PT/Panorama.h"
#include "hugin/huginApp.h"
#include "hugin/config_defaults.h"
#include "hugin/AutoCtrlPointCreator.h"
#include "hugin/CommandHistory.h"
#include "base_wx/MyExternalCmdExecDialog.h"
#include "base_wx/platform.h"
#include "base_wx/huginConfig.h"
#include "common/wxPlatform.h"
#include <wx/utils.h>
#include <wx/cmdline.h>
#if defined MAC_SELF_CONTAINED_BUNDLE
#include <wx/dir.h>
#include <CoreFoundation/CFBundle.h>
#endif
using namespace std;
using namespace PT;
using namespace utils;
CPVector AutoCtrlPointCreator::readUpdatedControlPoints(const std::string & file,
PT::Panorama & pano)
{
ifstream stream(file.c_str());
if (! stream.is_open()) {
DEBUG_ERROR("Could not open autopano output: " << file);
return CPVector();
}
Panorama tmpp;
PanoramaMemento newPano;
int ptoVersion = 0;
newPano.loadPTScript(stream, ptoVersion, "");
tmpp.setMemento(newPano);
// create mapping between the panorama images.
map<unsigned int, unsigned int> imgMapping;
for (unsigned int ni = 0; ni < tmpp.getNrOfImages(); ni++) {
std::string nname = stripPath(tmpp.getImage(ni).getFilename());
for (unsigned int oi=0; oi < pano.getNrOfImages(); oi++) {
std::string oname = stripPath(pano.getImage(oi).getFilename());
if (nname == oname) {
// insert image
imgMapping[ni] = oi;
break;
}
}
if (! set_contains(imgMapping, ni)) {
DEBUG_ERROR("Could not find image " << ni << ", name: " << tmpp.getImage(ni).getFilename() << " in autopano output");
return CPVector();
}
}
// get control points
CPVector ctrlPoints = tmpp.getCtrlPoints();
// make sure they are in correct order
for (CPVector::iterator it= ctrlPoints.begin(); it != ctrlPoints.end(); ++it) {
(*it).image1Nr = imgMapping[(*it).image1Nr];
(*it).image2Nr = imgMapping[(*it).image2Nr];
}
return ctrlPoints;
}
CPVector AutoCtrlPointCreator::automatch(CPDetectorSetting &setting,
Panorama & pano,
const UIntSet & imgs,
int nFeatures,
wxWindow *parent)
{
CPVector cps;
int t = setting.GetType();
switch (t) {
case 0:
{
// autopano@kolor
AutoPanoKolor matcher;
cps = matcher.automatch(setting, pano, imgs, nFeatures, parent);
break;
}
case 1:
{
// autopano-sift
AutoPanoSift matcher;
cps = matcher.automatch(setting, pano, imgs, nFeatures, parent);
break;
}
default:
DEBUG_ERROR("Invalid autopano type");
}
return cps;
}
CPVector AutoPanoSift::automatch(CPDetectorSetting &setting, Panorama & pano, const UIntSet & imgs,
int nFeatures, wxWindow *parent)
{
CPVector cps;
if (imgs.size() == 0) {
return cps;
}
// create suitable command line..
#if defined __WXMAC__ && defined MAC_SELF_CONTAINED_BUNDLE
bool customAutopanoExe = setting.GetCPDetectorExeCustom();
wxString autopanoExe = setting.GetProg();
/*#if MAC_AUTOPANO_PLUGIN
wxString autopanoArgs = setting.GetArgs();
#endif
if(!customAutopanoExe)
{
// default is autopano-sift-c, possibly bundled
autopanoExe = MacGetPathToBundledExecutableFile(CFSTR("autopano-sift-c"));
// bundled autopano-sift as backward compatibility with 0.6; deprecated usage.
if(autopanoExe == wxT(""))
{
// check inside the bundle for autopano-sift file
autopanoExe = MacGetPathToBundledResourceFile(CFSTR("autopano-complete-mac.sh"));
wxString autopanoExeDir = MacGetPathToBundledResourceFile(CFSTR("autopano-sift"));
if(autopanoExeDir == wxT("")
|| !wxFileExists(autopanoExeDir+wxT("/autopano.exe"))
|| !wxFileExists(autopanoExeDir+wxT("/generatekeys-sd.exe"))
|| !wxFileExists(autopanoExeDir+wxT("/libsift.dll")) )
{
autopanoExe = wxT("");
}
}
#if MAC_AUTOPANO_PLUGIN
// 'plug-in' architecture; plugins are based on .app bundle.
if(autopanoExe == wxT(""))
{
CFMutableArrayRef autopanoPlugins = CFArrayCreateMutable(kCFAllocatorDefault,0,NULL);
FSRef appSupportFolder;
if(noErr == FSFindFolder(kUserDomain,kApplicationSupportFolderType,kDontCreateFolder,&appSupportFolder))
{
CFURLRef appSupportFolderURL = CFURLCreateFromFSRef(kCFAllocatorDefault,&appSupportFolder);
CFURLRef appSupportHugin = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,appSupportFolderURL,CFSTR("Hugin"),true);
CFURLRef autopanoPluginsURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,appSupportHugin,CFSTR("Autopano"),true);
CFArrayRef newPlugins = CFBundleCreateBundlesFromDirectory(kCFAllocatorDefault,autopanoPluginsURL,CFSTR("huginAutoCP"));
if(CFArrayGetCount(newPlugins) > 0)
CFArrayAppendArray(autopanoPlugins, newPlugins, (CFRange){0,CFArrayGetCount(newPlugins)});
CFRelease(appSupportFolderURL);
CFRelease(appSupportHugin);
CFRelease(autopanoPluginsURL);
CFRelease(newPlugins);
}
if(noErr == FSFindFolder(kLocalDomain,kApplicationSupportFolderType,kDontCreateFolder,&appSupportFolder))
{
CFURLRef appSupportFolderURL = CFURLCreateFromFSRef(kCFAllocatorDefault,&appSupportFolder);
CFURLRef appSupportHugin = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,appSupportFolderURL,CFSTR("Hugin"),true);
CFURLRef autopanoPluginsURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,appSupportHugin,CFSTR("Autopano"),true);
CFArrayRef newPlugins = CFBundleCreateBundlesFromDirectory(kCFAllocatorDefault,autopanoPluginsURL,CFSTR("huginAutoCP"));
if(CFArrayGetCount(newPlugins) > 0)
CFArrayAppendArray(autopanoPlugins, newPlugins, (CFRange){0,CFArrayGetCount(newPlugins)});
CFRelease(appSupportFolderURL);
CFRelease(appSupportHugin);
CFRelease(autopanoPluginsURL);
CFRelease(newPlugins);
}
wxArrayString autopanoPackages;
wxArrayString autopanoPaths;
wxArrayString autopanoArguments;
while(CFArrayGetCount(autopanoPlugins) > 0)
{
CFBundleRef pluginBundle = (CFBundleRef)CFArrayGetValueAtIndex(autopanoPlugins,0);
CFURLRef executableURL = CFBundleCopyExecutableURL(pluginBundle);
if(executableURL != NULL)
{
CFURLRef absURL = CFURLCopyAbsoluteURL(executableURL);
CFStringRef pathInCFString = CFURLCopyFileSystemPath(absURL, kCFURLPOSIXPathStyle);
autopanoPaths.Add(wxMacCFStringHolder(pathInCFString).AsString(wxLocale::GetSystemEncoding()));
CFRelease(executableURL);
CFRelease(absURL);
CFStringRef pluginName = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(pluginBundle,CFSTR("CFBundleName"));
CFRetain(pluginName);
CFStringRef pluginVersion = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(pluginBundle,CFSTR("CFBundleShortVersionString"));
CFRetain(pluginVersion);
autopanoPackages.Add(wxMacCFStringHolder(pluginName).AsString(wxLocale::GetSystemEncoding())
+ wxT(" (")+ wxMacCFStringHolder(pluginVersion).AsString(wxLocale::GetSystemEncoding()) + wxT(")"));
CFStringRef autoCPArgs = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(pluginBundle,CFSTR("HginAutoCPArgs"));
CFRetain(autoCPArgs);
autopanoArguments.Add(wxMacCFStringHolder(autoCPArgs).AsString(wxLocale::GetSystemEncoding()));
}
CFArrayRemoveValueAtIndex(autopanoPlugins,0);
CFRelease(pluginBundle);
}
CFRelease(autopanoPlugins);
if(autopanoPackages.Count() < 1) {
autopanoExe = wxT("");
} else {
int choice = 0;
if(autopanoPackages.Count() > 1)
{
choice = wxGetSingleChoiceIndex(_("Choose which autopano program should be used\n"),
_("Autopano"),
autopanoPackages, parent);
// cancel
if(choice == -1)
return cps;
}
autopanoExe = autopanoPaths.Item(choice);
autopanoArgs = autopanoArguments.Item(choice);
}
}
#endif
// default case; message is not exactly appropriate, but strings closed for 0.7 release
if(autopanoExe == wxT(""))
{
wxMessageBox(wxT(""), _("Autopano-SIFT not found. Please specify a valid path in the preferences"), wxOK | wxICON_ERROR, parent);
return cps;
}
} else { */
if(wxIsAbsolutePath(autopanoExe) && !wxFileExists(autopanoExe)) {
wxMessageBox(wxT(""), _("Autopano-SIFT not found. Please specify a valid path in the preferences"), wxOK | wxICON_ERROR, parent);
return cps;
}
/* } */
#elif defined __WXMSW__
wxString autopanoExe = setting.GetProg();
wxFileName autopano(autopanoExe);
if(autopano.IsAbsolute())
{
if(!autopano.FileExists()) {
wxLogError(wxString::Format(_("\"%s\" not found. Please specify a valid path in the preferences"),autopanoExe));
return cps;
}
}
#else
// autopano should be in the path on linux
wxString autopanoExe = setting.GetProg();
#endif
#if !MAC_AUTOPANO_PLUGIN
wxString autopanoArgs = setting.GetArgs();
#endif
#ifdef __WXMSW__
// remember cwd.
wxString cwd = wxGetCwd();
wxString apDir = wxPathOnly(autopanoExe);
if (apDir.Length() > 0) {
wxSetWorkingDirectory(apDir);
}
#endif
// TODO: create a secure temporary filename here
wxString ptofile = wxFileName::CreateTempFileName(wxT("ap_res"));
autopanoArgs.Replace(wxT("%o"), ptofile);
wxString tmp;
tmp.Printf(wxT("%d"), nFeatures);
autopanoArgs.Replace(wxT("%p"), tmp);
SrcPanoImage firstImg = pano.getSrcImage(*imgs.begin());
tmp.Printf(wxT("%f"), firstImg.getHFOV());
autopanoArgs.Replace(wxT("%v"), tmp);
tmp.Printf(wxT("%d"), (int) firstImg.getProjection());
autopanoArgs.Replace(wxT("%f"), tmp);
// build a list of all image files, and a corrosponding connection map.
// local img nr -> global (panorama) img number
std::map<int,int> imgMapping;
long idx = autopanoArgs.Find(wxT("%namefile")) ;
DEBUG_DEBUG("find %namefile in '"<< autopanoArgs.mb_str(wxConvLocal) << "' returned: " << idx);
bool use_namefile = idx >=0;
idx = autopanoArgs.Find(wxT("%i"));
DEBUG_DEBUG("find %i in '"<< autopanoArgs.mb_str(wxConvLocal) << "' returned: " << idx);
bool use_params = idx >=0;
idx = autopanoArgs.Find(wxT("%s"));
bool use_inputscript = idx >=0;
if (! (use_namefile || use_params || use_inputscript)) {
wxMessageBox(_("Please use %namefile, %i or %s to specify the input files for autopano-sift"),
_("Error in Autopano command"), wxOK | wxICON_ERROR,parent);
return cps;
}
wxFile namefile;
wxString namefile_name;
if (use_namefile) {
// create temporary file with image names.
namefile_name = wxFileName::CreateTempFileName(wxT("ap_imgnames"), &namefile);
DEBUG_DEBUG("before replace %namefile: " << autopanoArgs.mb_str(wxConvLocal));
autopanoArgs.Replace(wxT("%namefile"), namefile_name);
DEBUG_DEBUG("after replace %namefile: " << autopanoArgs.mb_str(wxConvLocal));
int imgNr=0;
for(UIntSet::const_iterator it = imgs.begin(); it != imgs.end(); it++)
{
imgMapping[imgNr] = *it;
namefile.Write(wxString(pano.getImage(*it).getFilename().c_str(), HUGIN_CONV_FILENAME));
namefile.Write(wxT("\r\n"));
imgNr++;
}
// close namefile
if (namefile_name != wxString(wxT(""))) {
namefile.Close();
}
} else {
string imgFiles;
int imgNr=0;
for(UIntSet::const_iterator it = imgs.begin(); it != imgs.end(); it++)
{
imgMapping[imgNr] = *it;
imgFiles.append(" ").append(quoteFilename(pano.getImage(*it).getFilename()));
imgNr++;
}
autopanoArgs.Replace(wxT("%i"), wxString (imgFiles.c_str(), HUGIN_CONV_FILENAME));
}
wxString ptoinfile_name;
if (use_inputscript) {
wxFile ptoinfile;
ptoinfile_name = wxFileName::CreateTempFileName(wxT("ap_inproj"));
autopanoArgs.Replace(wxT("%s"), ptoinfile_name);
ofstream ptoinstream(ptoinfile_name.mb_str(wxConvFile));
pano.printPanoramaScript(ptoinstream, pano.getOptimizeVector(), pano.getOptions(), imgs, false);
}
#ifdef __WXMSW__
if (autopanoArgs.size() > 32000) {
wxMessageBox(_("autopano command line too long.\nThis is a windows limitation\nPlease select less images, or place the images in a folder with\na shorter pathname"),
_("Too many images selected"),
wxCANCEL | wxICON_ERROR, parent );
return cps;
}
#endif
wxString cmd = autopanoExe + wxT(" ") + autopanoArgs;
DEBUG_DEBUG("Executing: " << autopanoExe.mb_str(wxConvLocal) << " " << autopanoArgs.mb_str(wxConvLocal));
wxArrayString arguments = wxCmdLineParser::ConvertStringToArgs(autopanoArgs);
if (arguments.GetCount() > 127) {
DEBUG_ERROR("Too many arguments for call to wxExecute()");
DEBUG_ERROR("Try using the %s parameter in preferences");
wxMessageBox( _("Too many arguments (images). Try using the %s parameter in preferences.\n\n Could not execute command: " + autopanoExe), _("wxExecute Error"), wxOK | wxICON_ERROR, parent);
return cps;
}
int ret = 0;
// use MyExternalCmdExecDialog
ret = MyExecuteCommandOnDialog(autopanoExe, autopanoArgs, parent, _("finding control points"));
if (ret == -1) {
wxMessageBox( _("Could not execute command: " + cmd), _("wxExecute Error"), wxOK | wxICON_ERROR, parent);
return cps;
} else if (ret > 0) {
wxMessageBox(_("command: ") + cmd +
_("\nfailed with error code: ") + wxString::Format(wxT("%d"),ret),
_("wxExecute Error"), wxOK | wxICON_ERROR, parent);
return cps;
}
if (! wxFileExists(ptofile.c_str())) {
wxMessageBox(wxString(_("Could not open ")) + ptofile + _(" for reading\nThis is an indicator that the autopano call failed,\nor wrong command line parameters have been used.\n\nAutopano command: ")
+ cmd, _("autopano failure"), wxOK | wxICON_ERROR, parent );
return cps;
}
// read and update control points
cps = readUpdatedControlPoints((const char *)ptofile.mb_str(HUGIN_CONV_FILENAME), pano);
#ifdef __WXMSW__
// set old cwd.
wxSetWorkingDirectory(cwd);
#endif
if (namefile_name != wxString(wxT(""))) {
namefile.Close();
wxRemoveFile(namefile_name);
}
if (ptoinfile_name != wxString(wxT(""))) {
wxRemoveFile(ptoinfile_name);
}
if (!wxRemoveFile(ptofile)) {
DEBUG_DEBUG("could not remove temporary file: " << ptofile.c_str());
}
return cps;
}
CPVector AutoPanoKolor::automatch(CPDetectorSetting &setting, Panorama & pano, const UIntSet & imgs,
int nFeatures, wxWindow *parent)
{
CPVector cps;
#ifdef __WXMSW__
wxString autopanoExe = setting.GetProg();
if(!wxFileExists(autopanoExe)) {
wxLogError(wxString::Format(_("%s not found. Please specify a valid path in the preferences"),autopanoExe));
return cps;
}
#else
// todo: selection of autopano on linux..
wxString autopanoExe = setting.GetProg();
#endif
// write default autopano.kolor.com flags
wxString autopanoArgs = setting.GetArgs();
// build a list of all image files, and a corrosponding connection map.
// local img nr -> global (panorama) img number
std::map<int,int> imgMapping;
string imgFiles;
int imgNr=0;
for(UIntSet::const_iterator it = imgs.begin(); it != imgs.end(); it++)
{
imgMapping[imgNr] = *it;
imgFiles.append(" ").append(quoteFilename(pano.getImage(*it).getFilename()));
imgNr++;
}
wxString ptofilepath = wxFileName::CreateTempFileName(wxT("ap_res"));
wxFileName ptofn(ptofilepath);
wxString ptofile = ptofn.GetFullName();
autopanoArgs.Replace(wxT("%o"), ptofile);
wxString tmp;
tmp.Printf(wxT("%d"), nFeatures);
autopanoArgs.Replace(wxT("%p"), tmp);
SrcPanoImage firstImg = pano.getSrcImage(*imgs.begin());
tmp.Printf(wxT("%f"), firstImg.getHFOV());
autopanoArgs.Replace(wxT("%v"), tmp);
tmp.Printf(wxT("%d"), (int) firstImg.getProjection());
autopanoArgs.Replace(wxT("%f"), tmp);
autopanoArgs.Replace(wxT("%i"), wxString (imgFiles.c_str(), HUGIN_CONV_FILENAME));
wxString tempdir = ptofn.GetPath();
autopanoArgs.Replace(wxT("%d"), ptofn.GetPath());
wxString cmd;
cmd.Printf(wxT("%s %s"), utils::wxQuoteFilename(autopanoExe).c_str(), autopanoArgs.c_str());
#ifdef __WXMSW__
if (cmd.size() > 32766) {
wxMessageBox(_("autopano command line too long.\nThis is a windows limitation\nPlease select less images, or place the images in a folder with\na shorter pathname"),
_("Too many images selected"),
wxCANCEL, parent);
return cps;
}
#endif
DEBUG_DEBUG("Executing: " << cmd.c_str());
wxArrayString arguments = wxCmdLineParser::ConvertStringToArgs(cmd);
if (arguments.GetCount() > 127) {
DEBUG_ERROR("Too many arguments for call to wxExecute()");
DEBUG_ERROR("Try using the %s parameter in preferences");
wxMessageBox( _("Could not execute command: " + autopanoExe), _("wxExecute Error"), wxOK | wxICON_ERROR, parent);
return cps;
}
int ret = 0;
// use MyExternalCmdExecDialog
ret = MyExecuteCommandOnDialog(autopanoExe, autopanoArgs, parent, _("finding control points"));
if (ret == HUGIN_EXIT_CODE_CANCELLED) {
return cps;
} else if (ret == -1) {
wxMessageBox( _("Could not execute command: " + cmd), _("wxExecute Error"),
wxOK | wxICON_ERROR, parent);
return cps;
} else if (ret > 0) {
wxMessageBox(_("command: ") + cmd +
_("\nfailed with error code: ") + wxString::Format(wxT("%d"),ret),
_("wxExecute Error"),
wxOK | wxICON_ERROR, parent);
return cps;
}
ptofile = ptofn.GetFullPath();
ptofile.append(wxT("0.oto"));
if (! wxFileExists(ptofile.c_str()) ) {
wxMessageBox(wxString(_("Could not open ")) + ptofile + _(" for reading\nThis is an indicator that the autopano call failed,\nor wrong command line parameters have been used.\n\nAutopano command: ")
+ cmd + _("\n current directory:") +
wxGetCwd(),
_("autopano failure"), wxCANCEL, parent );
return cps;
}
// read and update control points
cps = readUpdatedControlPoints((const char *)ptofile.mb_str(HUGIN_CONV_FILENAME), pano);
if (!wxRemoveFile(ptofile)) {
DEBUG_DEBUG("could not remove temporary file: " << ptofile.c_str());
}
return cps;
}