Entries from 2024-06-01 to 1 month

How to use std::clamp in C++?

C++

What is std::clamp? Ex. 1:Set variable to be in the range min~max. What is std::clamp? This ensures that the variable is within a specified range。 References : std::clamp - cppreference.com Ex. 1:Set variable to be in the range min~max.…

【Anaconda】How to install OpenCV

Conclusion As is written in https://anaconda.org/conda-forge/py-opencv, I used this command. conda install conda-forge::py-opencv If OpenCV is installed correct, its version can be confirmed by this code. import cv2 print(cv2.__version__) …

for_each loop in C++

C++

What is std::for_each? abstract A function for applying a function to elements in the given iterator range. This makes it possible to do things like display all element in a vector without using a for statement. References:for_each - cppr…