- open the terminal
- check Python3 installation:
python3 --version
- go to official website to learn details: https://pypi.org/project/opencv-python/
- choose the most complete package and run:
python3 -m pip install opencv-contrib-python
often you will not find the pip installed by default, therefore use the corresponding steps from the
- open the terminal (Ctrl+R + cmd)
- check Python3 installation:
py --version
- go to official website to learn details: https://pypi.org/project/opencv-python/
- choose the most complete package and run:
py -m pip install opencv-contrib-python
- check installation by entering the Python REPL:
py
- import tha library:
import cv2
- open the terminal
- check Python3 installation:
python3 --version
- go to official website to learn details: https://pypi.org/project/opencv-python/
- choose the most complete package and run:
pip install opencv-contrib-python
- check installation by entering the Python REPL:
python3
- import tha library:
import cv2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
int main () { | |
std::vector<int> counters = {10, 20, 30}; | |
// need mutable as lambda by default is a const expression | |
auto passByValueLambda = [=] () mutable { | |
std::cout << "Hello, lambda by value" << std::endl; | |
// modifying the copy - original vector is not influenced |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main () { | |
int counter = 10; | |
auto basicLambdaFunc0 = [] () { std::cout << "Hello, lambda" << counter << std::endl;}; | |
basicLambdaFunc0(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main () { | |
// the most used form of lambdas without return type | |
auto basicLambdaFunc0 = [] () { std::cout << "Hello, lambda0" << std::endl;}; | |
// omitting parameters | |
auto basicLambdaFunc1 = [] { std::cout << "Hello, lambda1" << std::endl;}; | |
// the most detailed syntax |