pixel_flow_x_sum and pixel_flow_y_sum are int16_t values, so no need for scaling factor 1000 here