Input Parameter

InputMode (/IM=1)

Range of values [0-10]
Determination of the search strategy for images and videos:
0: Only one single stereo image will be corrected. The program uses the indicated file name(s) StereoFileName (if StereoImageInput = 1) or LeftFileName and RightFileName (if StereoImageInput = 2).
1: Searches in the directory PathofImages for the files <name_s.*> (if StereoImageInput = 1) or for all files <name_l.*> and <name_r.*> (if StereoImageInput = 2), to correct them individually one after another.
2: Video mode: Only one single stereo video will be corrected. The program uses the indicated file name(s) StereoFileName (if StereoImageInput = 1) or LeftFileName and RightFileName (if StereoImageInput = 2).
3: Video mode: The left and right image sequences are expected to be stored into separate subdirectories PathofImages\l\ and PathofImages\r\ for StereoImageInput = 2 and into the subdirectory PathofImages\s\, if StereoImageInput = 1. The images are mounted together in their alphabetical sequences. In a first run, the images are only analyzed and then, in a second run, they are all corrected with the same evaluated error values. See also parameter InterlacedMode.
4: "Unnamed": All images of the directory PathofImages will be mounted in the alphabetical ordering. This mode works for left-right separated files as well as stereo image files (SBS, MPO...). If images are left-right separated, the following ordering is used (1-2), (3-4), (5-6), (7-8).
5: "Immediate neighbours": Makes sense only for left-right separated images. All images of the directory PathofImages will be mounted in the alphabetical ordering (1-2), (2-3), (3-4), (4-5) etc.
6: "Bracketing": Makes sense only for left-right separated images. All images of the directory PathofImages will be mounted in the alphabetical ordering (1-2), (3-2), (3-4), (5-4) etc.
7: "First-to-all": Makes sense only for left-right separated images. All images of the directory PathofImages will be mounted in the alphabetical ordering (1-2), (1-3), (1-4), (1-5) etc.
8: "Every-pair": Makes sense only for left-right separated images. All images of the directory PathofImages will be mounted in the alphabetical ordering (1-2), (1-3), (1-4), (1-5)...; (2-3), (2-4), (2-5)...; (3-4), (3-5)... etc.
9: Left and right images are expected to be stored in separate subdirectories \l\ and \r\. Images formats with both views in one file (SBS, SBSQ, MPO) are expected to be stored in the subdirectory PathofImages\s\. The images are mounted together in their alphabetical sequences.
Below the folder PathofImages, there may exist furthers levels of subdirectories, for example, the following structure of folders will be supported:
  [Ireland]
    - [2007.09.18_Dublin]
      - [l] left images
      - [r] right images
    - [2007.09.19_Newgrange]
      - [l] left images 
      - [r] right images
    - [2007.09.20_MountSteward]
      - [l] left images 
      - [r] right images
    - [<further subdirectories>]
  
With this example, you have to set: PathofImages = "Ireland".

10: The images, which should be mounted, can be indicated by supplying a file with the name given by ListofImages (default: cosima_files.txt). In each line of this file the names of the two images are to be given - separated by blanks. If one of the filenames content any spaces, both names have to be written with apostrophes. Example:
image_1_l.jpg   image_1_r.jpg (right)
"image_2_l.jpg"   "image_2_r.jpg" (also right)
image 3_l.jpg   image 3_r.jpg (wrong due to spaces)
"image 3_l.jpg"   "image 3_r.jpg" (so it's right)
"image 3_l.jpg"   image_3_r.jpg (again wrong, missing aprostrohes)
"image 3_l.jpg"  "image_3_r.jpg" (right)
image_2_l.jpg   image_2_r.jpg OK (will not be processed due to OK)
image_2_l.jpg   image_2_r.jpg QU (will not be processed due to QU)

Only images without an "OK" and without an "QU" at the end of the line will be processed!

Please attention:

  • With the InputModi 1, the resulting images get the following file name format: <name>_<nnn>_c<x>.<end>. The meaning of <nnn> is the evaluated deviation in promille relatively to the image width (so a value of 1/30 is related to 33 promille, 1 promille = 0.1 percent), <x> stands for [l,r,s,a] meaning [left, right, stereo, anaglyph], and <end> is the file ending indicating the image file format.
  • With the modi 4-9, the resulting images get the following file name format: <left name>-<right name>_<nnn>_c<x>.<end>. Same meaning as above.
  • For the VideoMode the original left image names are taken unaltered (if InterlacedMode = 0) or a new counter will be attached to the original left image names (if InterlacedMode ≠ 0). Tn this case, all digits of the original names are replaced by a "#".
  • With the modi 3-9 the parameter ImageType will be used for setting the file format.
  • With the Modi 1-9, a file with the name given from ListofImages (default: cosima_files.txt) will be written including a list with all processed image pairs.
    After a successful correction, an "OK"is written behind the image names. Subsequently, this file can be used as an input file with InputMode = 10. At this, only those image pairs will be processed again, which have got no "OK" at the end of the line!
  • If the parameter EstimateGeometry is set equal to 2 (and using InputMode = 10), Cosima reads all correction parameters from the file ListofImages and corrects the image with these values. In that case, only images with an OK entry are considered. The parameter EstimateWindow is not further evaluated for that operation.

IncludeSubdirs (/IN=0)

Range of values [0,1,2]
0: Without subdirectories.
1: Using subdirectories, but without \cl, \cr, \ca, \cs, \lo and \ro. With that parameter value, you can supress images, which are generated by Cosima.
2: Using all subdirectories.
The meaning of this parameter with different InputModi:
InputMode = 0: IncludeSubdirs ist irrelevant, es wird geneu ein Bild bearbeitet.
InputMode = 1: IncludeSubdirs kann auf 0,1 oder 2 gesetzt werden.
InputMode = 2: IncludeSubdirs ist irrelevant, es wird genau ein Video bearbeitet.
InputMode = 3: IncludeSubdirs ist irrelevant, es wird genau ein (bzw. zwei) Verzeichnis(se) mit Frames bearbeitet.
InputMode = 4-8: IncludeSubdirs kann auf 0,1 oder 2 gesetzt werden.
InputMode = 9: IncludeSubdirs kann auf 0,1 oder 2 gesetzt werden.
InputMode = 10: IncludeSubdirs ist irrelevant, es wird eine gegebene Liste mit Bildern abgearbeitet.
InputModus = 0: IncludeSubdirs is irrelevant, only one image is processed.
InputModus = 1: IncludeSubdirs may be set to 0, 1 or 2
InputModus = 2: IncludeSubdirs is irrelevant, only one video is processed.
InputModus = 3: IncludeSubdirs is irrelevant, only one (or two) folder(s) of frames is processed.
InputModus = 4-8: IncludeSubdirs may be set to 0, 1 or 2.
InputModus = 9: IncludeSubdirs may be set to 0, 1 or 2.
InputModus = 10: IncludeSubdirs is irrelevant, a given list of images is processed.
The subdirectories will not be mixed, but will be processed separately.

PathofImages (/PM=.\)

Range of values: characters
Directory, where the image files are stored. The path can be given as a 'relative path' (e.g. "images", ".\images\" or "..\images" with ".\" aims to the current path) or as an 'absolute path' (e.g. "D:\holiday\images"). With the parameter RootDirectory the root of the relative paths can be choosen. Only evaluated with InputMode 1-9.

RootDirectory (/RD=0)

Range of values [0,1,2]
Root directory for relative path of images. This parameter chooses the root directory, if PathofImages is a relative path.
0: The root directory is the path of the ini-file.
1: The root directory is the path of cosima.exe.
2: The root directory is the current path. Attention: Using the user interface Cosima Gui, it will be set RootDirectory = 0.

ImageType (/IT=tif;bmp;tga;jpg;mpo)

Range of values: characters
File format filter for the search modes InputMode = 0-9. It is possible to input different ending types, separated with a semicolon. Cosima supports the most of the usual file formats: [bmp, tga, jpg, jpeg, jp2, tif, tiff, psd, gif, pbm, png, psd, raw, xbm, mpo, arw, cr2, dng ...]

ExifTimeTolerance (/TT=0)

Range of values [0-86399]
Time tolerance for image pairing. If that parameter is activated and the Inputmodi is 4-9, only such single images are paired together, which have got the same difference value of their shooting times. For that, the first image pair of every subdirectory is used as a reference pair and only such images are paired with a shooting times difference not exceeding the shooting times difference of the reference pair by the value of ExifTimeTolerance. For every subdirectory a new reference pair is taken. For the evaluation of the shooting time, the key Exif.DateTimeOriginal will be written from the images (only jpg- and tif-images).
If the shooting time difference of a pair of images exceeds the tolerated value, the orphaned image will be find-out by evaluating the shooting times and the image counter will be incremented for that directory. Using the parameter RenameOrphans, all found orphaned images can be marked and renamed.
0: This functionality is deactivated, all images are paired.
1-86399: Tolerance time in seconds. A recommended combination may be: InputMode = 9, ExifTimeTolerance = 3 and RenameOrphans = 1.

Hint I: Huge directories with lots of images need processing times for the EXIF time reading of several minutes. Using the external program exiv2.exe, this processing time can be reduced by a factor of two to three. For that, only the files exiv2.exe and libexpat.dll are to be copied into the Cosima directory. Cosima checks the existence of these files and switches from internal to external EXIF time reading method. You may download the two files from the: Cosima Archiv.
Hint II: With the help of Exiv2, also CR2/ARW/DNG files can be paired.

RenameOrphans (/RO=0)

Range of values [0-4]
Renaming control of orphan images. If orphaned images are found using the parameter ExifTimeTolerance, these images can be renamed with RenameOrphans. Only InputMode = 9.
0: without renaming
1: move left orphaned images into the subdirectory '\lo' and right orphaned images into the subdirectory '\ro'.
2: append the suffixes '_lo' respectively '_ro' to the file names, this will keep the sorting order within the directory
3: precede the prefix '_' to the file names of orphaned images, these images will be ordered to the top
4: precede the prefix 'z' to the file names, these images will be ordered to the bottom

RenameRefused (/RU=0)

Range of values [0-2]
Renaming control of refused images. Images, which Cosima cannot mount automatically, may moved into subfolders using this parameter. Only for InputMode = 9.
0: without renaming
1: move left images into the subdirectory '\lu' and the right images into the subdirectory '\ru'.
2: append the suffixes '_lu' respectively '_ru' to the file names, this will keep the sorting order within the directory.

LeftFileName (/LF=image_l.jpg)

Range of values: characters
File name of the left image including the ending (if StereoImageInput = 2).

RightFileName (/RF=image_r.jpg)

Range of values: characters
File name of the right image including the ending (if StereoImageInput = 2).

StereoFileName (/SF=image_s.jpg)

Range of values: characters
File name of the side-by-side mounted stereo image including the ending (if StereoImageInput = 1).

StereoImageInput (/SI=2)

Range of values [1-6]
Selection, if two single images/videos or one stereoimage/video as input:
1: Expects either a side-by-side mounted stereo image/video or MPO format. Only for InputMode 0-4, 9 and 10.
2: Expects two separate files, one for the left image/video and one for the right image/video as input.
3: Expects a horizontally squeezed side-by-side mounted stereo image/video. Only for InputMode 0-4, 9 and 10.
4: Expects an anaglyph image or video. Evaluation of the red channel on the left and the green channel on the right side. Only for InputMode 0-4, 9 and 10.
5: Expects two single files, a (monoscopic) RGB image/video as 'left' file and a depth map as 'right' file. Only for InputMode 0-4, 9 and 10.
6: Expects a side-by-side file with a (monoscopic) RGB image/video on the left side and a depth map on the right side. Only for InputMode 0-4, 9 and 10.
7: Portrait images from SmartPhone with embedded depth masks. Only for InputMode 0-4, 9 and 10. The SmartPhone depth mask is extracted and stored to the subfolder "cd". It's (new) extension is "_d" for "depth".

MPO note: When MPO images are opened, they are automatically splittet and stored as jpg images \l\<name>_mpo_l.jpg and \r\<name>_mpo_r.jpg. These temporary files will not be removed (and can be used otherwise), if EstimateGeometry = 0,3,4.
Depth mapping notes: Depth mapping is according to Looking Glass / LeiaPix / SmartPhone standard, so 'white' is foreground, 'black' is background.
For processing depth maps, the parameters EstimateGeometry/EstimateWindow and PreViewerActive are automatically switched off.

DeviationTarget (/DA=33)

Range of values [0:60]
This parameter sets the target deviation for the depth mask->3D conversion. The default value should be 30 per mille (of the image width), but may also be chosen larger or smaller. Values greater than 60 per mille are not supported.

DepthMaskOffset (/DO=0)

Range of values [-DeviationTarget:0]
By default (DepthMaskOffset = 0), the near point is placed exactly in the stereo window during the depth mask->3D conversion. With this parameter, the scenery can be shifted 'forward' (with negative values). A shift 'backwards' (positive values) is not supported with this parameter. The shift is given in per mille of the image width. The maximum displacement '-DeviationTarget' places the stereo window exactly into the far point.

Note: Changing the stereo window is still possible with the parameter WindowOffset as well as manually in the COSIMA PostViewer. With DepthMaskOffset the window is changed already taken into account in the design of the image and may lead to more favorable image edges.

DepthMaskNonlin (/DE=0)

Range of values [-10:10]
With the parameters DepthMaskNonlin and DepthMaskNLType the depth mask can be modified non-linearly before use. At this, DepthMaskNLType determines the type of the modification - possible are the types Gamma and Type Contrast, see description there - and DepthMaskNonlin determines the extent of the change.
Type Gamma: With negative values, the depth mask is selectively lightened, the spatial image thus comes closer. With positive values, the depth mask is selectively dimmed, the spatial image recedes somewhat into the background.
Contrast: Negative values increase the contrast of the depth mask, giving the spatial image a little more volume in the middle areas. With positive values, the depth mask is reduced in contrast, the spatial image becomes somewhat flatter in the middle areas.
Near and far point remain unchanged in each case, clipping does not take place even at the maximum values!

DepthMaskNLType (/DL=0)

Range of values [0,1]
0 (Checkbox not selected), type Gamma: A gamma correction of the depth mask takes place, negative values for DepthMaskNonlin cause a lightening of the depth mask, positive values a darkening.
1 (Checkbox marked), type Contrast: A contrast change of the depth mask takes place, negative values for DepthMaskNonlin cause an increase of the contrast, positive values a decrease.

InverseInput (/II=0)

Range of values [0,1]
Changes left and right input image:
0: Expects a sidecorrect mounting of the stereo image and accordingly a left-right sorting with the unnamed modes.
1: Expects inverse mounting of the stereo image (left/right exchanged) and accordingly a right-left sorting with the unnamed mode. Should be set with "*.jps."-files.

RotMirInputLeft (/RL=0)

Range of values [0-7]
Rotates and mirrors the left input. With this parameter it is possible to rotate and mirror the left input image. This would be necesarry, if one camera has been mounted upside down e.g.
0: No input rotation/mirroring at all.
1: Rotation by +90 degree (no mirroring).
2: Rotation +180 degree (no mirroring).
3: Rotation +270 degree (no mirroring).
4: Horizontal mirroring (left-right).
5: Rotation +90 degree and horizontal mirroring.
6: Vertical mirroring (same as rotation +180 degree and horizontal mirror).
7: Rotation by +270 degree and horizontal mirroring.
-1: The Exif:Orientation key will be evaluated and applied to the image.

RotMirInputRight (/RR=0)

Range of values [0-7]
Rotates and mirrors the right input. With this parameter it is possible to rotate and mirror the right input image. This would be necesarry, if one camera has been mounted upside down e.g..
0: No input rotation/mirroring at all.
1: Rotation by +90 degree (no mirroring).
2: Rotation +180 degree (no mirroring).
3: Rotation +270 degree (no mirroring).
4: Horizontal mirroring (left-right).
5: Rotation +90 degree and horizontal mirroring.
6: Vertical mirroring (same as rotation +180 degree and horizontal mirror).
7: Rotation by +270 degree and horizontal mirroring.
-1: The Exif:Orientation key will be evaluated and applied to the image.

Examples:

Left camera up-side down: RotMirInputLeft = 2, RotMirInputRight = 0; Macro mirror box (CoMirrorBox): RotMirInputLeft = 6, RotMirInputRight = 0; Tri-Delta: RotMirInputLeft = 1, RotMirInputRight = 3, InverseInput = 1 (use also PreSettings = 1!)

CroppInput (/CP=0)

Range of values [0,1,2]
0: To input images of different sizes a frame will be appended to get equal sized images. The color of the frames is set by PasseColor. All image pixels, which have the same color as PasseColor, are changed by a minimum amount.
1: Input images of different sizes will be cropped to get equal sized images.
2: The smaller image will be scaled-up. That functionality is useful for images with strongly different scalings after cutting-out the same image content from both images.

PreSettings (/PS=0)

Range of values [0:1]
Enables preselection of the parameters to be set manually in Image PreViewer
0: No prefix, the PreViewer starts transparently.
1: A PreSettings window opens for preselecting the following parameters:
PreRotationLeft: Rotation in the left image in degrees, positive counterclockwise.
PreRotationRight: Rotation in the right image in degrees, positive counterclockwise.
PreVergenceV: Vergence in degrees, positive value for convergence, negative for divergence.
The input images are cropped with masks, which are defined with the following mask parameters, all units are percent:
LeftImageStartx: With the left image the left edge to cut in percent (range 0% to 70%).
LeftImageStarty: With the left image the lower edge to cut in percent (range 0% to 70%).
LeftImageWidth: With the left image the image width in percent (range 30% to 100%).
LeftImageHeight: With the left image the image height in percent (range 30% to 100%).
RightImageStartx: With the right image the left edge to cut in percent (range 0% to 70%).
With already side-by-side mounted input images, RightImageStartx will start at the middle of the image.
RightImageStarty: With the right image the lower edge to cut in percent (range 0% to 70%).
RightImageWidth: With the right image the image width in percent (range 30% to 100%).
RightImageHeight: With the right image the image height in percent (range 30% to 100%).

Hint: If the PreViewer is activated, it starts with these predefined values. If it is not activated, the values are taken unchanged.
With PreRotationLeft/Right, the horizon can be straightened within certain limits.
With PreVergenceV, the automatic correction can be helped in case of known keystone distortions, as they occur e.g. with a bended mirror attachment.
The masking values are used to cut off a section that is always the same, as occurs, for example, with the a Tri-Delta attachment.

Passepartout (/PP=0)

Range of values [0-6]
Tell Cosima whether image has frames or not, for scanned slides use 4!
0: No passepartout frame will be used.
1: An arbitrarily shaped passepartout frame will be used. This means, that all pixels are mentioned as non-image pixels, which possess the color of PasseColor. They will be ignored during the analysis of the image, but may be added at the resulting images using CroppOutput = 1, if desired. Attention: PassePartout = 1 is only suitable for monochromatic edges! If it is applied to images without monochromatic edges, the result will be undefined.
2 As 1, with an automatic recognition of the framing colors with ignoring the parameters of PasseColor. All four edges are estimated individually. Attention: PassePartout = 2 is only suitable for monochromatic edges! If it is applied to images without monochromatic edges, the result will be undefined.
3: A passepartout with a rectangle frame (of color PasseColor) will be assumed, which should be automatically recognized and suppressed. The image will be cropped from this frame.
4 As 3, with an automatic recognition of the framing colors with ignoring the parameters of PasseColor. All four edges are estimated individually. This is the preferred setting for scanned slides.
5: A passepartout frame will be used, but with the information, which pixels are passepartout pixels, is not get from the image itself but from two separate passepartout files with the identifications <name_l_pass_in.bmp> and <name_r_pass_in.bmp>. These files must have the same sizes as <name_l.bmp> and <name_r.bmp>.

Hint: If the automatic cropping crops too less of the edges, then the value of PasseTolerance must be enhanced, if it is cropped too much, then PasseTolerance must be reduced.

PasseColorRed (/PR=0)

Range of values [0,255]
Only relevant for Passepartout = 1 and 3: Red color value of the passepartout frame.

PasseColorGreen (/PG=0)

Range of values [0,255]
Only relevant for Passepartout = 1 and 3: Green color value of the passepartout frame.

PasseColorBlue (/PB=0)

Range of values [0,255]
Only relevant for Passepartout = 1 and 3: Blue color value of the passepartout frame.

PasseTolerance (/PT=100)

Range of values [0,255]
Tolerance threshold for frame recognition. With PassePartout = 1-4, the passepartout frame has to be extracted from the original image by the program. For that, the program wanders from the outer image boarder to the middle of the image. The edge of the passepartout frame is located exactely at that point, where on that way the color of the image pixel differs more than the value of PasseTolerance from PasseColor (if Passepartout = 1/3) or the value of the estimated color (if Passepartout = 2/4) .

PasseOutput (/PO=0)

Range of values [0,1]
Control the output of recogniced frame. This parameter makes only sense with PassePartout = 1,2,3,4, when the passepartout frame is estimated automatically by the program.
0: No control output.
1: As a control, the estimated passepartout frames are written as files <name>_l_pass_out.bmp and <name>_r_pass_out.bmp.