What is the correct way of getting a pointer to an image/cv::Mat row?
The question in general is: What is the correct way of getting a pointer to an image/cv::Mat row?
Background: I was checking the code of CCStatsOp inside /modules/imgproc/src/connectedcomponents.cpp
I saw that to get a pointer to an image row the following code is used:
int *row = &statsv.at<int>(l, 0);
But I wonder: Wouldn't the following be more efficient?
int *row = statsv.ptr<int>(l);
The second one is the preferred method, yes.