Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compared the src_c from 3dptv with the multiplane #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 64 additions & 62 deletions PTV/src_c/change_parameter.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/********************************************************************

Author/Copyright: Jochen Willneff
Author/Copyright: Jochen Willneff

Address: Institute of Geodesy and Photogrammetry
ETH - Hoenggerberg
CH - 8093 Zurich
Address: Institute of Geodesy and Photogrammetry
ETH - Hoenggerberg
CH - 8093 Zurich

Creation Date: October'97
Creation Date: October'97

Description: editing of parameter files
Description: editing of parameter files

Routines contained: parameter_panel_init, done_proc_c
Routines contained: parameter_panel_init, done_proc_c

*********************************************************************/

Expand All @@ -24,16 +24,17 @@ See the file license.txt for copying permission.
#include "ptv.h"

/********************************************************************/
/* parameter_panel_init : initializes the parameter panel */
/* parameter_panel_init : initializes the parameter panel */
/********************************************************************/

int parameter_panel_init(Tcl_Interp* interp)
{
char val[256];
char val[256];

/* read 20 parameters from ptvppar */
/* read 21 parameters from ptv.par */

fp1 = fopen_r ("parameters/ptv.par");
fp1 = fopen_rp ("parameters/ptv.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "mp", "ncam", val, TCL_GLOBAL_ONLY);
Expand Down Expand Up @@ -79,9 +80,10 @@ int parameter_panel_init(Tcl_Interp* interp)
Tcl_SetVar2(interp, "mp", "thicknessglass", val, TCL_GLOBAL_ONLY);
fclose (fp1);

/* read 15 parameters from targ_rec.par */
/* read 16 parameters from targ_rec.par */

fp1 = fopen_r ("parameters/targ_rec.par");
fp1 = fopen_rp ("parameters/targ_rec.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "mp", "partgv1", val, TCL_GLOBAL_ONLY);
Expand Down Expand Up @@ -118,15 +120,18 @@ int parameter_panel_init(Tcl_Interp* interp)
fclose (fp1);


fp1 = fopen_r ("parameters/pft_version.par");
fscanf (fp1, "%s", val);
fp1 = fopen_rp ("parameters/pft_version.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "mp", "target", val, TCL_GLOBAL_ONLY);
fclose (fp1);


/* read 12 parameters from criteria.par */

fp1 = fopen_r ("parameters/criteria.par");
fp1 = fopen_rp ("parameters/criteria.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "mp", "xmin", val, TCL_GLOBAL_ONLY);
Expand Down Expand Up @@ -157,7 +162,8 @@ int parameter_panel_init(Tcl_Interp* interp)

/* read 6 parameters from sequence.par */

fp1 = fopen_r ("parameters/sequence.par");
fp1 = fopen_rp ("parameters/sequence.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "mp", "basename1", val, TCL_GLOBAL_ONLY);
Expand All @@ -176,7 +182,8 @@ int parameter_panel_init(Tcl_Interp* interp)

/* read 12 parameters from cal_ori.par */

fp1 = fopen_r ("parameters/cal_ori.par");
fp1 = fopen_rp ("parameters/cal_ori.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "cp", "platecoord", val, TCL_GLOBAL_ONLY);
Expand Down Expand Up @@ -207,7 +214,8 @@ int parameter_panel_init(Tcl_Interp* interp)

/* read 13 parameters from detect_plate.par */

fp1 = fopen_r ("parameters/detect_plate.par");
fp1 = fopen_rp ("parameters/detect_plate.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "cp", "partgv1", val, TCL_GLOBAL_ONLY);
Expand Down Expand Up @@ -242,7 +250,8 @@ int parameter_panel_init(Tcl_Interp* interp)

/* read 16 parameters from man_ori.par */

fp1 = fopen_r ("parameters/man_ori.par");
fp1 = fopen_rp ("parameters/man_ori.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "cp", "p11", val, TCL_GLOBAL_ONLY);
Expand Down Expand Up @@ -280,8 +289,9 @@ int parameter_panel_init(Tcl_Interp* interp)
fclose (fp1);


fp1 = fopen_r ("parameters/shaking.par");

fp1 = fopen_rp ("parameters/shaking.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "cp", "first_shake", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Expand All @@ -296,7 +306,8 @@ int parameter_panel_init(Tcl_Interp* interp)

/* read 11 parameters from orient.par */

fp1 = fopen_r ("parameters/orient.par");
fp1 = fopen_rp ("parameters/orient.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "cp", "pnrori", val, TCL_GLOBAL_ONLY);
Expand Down Expand Up @@ -325,19 +336,21 @@ int parameter_panel_init(Tcl_Interp* interp)

fclose (fp1);



fp1 = fopen_r ("parameters/examine.par");
fp1 = fopen_rp ("parameters/examine.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "cp", "examineFlag", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "cp", "combineFlag", val, TCL_GLOBAL_ONLY);
fclose (fp1);


/* read 5 parameters from track.par */
/* read 22 parameters from track.par */

fp1 = fopen_r ("parameters/track.par");
fp1 = fopen_rp ("parameters/track.par"); // replaced fopen_r, ad holten 12-2012
if (! fp1) return TCL_OK;

fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "dvxmin", val, TCL_GLOBAL_ONLY);
Expand Down Expand Up @@ -365,47 +378,43 @@ int parameter_panel_init(Tcl_Interp* interp)
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "dnx", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "dny", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "dny", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
*/

/* 5 textboxes */
Tcl_SetVar2(interp, "tp", "maxnum", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "maxnum", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "deltat", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "deltat", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "vmax", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "vmax", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "linktol", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "linktol", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "jumptol", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "jumptol", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
/* 8 checkboxes */
Tcl_SetVar2(interp, "tp", "gluing", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "gluing", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "track", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "track", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "iterate", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "iterate", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "remkin", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "remkin", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "wbin", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "wbin", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "wtraj", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "wtraj", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "output", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "output", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);
Tcl_SetVar2(interp, "tp", "camconfig", val, TCL_GLOBAL_ONLY);
Tcl_SetVar2(interp, "tp", "camconfig", val, TCL_GLOBAL_ONLY);
fscanf (fp1, "%s", val);




fclose (fp1);

/* changed parameters are read out all together not before "done_proc_c" */

return TCL_OK;
return TCL_OK;
}


Expand All @@ -420,9 +429,7 @@ int done_proc_c(ClientData clientData, Tcl_Interp* interp, int argc, const char*
{
const char *valp;


/* rewrite all parameter files */

fp1 = fopen ("parameters/ptv.par", "w");

valp = Tcl_GetVar2(interp, "mp", "ncam", TCL_GLOBAL_ONLY);
Expand All @@ -445,7 +452,7 @@ int done_proc_c(ClientData clientData, Tcl_Interp* interp, int argc, const char*
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "highpass", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "allCam", TCL_GLOBAL_ONLY);
valp = Tcl_GetVar2(interp, "mp", "allCam", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "tiff", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
Expand All @@ -465,10 +472,9 @@ int done_proc_c(ClientData clientData, Tcl_Interp* interp, int argc, const char*
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "water", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "thicknessglass", TCL_GLOBAL_ONLY);
valp = Tcl_GetVar2(interp, "mp", "thicknessglass", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);


fclose (fp1);


Expand Down Expand Up @@ -496,7 +502,7 @@ int done_proc_c(ClientData clientData, Tcl_Interp* interp, int argc, const char*
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "pmaxnpixy", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "psumgv", TCL_GLOBAL_ONLY);
valp = Tcl_GetVar2(interp, "mp", "psumgv", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "pcrossize", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
Expand All @@ -510,13 +516,12 @@ int done_proc_c(ClientData clientData, Tcl_Interp* interp, int argc, const char*
fclose (fp1);

fp1 = fopen ("parameters/pft_version.par", "w");
valp = Tcl_GetVar2(interp, "mp", "target", TCL_GLOBAL_ONLY);
valp = Tcl_GetVar2(interp, "mp", "target", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
fclose (fp1);

fp1 = fopen ("parameters/criteria.par", "w");


valp = Tcl_GetVar2(interp, "mp", "xmin", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "xminzmin", TCL_GLOBAL_ONLY);
Expand All @@ -529,17 +534,17 @@ int done_proc_c(ClientData clientData, Tcl_Interp* interp, int argc, const char*
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "xmaxzmax", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "nx", TCL_GLOBAL_ONLY);
valp = Tcl_GetVar2(interp, "mp", "nx", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "ny", TCL_GLOBAL_ONLY);
valp = Tcl_GetVar2(interp, "mp", "ny", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "npix", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "sgv", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "mincorr", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "mp", "tolepi", TCL_GLOBAL_ONLY);
valp = Tcl_GetVar2(interp, "mp", "tolepi", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);

fclose (fp1);
Expand Down Expand Up @@ -621,11 +626,10 @@ int done_proc_c(ClientData clientData, Tcl_Interp* interp, int argc, const char*
fprintf (fp1, "%s\n", valp);
valp = Tcl_GetVar2(interp, "cp", "ppcrossize", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);


fclose (fp1);

fp1 = fopen ("parameters/man_ori.par", "w");

valp = Tcl_GetVar2(interp, "cp", "p11", TCL_GLOBAL_ONLY);
Expand Down Expand Up @@ -715,7 +719,6 @@ int done_proc_c(ClientData clientData, Tcl_Interp* interp, int argc, const char*
fclose (fp1);



fp1 = fopen ("parameters/track.par", "w");

valp = Tcl_GetVar2(interp, "tp", "dvxmin", TCL_GLOBAL_ONLY);
Expand Down Expand Up @@ -775,7 +778,6 @@ int done_proc_c(ClientData clientData, Tcl_Interp* interp, int argc, const char*
valp = Tcl_GetVar2(interp, "tp", "camconfig", TCL_GLOBAL_ONLY);
fprintf (fp1, "%s\n", valp);


fclose (fp1);
return TCL_OK;
return TCL_OK;
}
Loading