Presentation is loading. Please wait.

Presentation is loading. Please wait.

Softwaretechnologie für Fortgeschrittene Teil Eide Stunde II: Bildverarbeitung Köln 3. Dezember 2015.

Similar presentations


Presentation on theme: "Softwaretechnologie für Fortgeschrittene Teil Eide Stunde II: Bildverarbeitung Köln 3. Dezember 2015."— Presentation transcript:

1 Softwaretechnologie für Fortgeschrittene Teil Eide Stunde II: Bildverarbeitung Köln 3. Dezember 2015

2 GUI vs. command line What are the main differences? – trying out things – stability vs. flexibility – documentation – reproducibility – speed Use GUI to establish values for command line Keep the original!

3 Scripting List of commands in bash: #!/bin/bash convert file1.tif –quality 85% file1.jpg convert file2.tif –quality 85% file2.jpg convert file3.tif –quality 85% file3.jpg convert file4.tif –quality 85% file4.jpg convert file5.tif –quality 85% file5.jpg …

4 Scripting int return; std::stringstream comm; for (i=0; i<100; i++) { comm << “convert file” << i << “.tif –quality 85% file” << i << “.jpg”; return= system (comm.str()); // Test return value }

5 Quality as parameter int return; std::stringstream comm; char[] quality = “ 85% ”; for (i=0; i<100; i++) { comm << “convert file” << i << “.tif –quality” << quality << “file” << i << “.jpg”; return= system (comm.str()); // Test return value }

6 Operations as parameter int return; std::stringstream comm; char[] oper = “ -quality 85% -geometry 1000x1000 ”; for (i=0; i<100; i++) { comm << “convert file” << i + “.tif” << oper << “file” << i << “.jpg”; return= system (comm.str()); // Test return value }

7 Scripting vs. interactive What are the main differences? – trying out things – stability vs. flexibility – documentation – reproducibility – speed – batch processing – queue handling – dynamic parameters Use GUI to establish values for command line Keep the original!

8 Converting a tree I (pseudocode) inFileExt= {“tif”, “tiff”, “TIF”, “TIFF”} outFileExt= “jpeg” outFolderName= “JPEG” function readFolder(folder, paras) openFolder(folder) fileNames= folder.getFileNames outdir << folder << outFolderName system (mkdir outdir) foreach (fileName in fileNames) if (folder) readFolder(fileName, paras) else if (endsWith(fileName, inFileExt) processPicture(fileName, outdir, paras)

9 Converting a tree II (pseudocode) function processPicture(fileName, outdir, paras) int ret; outFileName= createOutfilename(fileName, outdir) if (!exists outFileName) komm << “convert ” << fileName << paras << outFileName ret= system (komm) // Handle return value


Download ppt "Softwaretechnologie für Fortgeschrittene Teil Eide Stunde II: Bildverarbeitung Köln 3. Dezember 2015."

Similar presentations


Ads by Google