How to efficiently retrieve a subset of cv :: Mat

A common goal of machine learning is to have the first column of a data set representing the class to which the corresponding row for the data point belongs.

Basically, I have cv :: Mat, and I want to efficiently create a cv :: Mat containing this matrix with the first column removed. Is there a more efficient way to do this than iterate over columns and rows and add items one by one with mat.at<data_type>(row, col) = elem; ?

+4
source share
1 answer

See Mat :: operator () from the OpenCV documentation.

+4
source

Source: https://habr.com/ru/post/1434492/


All Articles