Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

is here any builtin Modulo function on Matices ?

I've a Mat object containing these orientation values (0 to 360), i want buy using modulo operation to represent them between (0 to 180) range

   Mat a, b, c;
   ...
   c= mod(a,b); // a - floor(a/b) * b

is here there any builtin Modulo function on Matices ?

I've a Mat object containing these orientation values (0 to 360), i want buy using modulo operation to represent them between (0 to 180) range

   Mat a, b, c;
   ...
   c= mod(a,b); // a - floor(a/b) * b

is there any builtin Modulo function on Matices ?

I've a Mat object containing these orientation values (0 to 360), i want buy using modulo operation to represent them between (0 to 180) range

   Mat a, b, c;
b;
   ...
   c= mod(a,b); b = mod(a,180); // a x - floor(a/b) floor(x/y) * b
y

is there any builtin Modulo function on Matices ?

I've a Mat object containing these orientation values (0 to 360), i want buy by using modulo operation to represent them between (0 to 180) range

   Mat a, b;
   ...
   b = mod(a,180); // x - floor(x/y) * y

is there any builtin Modulo function on Matices ?

I've a Mat object containing these orientation values (0 to 360), i want by using modulo operation to represent them between (0 to 180) range

   Mat a, b;
   ...
   b = mod(a,180); // x - floor(x/y) * y

didn't find it, i tried this instead

   void Modulo(Mat &angle, int val){
       for(int i = 0; i < angle.rows; i++){
          for(int j = 0; j < angle.cols; j++){
              // x - floor(x/y) * y
              float result = angle.at<float>(i,j) - cvFloor(angle.at<float>(i,j)/val) * val; 
              angle.at<float>(i,j) = result;
          }
       }
   }