I want to store the total number of horizontal pixels and vertical pixels in an image in a 2D Array. What should be the syntax to carry this out in c++ using opencv? This is my code in C++ using opencv libraries.
using namespace std;
using namespace cv;
Mat image=imread("task1-1.png");
const int IDIM = image.rows; // horizontal size of the squares
const int JDIM = image.cols; // vertical size size of the squares
int squares[IDIM][JDIM];
It gives me an error stating:
array bound is not an integer constant before ‘]’ token int squares[IDIM][JDIM]; ^ array bound is not an integer constant before ']' token int squares[IDIM][JDIM]; ^
What should be the correct way to carry this out?