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 control added in k4arecorder #161

Merged
merged 4 commits into from
Mar 21, 2019

Conversation

qqzen
Copy link
Contributor

@qqzen qqzen commented Mar 20, 2019

Tested on FW 1.5.926614.
Minor change to exposure control code in fastcapture tool.

{
throw std::runtime_error("Exposure value range is 1 to -11.");
}
absoluteExposureValue = (int32_t)(exp2f((float)exposureValue) * 1000000.0f);
Copy link
Contributor

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

Suggested change
absoluteExposureValue = (int32_t)(exp2f((float)exposureValue) * 1000000.0f);
absoluteExposureValue = static_cast<int32_t>(exp2f(static_cast<float>(exposureValue)) * 1000000.0f);

@@ -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)",
Copy link
Contributor

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?

Copy link
Contributor

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.

int exposureValue = std::stoi(args[0]);
if (exposureValue < -11 || exposureValue > 1)
{
throw std::runtime_error("Exposure value range is 1 to -11.");
Copy link
Contributor

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"?

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's value for exposure control, which is converted to absolute exposure time.
absoluteExposureValue = static_cast<int32_t>(exp2f(static_cast(exposureValue)) * 1000000.0f);

Choose a reason for hiding this comment

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

if exposureValue = -6 , absoluteExposureValue =15625. What does "30000" mean in this table below? Is final absolute Exposure time 15625 or 30000?
RGB camera exposure time values

@qqzen qqzen merged commit 0f60b3b into develop Mar 21, 2019
@Brent-A Brent-A deleted the user/qizen/k4arecorder_exposure_control branch April 30, 2019 00:55
@wes-b
Copy link
Contributor

wes-b commented Aug 10, 2019 via email

@wqs111000
Copy link

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?
I want to shoot moving objects, that is the exposure time need be small but not too small to get unambiguous and bright photos under different lighting conditions.

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

Successfully merging this pull request may close these issues.

None yet

5 participants