Opencv cpp api - #555
Merged
Merged
Conversation
Signed-off-by: Rich Mattes <richmattes@gmail.com>
fnusb_open_subdevices checked for camera==NULL or res < 0 before jumping to the failure case. If camera was NULL but res was not 0, the function would return 0 indicating success. This occurs when a kinect is not plugged into the PC. Forcing res to be negative when the camera == NULL case allows the failure to open a device to propagate through an application. alloc_kinect in freenect_sync has a check for if freenect_open_device fails, but the logic is incorrect. freenect_open_device returns 0 on success and < 0 on error, so adding a check to see if the return is < 0 corrects detection of the failure case. Signed-off-by: Rich Mattes <richmattes@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes fixes to use the OpenCV api in C++ mode, and fixes to some error handling issues I found when trying to run "freenect-cvdemo" without a kinect plugged into the PC (the application would segfault instead of notifying the user that it could not open a camera.) It should fix #553.