In the previous recipe, you were introduced to the
cv::Mat data structure. As mentioned, this is a key element of the library. It is used to manipulate images and matrices (in fact, an image is a matrix from a computational and mathematical point of view). Since you will be using this data structure extensively in your application developments, it is imperative that you become familiar with it. Notably, you will learn in this recipe that this data structure incorporates an elegant memory management mechanism, allowing efficient usage.
Let's write the following test program that will allow us to test the different properties of the
cv::Mat data structure:
#include <iostream> #include <opencv2/core/core.hpp> ...