Skip to content

Commit

Permalink
[opticflow] cosmetics: max line length
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Jan 28, 2015
1 parent 7eb4a86 commit 5a7e862
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions sw/airborne/modules/computer_vision/opticflow/visual_estimator.c
Expand Up @@ -86,7 +86,6 @@ float cam_h, diff_roll, diff_pitch, OFx_trans, OFy_trans;
// Lateral Velocity Computation
float Velx, Vely;

// Compute body velocities
struct FloatVect3 V_body;

// Called by plugin
Expand Down Expand Up @@ -132,23 +131,24 @@ void opticflow_plugin_run(unsigned char *frame)
old_img_init = 0;
}

// ***********************************************************************************************************************
// *************************************************************************************
// Additional information from other sensors
// ***********************************************************************************************************************
// *************************************************************************************

// Compute body velocities from ENU
struct FloatVect3 *vel_ned = (struct FloatVect3*)stateGetSpeedNed_f();
struct FloatQuat *q_n2b = stateGetNedToBodyQuat_f();
float_quat_vmult(&V_body, q_n2b, vel_ned);

// ***********************************************************************************************************************
// *************************************************************************************
// Corner detection
// ***********************************************************************************************************************
// *************************************************************************************

// FAST corner detection
int fast_threshold = 20;
xyFAST *pnts_fast;
pnts_fast = fast9_detect((const byte *)prev_gray_frame, imgWidth, imgHeight, imgWidth, fast_threshold, &count);
pnts_fast = fast9_detect((const byte *)prev_gray_frame, imgWidth, imgHeight, imgWidth,
fast_threshold, &count);

if (count > MAX_COUNT) { count = MAX_COUNT; }
for (int i = 0; i < count; i++) {
Expand Down Expand Up @@ -193,13 +193,13 @@ void opticflow_plugin_run(unsigned char *frame)
count = count_fil;
free(labelmin);

// **********************************************************************************************************************
// *************************************************************************************
// Corner Tracking
// **********************************************************************************************************************
// *************************************************************************************
CvtYUYV2Gray(gray_frame, frame, imgWidth, imgHeight);

error_opticflow = opticFlowLK(gray_frame, prev_gray_frame, x, y, count_fil, imgWidth, imgHeight, new_x, new_y, status,
5, 100);
error_opticflow = opticFlowLK(gray_frame, prev_gray_frame, x, y, count_fil, imgWidth,
imgHeight, new_x, new_y, status, 5, 100);

flow_count = count_fil;
for (int i = count_fil - 1; i >= 0; i--) {
Expand Down Expand Up @@ -289,17 +289,18 @@ void opticflow_plugin_run(unsigned char *frame)
Vely = 0.0;
}

// **********************************************************************************************************************
// *************************************************************************************
// Next Loop Preparation
// **********************************************************************************************************************
// *************************************************************************************

memcpy(prev_frame, frame, imgHeight * imgWidth * 2);
memcpy(prev_gray_frame, gray_frame, imgHeight * imgWidth);

// **********************************************************************************************************************
// *************************************************************************************
// Downlink Message
// **********************************************************************************************************************
DOWNLINK_SEND_OF_HOVER(DefaultChannel, DefaultDevice, &FPS, &dx_sum, &dy_sum, &OFx, &OFy, &diff_roll, &diff_pitch,
&Velx, &Vely, &V_body.x, &V_body.y, &cam_h, &count);
// *************************************************************************************
DOWNLINK_SEND_OF_HOVER(DefaultChannel, DefaultDevice, &FPS, &dx_sum, &dy_sum, &OFx, &OFy,
&diff_roll, &diff_pitch, &Velx, &Vely, &V_body.x, &V_body.y,
&cam_h, &count);
}

0 comments on commit 5a7e862

Please sign in to comment.