Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ofxKinectForWindows2 and ofxFlowTools #11

Closed
rootux opened this issue Feb 18, 2016 · 2 comments
Closed

Using ofxKinectForWindows2 and ofxFlowTools #11

rootux opened this issue Feb 18, 2016 · 2 comments

Comments

@rootux
Copy link

rootux commented Feb 18, 2016

I've tried combining ofxKinectForWindows2 and ofxFlowTools to read data from the kinect camera.
https://github.com/rootux/visionquest
I'm calling the kinect like so:
kinect.getColorSource()->draw(0, 0, cameraFbo.getWidth(), cameraFbo.getHeight());
I've tried the IR and the depth - all seem to be drawing the camera OK *_without *_going through the filters (see attached Image )

What am I missing?

@shenberg
Copy link

Okay, I got a windows pc and spent time debugging this and found the issue (this applies to the various closed issues on windows/linux):

@moostrik ftOpticalFlowShader.h was broken in commit d7e723b - specifically flow = normalize(flow) * vec2(strength); with flow starting as (0,0) will result in flow being either (NaN, NaN) or (Infinity, Infinity). For some reason, on mac when you read nan/infinity from a float texture you get 0 (from Nvidia at least, I've seen forum posts about intel returning nan/inf properly), while in win/linux you get nan/infinty.

Once you get invalid FP values they propagate through the system and poison all the textures due to everything being feedback-based. Reverting to the old code solves the issue at the cost of a somewhat unnoticeable difference in behavior (threshold is set low enough by default that I can't tell the difference between the two shaders).

@moostrik
Copy link
Owner

wow, this clarifies a lot!
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants