Update opticflow_calculator.c

This fixes that division by previous_frame_offset is now no longer ignored. Now if a user applies a longer horizon, the value is calculated as it should be.
This commit is contained in:
OpenUAS
2017-05-16 10:54:27 +02:00
committed by GitHub
parent d683d4b52a
commit 124fa3267d
@@ -534,8 +534,8 @@ void calc_edgeflow_tot(struct opticflow_t *opticflow, struct opticflow_state_t *
edgeflow.flow_x = -1 * edgeflow.flow_x;
edgeflow.flow_y = -1 * edgeflow.flow_y;
result->flow_x = (int16_t)edgeflow.flow_x / previous_frame_offset[0];
result->flow_y = (int16_t)edgeflow.flow_y / previous_frame_offset[1];
edgeflow.flow_x = (int16_t)edgeflow.flow_x / previous_frame_offset[0];
edgeflow.flow_y = (int16_t)edgeflow.flow_y / previous_frame_offset[1];
result->flow_x = (int16_t)edgeflow.flow_x / RES;
result->flow_y = (int16_t)edgeflow.flow_y / RES;