Modern C++ for Computer Vision and Image Processing Lecture 0: The basics
Ignacio Vizzo and Cyrill Stachniss
Modern C ++ for Computer Vision and Image Processing Lecture 0: - - PowerPoint PPT Presentation
Modern C ++ for Computer Vision and Image Processing Lecture 0: The basics Ignacio Vizzo and Cyrill Stachniss Course Organization Lectures: Wednesday 16:00 (CEST) Held at Youtube live-stream on the course channel. Questions via Youtube
Ignacio Vizzo and Cyrill Stachniss
Held at Youtube live-stream on the course channel. Questions via Youtube channel during the lecture.
Also offline Tutorials. Also ”on-demand” Tutorials. Not all the Tutorials are provided by me.
1
Lectures : Consists of 10 lectures. Homeworks: Consists of 9 hands-on homeworks.
Plan and code inverse image search Groups of 2 people
2
3
4
5
6
7
8
9
0Stack Overflow survey: https://insights.stackoverflow.com/survey/2018/ 0CLion survey: https://blog.jetbrains.com/clion/2015/07/infographics-cpp-facts-before-clion/
10
0Image taken from https://circuitdigest.com/
11
0The following slides are adapted from Avery Wang 0More info at http://www.stroustrup.com/applications.html
12
0Slides adapted from Avery Wang
13
14
15
0The following slides are adapted from Avery Wang
16
1 main:
# @main
2
push rax
3
mov edi, offset std::cout
4
mov esi, offset .L.str
5
mov edx, 13
6
call std::basic_ostream <char, std:: char_traits <char> >& std::__ostream_insert <char, std ::char_traits <char> >(std::basic_ostream <char, std:: char_traits <char> >&, char const*, long)
7
xor eax, eax
8
pop rcx
9
ret
10 _GLOBAL__sub_I_example.cpp:
# @_GLOBAL__sub_I_example.cpp
11
push rax
12
mov edi, offset std::__ioinit
13
call std::ios_base::Init::Init() [complete
14
mov edi, offset std::ios_base::Init::~Init () [complete object destructor]
15
mov esi, offset std::__ioinit
16
mov edx, offset __dso_handle
17
pop rax
18
jmp __cxa_atexit # TAILCALL
19 .L.str: 20
.asciz "Hello, world\n" 17
18
19
Ken Thompson and Dennis Ritchie, creators of the C language. 20
21
22
23
0Image taken from https://www.modernescpp.com/
24
25
0Icon taken from Wikipedia
26
USER SYSTEM usr home ivizzo
tmp local include bin lib
system folders /
27
/home/ivizzo/folder/ — absolute path to a folder /home/ivizzo/file.cpp — absolute path to a file folder/file — relative path to a file
28
29
/ — root folder ~ — home folder . — current folder .. — parent folder
30
31
1 [/home/student]$ cat --help 2 Usage: cat [OPTION]... [FILE]... 3 Concatenate FILE(s) to standard output. 4
equivalent to -vET
5
number nonempty output lines
6 7 Examples: 8
cat f - Output fs contents , then standard input.
9
cat Copy standard input to standard output.
32
1 [/home/student]$ cd D [TAB] [TAB] 2 Desktop/
Documents/ Downloads/
33
34
35
1 [/home/student/Examples/placeholders]$ ls 2 u01.tex
v01.pdf v01.tex
3 u02.tex
v02.pdf v02.tex
4 u03.tex
v03.pdf v03.tex
5 6 [/home/student/Examples/placeholders]$ ls *.pdf 7 v01.pdf
v02.pdf v03.pdf
8 9 [/home/student/Examples/placeholders]$ ls u* 10 u01.tex
u02.tex u03.tex
11 12 [/home/student/Examples/placeholders]$ ls ?01* 13 u01.tex
v01.pdf v01.tex
14 15 [/home/student/Examples/placeholders]$ ls [uv]01* 16 u01.tex
v01.pdf v01.tex
17 18 [/home/student/Examples/placeholders]$ ls u0[^12].tex 19 u03.tex
36
stdin: Standard input: channel 0
stdout: Standard output: channel 1 stderr: Standard error output: channel 2
37
38
39
40
41
42
more/less/cat <filename> Print the contents of the file Most of the time using cat if enough find <in-folder> -name <filename> Search for file <filename> in folder <in-folder>, allows wildcards locate <filename> Search for file <filename> in the entire system! just remember to sudo updatedb often grep <what> <where> Search for a string <what> in a file <where> ag <what> <where> Search for a string <what> in a dir <where>
43
44
https://youtu.be/mV_8GbzwZMM
45
Shows an overview of running processes Allows to kill processes by pressing
k
46
Ctrl + R
!
+ 10 : execute the 10th command
47
48
https://youtu.be/oxuRxtrO2Ag
49
0Icon taken from Wikipedia
50
CLion Qt Creator Eclipse
Visual Studio Code [my preference] Sublime Text 3 Atom VIM [steep learning curve] Emacs [steep learning curve]
0Most icons are from Paper Icon Set: https://snwh.org/paper
51
1 #include <iostream > 2 3 int main() { 4
// Is this your first C++ program?
5
std::cout << "Hello World!" << std::endl;
6
return 0;
7 }
52
On one line that follows // Between /* and */
1 int main() {return 0;}
// Ignored comment.
1 int main() 2 3 {
return 0;
4 } 1 int main() { 2
return /* Ignored comment */ 0;
3 }
53
0https://google.github.io/styleguide/cppguide.html
54
1 int main() { 2
return 0; // Program finished without errors.
3 } 1 int main() { 2
return 1; // Program finished with error code 1.
3 }
55
1 #include "some_file.hpp" 2 // We can use contents of file "some_file.hpp" now. 3 int main() { return 0; }
56
std::cin — maps to stdin std::cout — maps to stdout std::cerr — maps to stderr
1 #include <iostream > 2 int main() { 3
int some_number;
4
std::cout << "please input any number" << std::endl;
5
std::cin >> some_number;
6
std::cout << "number = " << some_number << std::endl;
7
std::cerr << "boring error message" << std::endl;
8
return 0;
9 }
57
Clang [*] [used in examples] GCC
1 c++ -std=c++11 -o hello_world hello_world.cpp 2 ./hello_world
58
https://bit.ly/2JmIqGs [shortened]
59
https://youtu.be/xfBWk4nw440
60
http://www.stroustrup.com/4th.html
61
https://en.cppreference.com/w/cpp
62
https://en.cppreference.com/w/cpp
https://github.com/isocpp/CppCoreGuidelines
https://google.github.io/styleguide/cppguide.html
http://www.cplusplus.com/doc/tutorial/
63