First time here? Check out the FAQ!
In regards to the output being -1 x -1, in case the number of dimensions of a cv::Mat is greater than 2, you have to get