Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Set multiple rows and single column at the same time in Matrix

Hi,

i'd like to know how to set multiple rows and single column at the same time in Matrix.

Ex:

Mat my_matrix = Mat::zeros(100, 4, CV_32S);

suppose that I want to set:

  • rows 0-24 column 1 as 1;
  • rows 25-49 column 2 as 1;
  • rows 50-74 column 3 as 1;
  • rows 75-99 column 4 as 1;