Scalar pow(int n) { return Scalar( math.pow(val1, n) as double, math.pow(val2, n) as double, math.pow(val3, n) as double, math.pow(val4, n) as double, ); }