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

Exposure fix for PS3EYEDriver in Windows and OSX. #152

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion external/PS3EYEDriver
Submodule PS3EYEDriver updated 3 files
+3 −3 src/ps3eye.cpp
+30 −0 src/ps3eyedriver.cpp
+12 −0 src/ps3eyedriver.h
4 changes: 3 additions & 1 deletion src/tracker/platform/camera_control_macosx.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
**/

#include "../camera_control.h"
#include "../camera_control_private.h"

#include "psmove_osxsupport.h"

Expand All @@ -45,7 +46,8 @@ camera_control_set_parameters(CameraControl* cc,
{
#if defined(CAMERA_CONTROL_USE_PS3EYE_DRIVER)
// TODO: Implement setting those parameters on cc->eye
psmove_WARNING("Unimplemented: Setting of PS3EYEDriver parameters\n");
ps3eye_set_parameters(cc->eye, autoG > 0, autoWB > 0, gain, exposure, contrast, brightness);
psmove_WARNING("Unimplemented: Only some PS3EYEDriver parameters set.\n");
#else
macosx_camera_set_exposure_lock(1);
#endif
Expand Down
4 changes: 3 additions & 1 deletion src/tracker/platform/camera_control_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ void camera_control_set_parameters(CameraControl* cc, int autoE, int autoG, int
if (cc->capture) {
cvReleaseCapture(&cc->capture);
}


ps3eye_set_parameters(cc->eye, autoG > 0, autoWB > 0, gain, exposure, contrast, brightness);
Copy link
Owner

Choose a reason for hiding this comment

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

Indentation


int width, height;
get_metrics(&width, &height);

Expand Down
4 changes: 2 additions & 2 deletions src/tracker/psmove_tracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ psmove_tracker_set_exposure(PSMoveTracker *tracker,
float target_luminance = 0;
switch (tracker->exposure_mode) {
case Exposure_LOW:
target_luminance = 0;
target_luminance = 1;
break;
case Exposure_MEDIUM:
target_luminance = 25;
Expand Down Expand Up @@ -1545,7 +1545,7 @@ psmove_tracker_free(PSMoveTracker *tracker)
int
psmove_tracker_adapt_to_light(PSMoveTracker *tracker, float target_luminance)
{
float minimum_exposure = 2051;
float minimum_exposure = 1; // Was 2051
Copy link
Owner

Choose a reason for hiding this comment

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

Won't this break stuff on non-PS3EYEDriver targets? (such as Linux, Windows)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It may break non PS3EYEDriver targets. I don't know, I can't test. Where did those original numbers come from? They are not at all in the correct range for the PS3EYEDriver. Maybe they should not be hard-coded. See my comment below.

float maximum_exposure = 65535;
float current_exposure = (maximum_exposure + minimum_exposure) / 2.;

Expand Down