1 // Copyright 2002, 2003, 2004 David Hilvert <dhilvert@auricle.dyndns.org>,
2 // <dhilvert@ugcs.caltech.edu>
4 /* This file is part of the Anti-Lamenessing Engine.
6 The Anti-Lamenessing Engine is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 The Anti-Lamenessing Engine is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with the Anti-Lamenessing Engine; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #define BETWEEN_SECTIONS "\n"
26 #define HEADER_SPACE ""
31 const char *invocation
;
37 * This function aids in locating the start of help output.
39 void banner(const char *name
) {
42 "***********************************\n"
43 "ALE Help Text, version %s\n"
45 "***********************************\n",
50 help(const char *invocation
, const char *version
) {
51 this->invocation
= invocation
;
52 this->version
= version
;
53 this->help_stream
= stdout
;
57 * Describe how to use this program
63 "Usage: %s [<options>] <original-frame> [<supplemental-frame> ...] <output-file>\n"
64 " or: %s [<help option> ...]\n"
69 "--hu Usage (this message).\n"
70 "--hq Default settings.\n"
72 "--he Exclusion regions.\n"
73 "--ha Alignment (not exposure-related).\n"
74 "--hr Rendering (not exposure-related).\n"
76 "--ht Transformation data files.\n"
77 "--hc Control points.\n"
78 "--hl Filtering (PSFs, rendering chains).\n"
80 "--hi User Interfaces.\n"
81 "--hv Video stream processing (Experimental).\n"
82 "--h3 3D Modeling (Very Experimental).\n"
83 "--hz Undocumented options.\n"
84 "--hA Concatenate all help pages.\n"
86 invocation
, invocation
, invocation
);
95 "--q0 Low quality, high speed. [default]\n"
96 "--qn Low noise, moderate speed.\n"
97 "--q1 Moderate quality and speed; high memory use.\n"
98 "--q2 High quality, low speed.\n"
99 "--qr Range-extended high quality.\n"
103 " --dchain fine:box:1,triangle:2\n"
104 " --achain triangle:2\n"
110 "Low noise defaults:\n"
112 " --dchain sinc*lanc:6\n"
113 " --achain sinc*lanc:6\n"
121 " --dchain median:fine:sinc*lanc:8,triangle:2\n"
122 " --achain triangle:2\n"
130 " --dchain sinc*lanc:8\n"
131 " --achain sinc*lanc:8\n"
137 "Range-extended defaults:\n"
139 " --dchain sinc*lanc:8\n"
140 " --achain sinc*lanc:8\n"
153 "Bit depth options:\n"
155 "--8bpc Write 8 bit per channel output [default]\n"
156 "--16bpc Write 16 bit per channel output\n"
158 "Output format options:\n"
161 "--auto Determine output file type automatically [default]\n"
162 "--raw Write raw PPM output\n"
163 "--plain Write plain PPM output\n"
165 "--raw Write raw PPM output [default]\n"
166 "--plain Write plain PPM output\n"
169 "Incremental output:\n"
171 "--inc Produce incremental output. [default]\n"
172 "--no-inc Don't produce incremental output.\n"
175 "Undefined values:\n"
177 "--def-nn <R> Use nearest-neighbor defined values within\n"
178 " radius <R>, zero outside. Default radius is 0.\n"
186 "Alignment channel options:\n"
188 "--align-all Align images using all color channels\n"
189 "--align-green Align images using the green channel\n"
190 "--align-sum Align images using a sum of channels [default]\n"
192 "Transformation options:\n"
194 "--translation Only adjust the position of images\n"
195 "--euclidean Adjust the position and orientation of images [default]\n"
196 "--projective Use projective transformations. Best quality, but slow.\n"
198 "Alignment following:\n"
200 "--identity Frames align closely with the original frame. [default]\n"
201 "--follow Frames align closely with their immediate predecessor.\n"
203 "Alignment failure:\n"
205 "--fail-optimal Frames beneath threshold are aligned optimally. [default]\n"
206 "--fail-default Frames beneath threshold keep their default alignment.\n"
208 "Transformation file operations:\n"
210 "--trans-load=x Load initial transformation settings from file x\n"
211 "--trans-save=x Save final transformation data in file x\n"
213 "Monte Carlo alignment (see --hq for defaults):\n"
215 "--mc <x> Align using, on average, x%% of available pixels (0 < x < 100)\n"
216 "--no-mc Align using all pixels.\n"
218 "Tunable parameters:\n"
220 "--metric=x Set the alignment error metric exponent. (2 is default)\n"
221 "--threshold=x Min. match threshold; a perfect match is 100. (0 is default)\n"
222 "--perturb-upper=x Perturbation upper bound pixels/arclength (14%% is default)\n"
223 " ('x%%' uses a fraction of the smallest image dimension.)\n"
224 "--perturb-lower=x Perturbation lower bound pixels/arclength (.125 is default)\n"
225 " ('x%%' uses a fraction of the smallest image dimension.)\n"
226 "--rot-upper=x Rotation-specific upper bound in degrees (32.0 is default)\n"
227 "--bda-mult=x Barrel distortion adjustment multiplier (0.0001 is default)\n"
228 "--bda-rate=x Barrel distortion rate of change maximum (0.0004 is default)\n"
229 "--lod-max=x LOD scale factor is max(1, (2^floor(x))/perturb) (1 is def.)\n"
231 "Certainty-weighted alignment:\n"
233 "--cw Weight alignment error by certainty.\n"
234 "--no-cw Don't weight alignment error by certainty. [default]\n"
236 "Alignment weight maps:\n"
238 "--wm <f> <x> <y> Use weight map image <f> at offset (<x>, <y>)\n"
240 "Frequency-weighted alignment:\n"
242 "--fl <h> <v> <a> High-pass filters: horizontal <h>, vertical <v>, average <a>.\n"
243 " Values should fall between 0 (pass all) and 1 (pass none).\n"
246 " NOTE: since this build of ALE does not link with FFTW,\n"
247 " this option is not supported. To use this option,\n"
248 " first re-build with FFTW support.\n"
251 "--flshow <o> Write high-pass filtered data to file <o>.\n"
253 "Algorithmic alignment weighting:\n"
255 "--wmx <e> <r> <d> Write reference <r>, definition <d>, execute `<e> <f> <d>`,\n"
256 " read weights <r> back.\n"
259 " NOTE: since this build was not configured for POSIX,\n"
260 " this option is not supported. To use this option,\n"
261 " first re-build with POSIX=1.\n"
264 "Perturbation Type [experimental]:\n"
266 "--perturb-output Apply perturbations in output image coordinates. [default]\n"
267 "--perturb-source Apply perturbations in source image coordinates.\n"
269 "Global searching:\n"
271 "--gs <type> Set global search to <type>, one of:\n"
272 " local Local alignment only [default]\n"
273 " inner Alignment reference image inner region\n"
274 " outer Alignment reference image outer region\n"
275 " all Union of inner and outer\n"
276 " central inner if below threshold or better; else, outer.\n"
277 " points Align by control points. Ignores gs-mo.\n"
278 "--gs-mo <x> Set <x> pixel min. overlap for global search. (16 is default)\n"
287 "Mimicking ALE 0.6.0 merging and drizzling (see --hl for details):\n"
289 " --dchain triangle:2 approximates merging.\n"
290 " --dchain fine:box:1 approximates drizzling.\n"
294 "--extend Increase image extents to accommodate all pixel data.\n"
295 "--no-extend Don't increase extents; crop to original frame. [default]\n"
297 "Tunable parameters:\n"
299 "--scale=x Scale images by the factor x, where x > 0. (1 is default)\n"
300 "--threshold=x Min. match threshold; a perfect match is 100. (0 is default)\n"
302 "Irani-Peleg iterative solver (see --hq for --ips defaults):\n"
304 "--ips <i> Run <i> iterations. (see also --hx, --hl and --hd)\n"
305 "--ip-mean Use the mean correction [default]\n"
306 "--ip-median Use the median correction\n"
309 "Unsharp Mask (was 'High-frequency Enhancement'):\n"
311 "--usm <m> Apply an unsharp mask with multiplier <m>.\n"
312 " (See also --device, --nlpsf, and --lpsf.)\n"
317 "--bayer <b> Set the bayer pattern to <b>, one of:\n"
318 " (clockwise from top left pixel)\n"
319 " rgbg Red-green-blue-green\n"
320 " gbgr Green-blue-green-red\n"
321 " grgb Green-red-green-blue\n"
322 " bgrg Blue-green-red-green\n"
323 " none RGB-RGB-RGB-RGB\n"
324 " Default is none or device-specific.\n"
326 "Color adjustment:\n"
328 "--exp-mult=c,r,b Adjust all channels by <c>, red by <r>, and blue by <b>.\n"
336 "Point-spread functions (used with --ips; see --hr):\n"
338 "--lpsf <p> Set linear colorspace point-spread function to <p>\n"
339 "--nlpsf <p> Set non-linear colorspace point-spread function to <p>\n"
340 " Available point-spread functions:\n"
342 " circle=<diameter>\n"
345 " <p>+<p> (summation)\n"
346 " <p>^<p> (convolution)\n"
347 " <n>*<p> (multiplication by a scalar <n>)\n"
348 " Default lpsf is either 'box=1.0' or device-specific.\n"
349 " Default nlpsf is either disabled or device-specific.\n"
351 "Incremental rendering chains:\n"
353 "--wt <w> Set weight threshold for defined pixels (default is 0.1).\n"
354 "--dchain <g> Use chain <g> to render the default output.\n"
355 "--ochain <g> <o> Use chain <g> to render output file <o>.\n"
356 "--achain <g> Use chain <g> to render the alignment reference image.\n"
357 "--afilter <s> Use SSF <s> to interpolate points in alignment.\n"
358 "--3d-chain <g> Use chain <g> by default to render 3d output.\n"
360 " triangle:2 ALE 0.6.0 merging (roughly)\n"
361 " fine:box:1 Drizzling (roughly)\n"
362 " fine:sinc*lanc:8 High-frequency preservation\n"
363 " last:nex:sinc*lanc:8 Useful for video stabilization\n"
364 " fine:box:1,triangle:2 Multi-resolution rendering\n"
365 " fine:sinc*lanc:8,sinc*lanc:8 Multi-resolution rendering\n"
366 " More precisely, chains <g> are one of:\n"
367 " <g1>,<g2> Chain <g1> where defined; <g2> elsewhere.\n"
368 " <i> Use rendering invariant <i>.\n"
369 " Rendering invariants <i> are:\n"
370 " avg:<e> Avg. (mean) value using SSFE <e>.\n"
371 " first:<e> First defined value using SSFE <e>.\n"
372 " last:<e> Last defined value using SSFE <e>.\n"
373 " max:<e> Maximum defined value using SSFE <e>.\n"
374 " min:<e> Minimum defined value using SSFE <e>.\n"
375 " median:<e> Median value using SSFE <e>.\n"
376 " <e> Same as avg:<e>.\n"
377 " Scaled sampling filters with exclusion (SSFE) <e> are:\n"
378 " ex:<s> Use SSF <s>; honor exclusion regions.\n"
379 " nex:<s> Use SSF <s>; don't honor exclusion regions.\n"
380 " <s> Same as ex:<s>\n"
381 " Scaled sampling filters (SSF) <s> are:\n"
382 " fine:<f> filter <f> at output image resolution.\n"
383 " coarse:<f> filter <f> at resolution MIN(in, out).\n"
384 " <f> Same as coarse:<f>.\n"
385 " Sampling filters <f> are:\n"
386 " sinc Sinc filter. (very large diameter)\n"
387 " lanc:<x> Lanczos, diameter <x>.\n"
388 " triangle:<x> Triangle, diameter <x>.\n"
389 " box:<x> Box, diameter <x>.\n"
390 " zero Zero function.\n"
391 " <f>*<f> Pointwise multiplication (windowing).\n"
393 " dchain (see --hq)\n"
394 " achain (see --hq)\n"
395 " afilter internal (approximates triangle:2)\n"
403 "Device (may set PSF, bayer pattern, exposure, and view angle):\n"
405 "--device <d> Set the capture device to <d>.\n"
406 " Available devices:\n"
409 " ov7620_raw_linear\n"
410 " canon_300d_raw_linear\n"
411 " canon_300d_raw_linear+50mm_1.4\n"
412 " canon_300d_raw_linear+50mm_1.4@1.4\n"
413 " canon_300d_raw_linear+50mm_1.8\n"
414 " canon_300d_raw_linear+85mm_1.8\n"
422 "Exclusion regions:\n"
424 "--ex <args> Exclude a specified volume.\n"
425 " <args> are space-delimited horizontal,\n"
426 " vertical, and frame limits:\n"
427 " <xmin> <xmax> <ymin> <ymax> <fmin> <fmax>\n"
428 " using unscaled rendering spatial coordinates.\n"
429 "--crop <args> Exclude the spatial complement of an area over a\n"
430 " specified set of frames. <args> are:\n"
431 " <xmin> <xmax> <ymin> <ymax> <fmin> <fmax>\n"
432 " using unscaled rendering spatial coordinates.\n"
440 "Certainty-weighted rendering (see --hq for defaults):\n"
442 "--cx <x> Render with certainty exponent <x>.\n"
443 "--no-cx Render with uniform certainty.\n"
445 "Options that may be useful when using --cx:\n"
446 "--ips <i> Uses one-sided certainty. (see --hr for details)\n"
447 "--exp-extend Extends the output range. (see below for details)\n"
449 "Exposure registration:\n"
451 "--exp-register Register exposure between frames. [default]\n"
452 "--exp-noregister Assume uniform exposure across all frames.\n"
453 "--exp-meta-only Use only image metadata for registering exposure.\n"
455 "Range extension (see --hq for defaults):\n"
457 "--exp-extend Extend range to include all calculated values.\n"
458 "--exp-noextend Restrict to the original frame's range.\n"
463 banner("Transformation data files");
466 "Version 2 syntax overview:\n"
469 "{supplemental frame 1 transformation}\n"
470 "{supplemental frame 2 transformation}\n"
473 "Version 3 syntax overview:\n"
476 "{original frame transformation}\n"
477 "{supplemental frame 1 transformation}\n"
478 "{supplemental frame 2 transformation}\n"
483 "V <x> Transformation data file version <x>.\n"
485 "Transformation overview:\n"
487 "{barrel/pincushion distortion command (optional; version 3 only)}\n"
488 "{projective, euclidean, or default command}\n"
490 "Barrel/pincushion distortion (version 3 only):\n"
492 "B <n> <coeff2> <coeff3> ... <coeff(n+1)>\n"
494 "Projective command:\n"
496 "P <xmax> <ymax> <tlx> <tly> <blx> <bly> <brx> <bry> <trx> <try>\n"
498 "Euclidean command:\n"
500 "E <xmax> <ymax> <xoffset> <yoffset> <angle>\n"
505 "# Lines beginning with '#' are comments.\n"
509 "# Version 3 transformation data file.\n"
511 "# Original frame, with barrel/pincushion distortion correction\n"
514 "# Supplemental frame 1: shift a 640x480 image right by 100 pixels\n"
515 "E 640 480 100 0 0\n"
520 banner("Video stream processing");
523 "Video stream processing [Experimental]:\n"
525 "--visp <args> Process a video sequence.\n"
527 " <chain> <stabilization-type> <prefix> <suffix>\n"
528 " <chain> is an incremental rendering chain. (see --hl)\n"
529 " <stabilization-type> is one of:\n"
530 " ma:<x> Moving average over 2*<x> + 1 frames\n"
531 " sf:<x> Stabilize to single frame number <x>\n"
532 " identity Same as ma:0\n"
533 " <prefix> is an output file prefix\n"
534 " <suffix> is an output file suffix\n"
535 "--visp-scale=<x> Use scale <x> for VISP output. (default is 1.0)\n"
536 "--exshow For single-invariant chains, show --ex regions dimmed.\n"
540 banner("User Interface");
545 "--ui=<type> Set user interface to <type>, one of:\n"
550 " NOTE: since ALE was compiled without ioctl support,\n"
551 " --ui=tty will behave identically to --ui=stream.\n"
552 " For additional output, recompile with IOCTL=1.\n"
557 banner("Control Points");
560 "Control point files:\n"
562 "--cpf-load=<f> Load control point data from file <f>\n"
566 banner("3D Modeling (very experimental)");
571 "--3dv <n> <o> Render, to file <o>, colors as viewed from frame <n>.\n"
572 "--3dd <n> <o> Render, to file <o>, depths as viewed from frame <n>.\n"
573 "--3dvp <args> <o> Render, to file <o>, colors viewed with projective <args>.\n"
574 "--3ddp <args> <o> Render, to file <o>, depths viewed with projective <args>.\n"
575 " <args> are W H V x y z P Y R:\n"
578 " V camera view angle.\n"
579 " x translation x component.\n"
580 " y translation y component.\n"
581 " z translation z component.\n"
582 " P rotation around x-axis.\n"
583 " Y rotation around y-axis.\n"
584 " R rotation around z-axis.\n"
585 "--occ-norm Normalize output with accumulated occupancy. [default]\n"
586 "--occ-nonorm Don't normalize output with accumulated occupancy.\n"
587 "--et <x> Set encounter threshold <x> for defined pixels. [default is 0]\n"
588 "--3dpx <args> Exclude a specified spatial volume following full-scene\n"
589 " reconstruction, assuming a single depth at each point\n"
590 " in the output. <args> are:\n"
591 " <xmin> <xmax> <ymin> <ymax> <zmin> <zmax>\n"
593 "Camera parameters:\n"
595 "--view-angle <x> Set the initial diagonal view angle to <x> degrees.\n"
596 " (Default is 43.7 degrees or device-specific.)\n"
597 "--cpp-upper=<x> Set upper bound <x> for camera parameter perturbation,\n"
598 " in pixels or degrees [default is 32]\n"
599 "--cpp-lower=<x> Set lower bound <x> for camera parameter perturbation,\n"
600 " in pixels or degrees [default is 0.125]\n"
601 "--cpp-err-mean Use RMS error to determine camera parameters. [default]\n"
602 "--cpp-err-median Use median error to determine camera parameters. \n"
603 "--va-upper=<x> View-angle perturbation upper bound in degrees [default is 32]\n"
604 "--st <x> Set stereo threshold to <x> pixels. [default is 4]\n"
605 "--vp-adjust Adjust the view point [default]\n"
606 "--vp-noadjust Do not adjust the view point\n"
607 "--vo-adjust Adjust the view orientation [default]\n"
608 "--vo-noadjust Do not adjust the view orientation\n"
610 "Transformation file operations:\n"
612 "--3d-trans-load=x Load initial transformation settings from file x\n"
613 "--3d-trans-save=x Save final transformation data in file x\n"
618 "--ecm <x> Set edge length cost multiplier <x>. [default is 0]\n"
619 "--acm <x> Set angle cost multiplier <x>. [default is 0]\n"
624 "--di-upper <x> Decimate primary input resolution by at most 2^x [default is 0]\n"
625 "--di-lower <x> Decimate input resolutions by at least 2^x [default is 0]\n"
626 "--do-try <x> Decimate output resolution by 2^x if possible [default is 0]\n"
627 "--oc Clip scene to output regions.\n"
628 "--no-oc Do not clip scene to output regions. [default]\n"
629 "--fc <x> Set front-clip to <x> (0 < x < 1) [default is 0]\n"
630 "--rc <x> Set rear-clip to <x> (1 < x < inf) [default is inf]\n"
631 "--fx <x> Set falloff exponent to <x> [default is 0]\n"
632 "--tcem <x> Set third-camera error multiplier to <x> [default is 0]\n"
633 "--oui <x> Set occupancy update iterations to <x> [default is 10]\n"
634 "--pa <x> Set pairwise ambiguity to <x> [default is 3]\n"
635 "--pc <type> Set the type of pairwise comparisons:\n"
636 " auto Determine comparisons automatically. [default]\n"
637 " all Perform all comparisons.\n"
639 "--mpu <x> Set model perturb upper bound to <x> [default is 25%%]\n"
640 "--mpl <x> Set model perturb lower bound to <x> [default is 1]\n"
641 "--model-save=<x> Save model data to file <x>.\n"
642 "--model-load=<x> Load model data from file <x>.\n"
646 void undocumented() {
647 banner("Undocumented");
650 "Point-spread functions:\n"
652 "--psf-match <args> Can be used to evaluate PSFs. [details are undocumented]\n"
654 " <mr> <mg> <mb> <ar> <ag> <ab>\n"
656 " r[calibrated] = r[input] * <mr> + <ar>\n"
658 "Projective transformation calculator:\n"
666 #undef BETWEEN_SECTIONS