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"
109 " --3d-chain fine:box:1,triangle:2\n"
111 "Low noise defaults:\n"
113 " --dchain sinc*lanc:6\n"
114 " --achain sinc*lanc:6\n"
119 " --3d-chain sinc*lanc:6\n"
123 " --dchain median:fine:sinc*lanc:8,triangle:2\n"
124 " --achain triangle:2\n"
129 " --3d-chain median:fine:sinc*lanc:8,triangle:2\n"
133 " --dchain sinc*lanc:8\n"
134 " --achain sinc*lanc:8\n"
139 " --3d-chain sinc*lanc:8\n"
141 "Range-extended defaults:\n"
143 " --dchain sinc*lanc:8\n"
144 " --achain sinc*lanc:8\n"
149 " --3d-chain sinc*lanc:8\n"
158 "Bit depth options:\n"
160 "--8bpc Write 8 bit per channel output [default]\n"
161 "--16bpc Write 16 bit per channel output\n"
163 "Output format options:\n"
166 "--auto Determine output file type automatically [default]\n"
167 "--raw Write raw PPM output\n"
168 "--plain Write plain PPM output\n"
170 "--raw Write raw PPM output [default]\n"
171 "--plain Write plain PPM output\n"
174 "Incremental output:\n"
176 "--inc Produce incremental output. [default]\n"
177 "--no-inc Don't produce incremental output.\n"
180 "Undefined values:\n"
182 "--def-nn <R> Use nearest-neighbor defined values within\n"
183 " radius <R>, zero outside. Default radius is 0.\n"
191 "Alignment channel options:\n"
193 "--align-all Align images using all color channels\n"
194 "--align-green Align images using the green channel\n"
195 "--align-sum Align images using a sum of channels [default]\n"
197 "Transformation options:\n"
199 "--translation Only adjust the position of images\n"
200 "--euclidean Adjust the position and orientation of images [default]\n"
201 "--projective Use projective transformations. Best quality, but slow.\n"
203 "Alignment following:\n"
205 "--identity Frames align closely with the original frame. [default]\n"
206 "--follow Frames align closely with their immediate predecessor.\n"
208 "Alignment failure:\n"
210 "--fail-optimal Frames beneath threshold are aligned optimally. [default]\n"
211 "--fail-default Frames beneath threshold keep their default alignment.\n"
213 "Transformation file operations:\n"
215 "--trans-load=x Load initial transformation settings from file x\n"
216 "--trans-save=x Save final transformation data in file x\n"
218 "Monte Carlo alignment (see --hq for defaults):\n"
220 "--mc <x> Align using, on average, x%% of available pixels (0 < x < 100)\n"
221 "--no-mc Align using all pixels.\n"
223 "Tunable parameters:\n"
225 "--metric=x Set the alignment error metric exponent. (2 is default)\n"
226 "--threshold=x Min. match threshold; a perfect match is 100. (0 is default)\n"
227 "--perturb-upper=x Perturbation upper bound pixels/arclength (14%% is default)\n"
228 " ('x%%' uses a fraction of the smallest image dimension.)\n"
229 "--perturb-lower=x Perturbation lower bound pixels/arclength (.125 is default)\n"
230 " ('x%%' uses a fraction of the smallest image dimension.)\n"
231 "--rot-upper=x Rotation-specific upper bound in degrees (32.0 is default)\n"
232 "--bda-mult=x Barrel distortion adjustment multiplier (0.0001 is default)\n"
233 "--bda-rate=x Barrel distortion rate of change maximum (0.0004 is default)\n"
234 "--lod-max=x LOD scale factor is max(1, (2^floor(x))/perturb) (1 is def.)\n"
236 "Certainty-weighted alignment:\n"
238 "--cw Weight alignment error by certainty.\n"
239 "--no-cw Don't weight alignment error by certainty. [default]\n"
241 "Alignment weight maps:\n"
243 "--wm <f> <x> <y> Use weight map image <f> at offset (<x>, <y>)\n"
245 "Frequency-weighted alignment:\n"
247 "--fl <h> <v> <a> High-pass filters: horizontal <h>, vertical <v>, average <a>.\n"
248 " Values should fall between 0 (pass all) and 1 (pass none).\n"
251 " NOTE: since this build of ALE does not link with FFTW,\n"
252 " this option is not supported. To use this option,\n"
253 " first re-build with FFTW support.\n"
256 "--flshow <o> Write high-pass filtered data to file <o>.\n"
258 "Algorithmic alignment weighting:\n"
260 "--wmx <e> <r> <d> Write reference <r>, definition <d>, execute `<e> <f> <d>`,\n"
261 " read weights <r> back.\n"
264 " NOTE: since this build was not configured for POSIX,\n"
265 " this option is not supported. To use this option,\n"
266 " first re-build with POSIX=1.\n"
269 "Perturbation Type [experimental]:\n"
271 "--perturb-output Apply perturbations in output image coordinates. [default]\n"
272 "--perturb-source Apply perturbations in source image coordinates.\n"
274 "Global searching:\n"
276 "--gs <type> Set global search to <type>, one of:\n"
277 " local Local alignment only [default]\n"
278 " inner Alignment reference image inner region\n"
279 " outer Alignment reference image outer region\n"
280 " all Union of inner and outer\n"
281 " central inner if below threshold or better; else, outer.\n"
282 " points Align by control points. Ignores gs-mo.\n"
283 "--gs-mo <x> Set <x> pixel min. overlap for global search. (16 is default)\n"
292 "Mimicking ALE 0.6.0 merging and drizzling (see --hl for details):\n"
294 " --dchain triangle:2 approximates merging.\n"
295 " --dchain fine:box:1 approximates drizzling.\n"
299 "--extend Increase image extents to accommodate all pixel data.\n"
300 "--no-extend Don't increase extents; crop to original frame. [default]\n"
302 "Tunable parameters:\n"
304 "--scale=x Scale images by the factor x, where x > 0. (1 is default)\n"
305 "--threshold=x Min. match threshold; a perfect match is 100. (0 is default)\n"
307 "Irani-Peleg iterative solver (see --hq for --ips defaults):\n"
309 "--ips <i> Run <i> iterations. (see also --hx, --hl and --hd)\n"
310 "--ip-mean Use the mean correction [default]\n"
311 "--ip-median Use the median correction\n"
314 "Unsharp Mask (was 'High-frequency Enhancement'):\n"
316 "--usm <m> Apply an unsharp mask with multiplier <m>.\n"
317 " (See also --device, --nlpsf, and --lpsf.)\n"
322 "--bayer <b> Set the bayer pattern to <b>, one of:\n"
323 " (clockwise from top left pixel)\n"
324 " rgbg Red-green-blue-green\n"
325 " gbgr Green-blue-green-red\n"
326 " grgb Green-red-green-blue\n"
327 " bgrg Blue-green-red-green\n"
328 " none RGB-RGB-RGB-RGB\n"
329 " Default is none or device-specific.\n"
331 "Color adjustment:\n"
333 "--exp-mult=c,r,b Adjust all channels by <c>, red by <r>, and blue by <b>.\n"
341 "Point-spread functions (used with --ips; see --hr):\n"
343 "--lpsf <p> Set linear colorspace point-spread function to <p>\n"
344 "--nlpsf <p> Set non-linear colorspace point-spread function to <p>\n"
345 " Available point-spread functions:\n"
347 " circle=<diameter>\n"
350 " <p>+<p> (summation)\n"
351 " <p>^<p> (convolution)\n"
352 " <n>*<p> (multiplication by a scalar <n>)\n"
353 " Default lpsf is either 'box=1.0' or device-specific.\n"
354 " Default nlpsf is either disabled or device-specific.\n"
356 "Incremental rendering chains:\n"
358 "--wt <w> Set weight threshold for defined pixels (default is 0.1).\n"
359 "--dchain <g> Use chain <g> to render the default output.\n"
360 "--ochain <g> <o> Use chain <g> to render output file <o>.\n"
361 "--achain <g> Use chain <g> to render the alignment reference image.\n"
362 "--afilter <s> Use SSF <s> to interpolate points in alignment.\n"
363 "--3d-chain <g> Use chain <g> by default to render 3d output.\n"
365 " triangle:2 ALE 0.6.0 merging (roughly)\n"
366 " fine:box:1 Drizzling (roughly)\n"
367 " fine:sinc*lanc:8 High-frequency preservation\n"
368 " last:nex:sinc*lanc:8 Useful for video stabilization\n"
369 " fine:box:1,triangle:2 Multi-resolution rendering\n"
370 " fine:sinc*lanc:8,sinc*lanc:8 Multi-resolution rendering\n"
371 " More precisely, chains <g> are one of:\n"
372 " <g1>,<g2> Chain <g1> where defined; <g2> elsewhere.\n"
373 " <i> Use rendering invariant <i>.\n"
374 " Rendering invariants <i> are:\n"
375 " avg:<e> Avg. (mean) value using SSFE <e>.\n"
376 " first:<e> First defined value using SSFE <e>.\n"
377 " last:<e> Last defined value using SSFE <e>.\n"
378 " max:<e> Maximum defined value using SSFE <e>.\n"
379 " min:<e> Minimum defined value using SSFE <e>.\n"
380 " median:<e> Median value using SSFE <e>.\n"
381 " <e> Same as avg:<e>.\n"
382 " Scaled sampling filters with exclusion (SSFE) <e> are:\n"
383 " ex:<s> Use SSF <s>; honor exclusion regions.\n"
384 " nex:<s> Use SSF <s>; don't honor exclusion regions.\n"
385 " <s> Same as ex:<s>\n"
386 " Scaled sampling filters (SSF) <s> are:\n"
387 " fine:<f> filter <f> at output image resolution.\n"
388 " coarse:<f> filter <f> at resolution MIN(in, out).\n"
389 " <f> Same as coarse:<f>.\n"
390 " Sampling filters <f> are:\n"
391 " sinc Sinc filter. (very large diameter)\n"
392 " lanc:<x> Lanczos, diameter <x>.\n"
393 " triangle:<x> Triangle, diameter <x>.\n"
394 " box:<x> Box, diameter <x>.\n"
395 " zero Zero function.\n"
396 " <f>*<f> Pointwise multiplication (windowing).\n"
398 " dchain (see --hq)\n"
399 " achain (see --hq)\n"
400 " afilter internal (approximates triangle:2)\n"
408 "Device (may set PSF, bayer pattern, exposure, and view angle):\n"
410 "--device <d> Set the capture device to <d>.\n"
411 " Available devices:\n"
414 " ov7620_raw_linear\n"
415 " canon_300d_raw_linear\n"
416 " canon_300d_raw_linear+50mm_1.4\n"
417 " canon_300d_raw_linear+50mm_1.4@1.4\n"
418 " canon_300d_raw_linear+50mm_1.8\n"
419 " canon_300d_raw_linear+85mm_1.8\n"
427 "Exclusion regions:\n"
429 "--ex <args> Exclude a specified volume.\n"
430 " <args> are space-delimited horizontal,\n"
431 " vertical, and frame limits:\n"
432 " <xmin> <xmax> <ymin> <ymax> <fmin> <fmax>\n"
433 " using unscaled rendering spatial coordinates.\n"
434 "--crop <args> Exclude the spatial complement of an area over a\n"
435 " specified set of frames. <args> are:\n"
436 " <xmin> <xmax> <ymin> <ymax> <fmin> <fmax>\n"
437 " using unscaled rendering spatial coordinates.\n"
445 "Certainty-weighted rendering (see --hq for defaults):\n"
447 "--cx <x> Render with certainty exponent <x>.\n"
448 "--no-cx Render with uniform certainty.\n"
450 "Options that may be useful when using --cx:\n"
451 "--ips <i> Uses one-sided certainty. (see --hr for details)\n"
452 "--exp-extend Extends the output range. (see below for details)\n"
454 "Exposure registration:\n"
456 "--exp-register Register exposure between frames. [default]\n"
457 "--exp-noregister Assume uniform exposure across all frames.\n"
458 "--exp-meta-only Use only image metadata for registering exposure.\n"
460 "Range extension (see --hq for defaults):\n"
462 "--exp-extend Extend range to include all calculated values.\n"
463 "--exp-noextend Restrict to the original frame's range.\n"
468 banner("Transformation data files");
471 "Version 2 syntax overview:\n"
474 "{supplemental frame 1 transformation}\n"
475 "{supplemental frame 2 transformation}\n"
478 "Version 3 syntax overview:\n"
481 "{original frame transformation}\n"
482 "{supplemental frame 1 transformation}\n"
483 "{supplemental frame 2 transformation}\n"
488 "V <x> Transformation data file version <x>.\n"
490 "Transformation overview:\n"
492 "{barrel/pincushion distortion command (optional; version 3 only)}\n"
493 "{projective, euclidean, or default command}\n"
495 "Barrel/pincushion distortion (version 3 only):\n"
497 "B <n> <coeff2> <coeff3> ... <coeff(n+1)>\n"
499 "Projective command:\n"
501 "P <xmax> <ymax> <tlx> <tly> <blx> <bly> <brx> <bry> <trx> <try>\n"
503 "Euclidean command:\n"
505 "E <xmax> <ymax> <xoffset> <yoffset> <angle>\n"
510 "# Lines beginning with '#' are comments.\n"
514 "# Version 3 transformation data file.\n"
516 "# Original frame, with barrel/pincushion distortion correction\n"
519 "# Supplemental frame 1: shift a 640x480 image right by 100 pixels\n"
520 "E 640 480 100 0 0\n"
525 banner("Video stream processing");
528 "Video stream processing [Experimental]:\n"
530 "--visp <args> Process a video sequence.\n"
532 " <chain> <stabilization-type> <prefix> <suffix>\n"
533 " <chain> is an incremental rendering chain. (see --hl)\n"
534 " <stabilization-type> is one of:\n"
535 " ma:<x> Moving average over 2*<x> + 1 frames\n"
536 " sf:<x> Stabilize to single frame number <x>\n"
537 " identity Same as ma:0\n"
538 " <prefix> is an output file prefix\n"
539 " <suffix> is an output file suffix\n"
540 "--visp-scale=<x> Use scale <x> for VISP output. (default is 1.0)\n"
541 "--exshow For single-invariant chains, show --ex regions dimmed.\n"
545 banner("User Interface");
550 "--ui=<type> Set user interface to <type>, one of:\n"
555 " NOTE: since ALE was compiled without ioctl support,\n"
556 " --ui=tty will behave identically to --ui=stream.\n"
557 " For additional output, recompile with IOCTL=1.\n"
562 banner("Control Points");
565 "Control point files:\n"
567 "--cpf-load=<f> Load control point data from file <f>\n"
571 banner("3D Modeling (very experimental)");
576 "--3dv <n> <o> Render, to file <o>, colors as viewed from frame <n>.\n"
577 "--3dd <n> <o> Render, to file <o>, depths as viewed from frame <n>.\n"
578 "--3dvp <args> <o> Render, to file <o>, colors viewed with projective <args>.\n"
579 "--3ddp <args> <o> Render, to file <o>, depths viewed with projective <args>.\n"
580 " <args> are W H V x y z P Y R:\n"
583 " V camera view angle.\n"
584 " x translation x component.\n"
585 " y translation y component.\n"
586 " z translation z component.\n"
587 " P rotation around x-axis.\n"
588 " Y rotation around y-axis.\n"
589 " R rotation around z-axis.\n"
590 "--occ-norm Normalize output with accumulated occupancy. [default]\n"
591 "--occ-nonorm Don't normalize output with accumulated occupancy.\n"
592 "--et <x> Set encounter threshold <x> for defined pixels. [default is 0]\n"
593 "--3dpx <args> Exclude a specified spatial volume following full-scene\n"
594 " reconstruction, assuming a single depth at each point\n"
595 " in the output. <args> are:\n"
596 " <xmin> <xmax> <ymin> <ymax> <zmin> <zmax>\n"
597 "--3d-filter Use filtering for 3D color output. [default]\n"
598 "--3d-nofilter Don't use filtering for 3D color output.\n"
599 "--3d-dmr <x> Set radius for calculating median depth to <x> [default 0]\n"
600 "--3d-fmr <x> Set radius for calculating median diff to <x> [default 0]\n"
601 "--focus <ft> <op> Create focus region with type <ft> and options <op>:\n"
603 " d <d> focus at distance <d>\n"
604 " p <x> <y> focus at point (x, y)\n"
605 " Space-separated options may include zero or more of:\n"
606 " ci=<ci> camera index [default 0]\n"
607 " fr=<fr> focal range [default 0]\n"
608 " ht=<ht> horizontal tilt gradient [default 0]\n"
609 " vt=<vt> vertical tilt gradient [default 0]\n"
610 " ap=<ap> aperture diameter [default 3]\n"
611 " sc=<sc> sample count [default 3]\n"
612 " sx=<sx> start x coordinate [default -Inf]\n"
613 " ex=<ex> end x coordinate [default Inf]\n"
614 " sy=<sy> start y coordinate [default -Inf]\n"
615 " ey=<ey> end y coordinate [default Inf]\n"
616 " sd=<sd> start depth [default 0]\n"
617 " ed=<ed> end depth [default Inf]\n"
620 "Camera parameters:\n"
622 "--view-angle <x> Set the initial diagonal view angle to <x> degrees.\n"
623 " (Default is 43.7 degrees or device-specific.)\n"
624 "--cpp-upper=<x> Set upper bound <x> for camera parameter perturbation,\n"
625 " in pixels or degrees [default is 32]\n"
626 "--cpp-lower=<x> Set lower bound <x> for camera parameter perturbation,\n"
627 " in pixels or degrees [default is 0.125]\n"
628 "--cpp-err-mean Use RMS error to determine camera parameters. [default]\n"
629 "--cpp-err-median Use median error to determine camera parameters. \n"
630 "--va-upper=<x> View-angle perturbation upper bound in degrees [default is 32]\n"
631 "--st <x> Set stereo threshold to <x> pixels. [default is 4]\n"
632 "--vp-adjust Adjust the view point [default]\n"
633 "--vp-noadjust Do not adjust the view point\n"
634 "--vo-adjust Adjust the view orientation [default]\n"
635 "--vo-noadjust Do not adjust the view orientation\n"
637 "Transformation file operations:\n"
639 "--3d-trans-load=x Load initial transformation settings from file x\n"
640 "--3d-trans-save=x Save final transformation data in file x\n"
644 "--di-upper <x> Decimate primary input resolution by at most 2^x [default is 0]\n"
645 "--di-lower <x> Decimate input resolutions by at least 2^x [default is 0]\n"
646 "--do-try <x> Decimate output resolution by 2^x if possible [default is 0]\n"
647 "--oc Clip scene to output regions.\n"
648 "--no-oc Do not clip scene to output regions. [default]\n"
649 "--fc <x> Set front-clip to <x> (0 < x < 1) [default is 0]\n"
650 "--rc <x> Set rear-clip to <x> (1 < x < inf) [default is inf]\n"
651 "--fx <x> Set falloff exponent to <x> [default is 0]\n"
652 "--tcem <x> Set third-camera error multiplier to <x> [default is 0]\n"
653 "--oui <x> Set occupancy update iterations to <x> [default is 10]\n"
654 "--pa <x> Set pairwise ambiguity to <x> [default is 3]\n"
655 "--pc <type> Set the type of pairwise comparisons:\n"
656 " auto Determine comparisons automatically. [default]\n"
657 " all Perform all comparisons.\n"
660 void undocumented() {
661 banner("Undocumented");
664 "Point-spread functions:\n"
666 "--psf-match <args> Can be used to evaluate PSFs. [details are undocumented]\n"
668 " <mr> <mg> <mb> <ar> <ag> <ab>\n"
670 " r[calibrated] = r[input] * <mr> + <ar>\n"
672 "Projective transformation calculator:\n"
676 "Traverse subspaces for 3D candidate selection:\n"
678 "--subspace-traverse\n"
684 #undef BETWEEN_SECTIONS