-
Notifications
You must be signed in to change notification settings - Fork 612
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 control added in k4arecorder #161
Conversation
examples/k4arecorder/main.cpp
Outdated
{ | ||
throw std::runtime_error("Exposure value range is 1 to -11."); | ||
} | ||
absoluteExposureValue = (int32_t)(exp2f((float)exposureValue) * 1000000.0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is c++ we should be using static_cast instead of c style casts
absoluteExposureValue = (int32_t)(exp2f((float)exposureValue) * 1000000.0f); | |
absoluteExposureValue = static_cast<int32_t>(exp2f(static_cast<float>(exposureValue)) * 1000000.0f); |
examples/k4arecorder/main.cpp
Outdated
@@ -320,6 +321,17 @@ int main(int argc, char **argv) | |||
} | |||
subordinate_delay_off_master_usec = (uint32_t)delay; | |||
}); | |||
cmd_parser.RegisterOption("-e|--exposure-control", | |||
"Set manual exposure value for the RGB camera (default: auto exposure)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to understand. It looks like the user should user put a number after -e? What does that number represent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would probably be good to document the accepted range of values here, instead of just in the error.
examples/k4arecorder/main.cpp
Outdated
int exposureValue = std::stoi(args[0]); | ||
if (exposureValue < -11 || exposureValue > 1) | ||
{ | ||
throw std::runtime_error("Exposure value range is 1 to -11."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does an exposure of "-11" mean? What about an exposure of "1"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's value for exposure control, which is converted to absolute exposure time.
absoluteExposureValue = static_cast<int32_t>(exp2f(static_cast(exposureValue)) * 1000000.0f);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your fast reply. I wonder if the range from 2500us to 10000us is too big. Is it possible to get a intermediate value like 5000 us for a 50hz power freq? |
Tested on FW 1.5.926614.
Minor change to exposure control code in fastcapture tool.