Thanks to visit codestin.com
Credit goes to github.com

Skip to content

edgeflow: improved optic flow calculation#1558

Merged
flixr merged 13 commits into
paparazzi:masterfrom
knmcguire:pull_request_ARdrone_edgeflow
Mar 21, 2016
Merged

edgeflow: improved optic flow calculation#1558
flixr merged 13 commits into
paparazzi:masterfrom
knmcguire:pull_request_ARdrone_edgeflow

Conversation

@knmcguire

Copy link
Copy Markdown
Contributor

Hi,

I developed a new method to calculate the global optical flow in a efficient way. It should run twice as fast as the current implementation.

I tried to rewrite the opticflow_calculator.c a bit so that more methods can be added more easily, since before it was specifically written for fast9/LK implementation. On top of that I tried to use the existing structures as much as possible, so that I can switch between different methods on the fly. A couple of new files are added to the lib folder (edge_flow.c & .h)

Any comments/ suggestions for changes are welcome. @dewagter, can you also take a look at this?

Cheers, K

@flixr

flixr commented Mar 11, 2016

Copy link
Copy Markdown
Member

Looks good to me, and nicely documented parameters, etc 👍

although I have no means of testing it...

@flixr

flixr commented Mar 11, 2016

Copy link
Copy Markdown
Member

Just as a reminder for all involved, not really for this pull request:
The capturing should not be done by the opticflow module...
@dewagter already changed that once, see #1370

@flixr flixr changed the title Pull request edgeflow edgeflow: improved optic flow calculation Mar 11, 2016
@flixr flixr added the Module label Mar 11, 2016
} else {
if (opticflow->method == 1) {
calc_edgeflow_tot(opticflow, state, img, result);
} else {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work as you probably intended...
PRINT_CONFIG_MSG will print the message during compilation if the "print config" checkbox is enabled.
Since this already a preprocessor macro, the else condition does nothing here and it will always be printed.

@knmcguire

Copy link
Copy Markdown
Contributor Author

Hi Felix thanks for your comments, I'll try to fix these this afternoon.

Also it seems that the opticflow airframe in TUDELFT folder was not updated to include

+    <load name="video_thread.xml">
 +      <define name="VIDEO_THREAD_FPS" value="30"/>
 +      <define name="VIDEO_THREAD_CAMERA" value="bottom_camera"/>
 +    </load>

I used that airframe to test it...However... it still captured the bottom camera.

I see that in the opticflow module, the video device is also initialized, so with this extra module it will be doing this double, which it is now doing in the example opticalflow airframe. I think I should remove this completely from the opticflow_module.c to make it more up to date to the current changes right?

@knmcguire

Copy link
Copy Markdown
Contributor Author

with the dots I mean the video_thread module btw

@flixr

flixr commented Mar 14, 2016

Copy link
Copy Markdown
Member

Well, while the capturing should indeed be done by the video_thread module instead of directly in the opticflow_module (which btw is a bit of a misnomer), this will only be a real option as soon as the video_thread module supports capturing multiple video sources... otherwise you'd have no option to use the front camera at the same time...

@knmcguire

Copy link
Copy Markdown
Contributor Author

Ah okay, I also see now that the example optical flow doesn't have the thread module yet indeed, so I'll leave it at this for now. I did change the config msg to a error message on the top at the defines, so it will only show if define METHOD goes over 1.

Also I added a derotation setting to turn it off if the gyroscopes measurements is too noisy or such. It was not the case with my ardrone but I experienced cases where the quality is better when it is turned off.

Anyway, I hope the pull request is okay now?

@flixr

flixr commented Mar 15, 2016

Copy link
Copy Markdown
Member

Since you also requested a review from @dewagter, I'll let him review and merge it...

@knmcguire

Copy link
Copy Markdown
Contributor Author

Oke no problem. @fvantienen is a good candidate as well since he made the major change to the code the last time

@dewagter

Copy link
Copy Markdown
Member

@flixr Just read through the code. Looks great. I see no reason not to merge as is.

Will keep in mind to plug opticflow in videothread as soon as we can start multiple threads.

flixr added a commit that referenced this pull request Mar 21, 2016
edgeflow: improved optic flow calculation

a new method to calculate the global optical flow in a efficient way. It should run twice as fast as the current implementation.
@flixr flixr merged commit 382873a into paparazzi:master Mar 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants