Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can reshape() it to a 3 cols* (initial_rows*initial_cols) rows, then use cv::reduce() by summing up the cols, then reshape it back to initial_rows-by-initial_cols. You won't need the split.

You can reshape() it to a 3 cols* (initial_rows*initial_cols) rows, then use cv::reduce() by summing up the cols, then reshape it back to initial_rows-by-initial_cols. You won't need the split.

Note that reshape() does not reallocate or move elements, just inteprets their order in a different way, so it it very fast.