Xmerge
Xmerge is a image stitching command line tool developed by Johan Borg.
Command line options
Note: From "xmerge -h
".
-h
- this message
-o
- set output file for final image, if written (default test.ppm)
-O
- set output file for mapping data, if written
-l
- load saved mapping data, mutually exclusive to specifying ppm files
-m
- magnification applied when solution is calculated (default 1.0)
-M
- magnification applied if mapping data are loaded
-b
- background colour (default: 255,0,0 (red))
-r
- reference-colour for gain calculation (gui: b) (default 255,255,255)
-R
- colour gain applied if mapping data are loaded (default 0,0,0)
-B
- black level used when final image is created (default: 0,0,0) (colour gain or reference level must be adjusted accordingly)
- options implying non interactive operation: (in order of execution)
-s
- solve loaded problem
-W
- write current mapping data
-w
- write final image
Input file(s) can be either -l
OR a list of ppm(P6) files. When image files are specified, the images are placed on rows from left to right. The special file name / causes remaining images to be placed on a new row one position down. Empty arguments ("" in most shells) can be used to create empty locations.
Keyboard commands
There are two main modes of operation, referred to as "Source" and "Target". Generic navigation in both modes are performed by clicking with the 2nd (center/middle) button of the pointing device at the point about which the image is to be centered. This is the only means for moving around on an image zoomed to a size larger than the program window.
m
- switch between source and target mode
+
- zoom in
-
- zoom out
w
- write the final image to disk
W
- write a loadable listfile describing the current state of the problem
s
- solve the problem specified by the relations set in the Source mode
r
- reset the solution to its initial state, useful if solving for impossible relations has been attempted, with a solution from which the solver is unable to continue, even if the relations are corrected.
a
- auto-improve the matching of the regions specifying point-relations, by using the current solution when mapping pixels. This command usually mess things up more than it improves, and all point relations are affected, even those manually matched.
q
- exists xmerge
Example usage
xmerge -o foo.ppm -O foo.txt foo00.ppm foo01.ppm foo02.ppm / foo10.ppm foo11.ppm foo12.ppm
will start xmerge with six images in two rows and three columns, write final the final image (when requested in the GUI, by pressing "w
") to the file foo.ppm
, and write the current state of the variables used in the mapping to the file foo.txt
(when "W
" is used in the GUI). This file can later be loaded into xmerge using "xmerge -l foo.txt
". Using the command line option "-w
" together with "-l
" it is possible to write the final image corresponding to the saved data, without using the GUI.