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(i,j) - cvFloor(angle.at(i,j)/val) * val;
angle.at(i,j) = result;
}
}
}
↧