|
@@ -226,17 +226,20 @@ int main() {
|
|
|
if (camera.is_capturing()) {
|
|
if (camera.is_capturing()) {
|
|
|
ImGui::BeginDisabled();
|
|
ImGui::BeginDisabled();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
ImGui::SliderInt("Frame Rate (fps)", &camera_fps, 1, 60);
|
|
ImGui::SliderInt("Frame Rate (fps)", &camera_fps, 1, 60);
|
|
|
- ImGui::DragFloat("Exposure Time (ms)", &exposure_time_ms,
|
|
|
|
|
- 0.1, 1, 1e3f / (float) camera_fps, "%.01f");
|
|
|
|
|
- ImGui::DragFloat("Analog Gain (dB)", &analog_gain, 0.1, 0, 24, "%.01f");
|
|
|
|
|
-
|
|
|
|
|
if (camera.is_capturing()) {
|
|
if (camera.is_capturing()) {
|
|
|
ImGui::EndDisabled();
|
|
ImGui::EndDisabled();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ ImGui::DragFloat("Exposure Time (ms)", &exposure_time_ms,
|
|
|
|
|
+ 0.1, 0.1, 1e3f / (float) camera_fps, "%.01f");
|
|
|
|
|
+ ImGui::DragFloat("Analog Gain (dB)", &analog_gain, 0.1, 0, 23.5, "%.01f");
|
|
|
|
|
+
|
|
|
if (camera.is_capturing()) {
|
|
if (camera.is_capturing()) {
|
|
|
|
|
+ // capture config
|
|
|
|
|
+ camera.set_capture_config(1000 * exposure_time_ms, analog_gain);
|
|
|
|
|
+
|
|
|
|
|
+ // preview config
|
|
|
ImGui::SeparatorText("Preview Camera");
|
|
ImGui::SeparatorText("Preview Camera");
|
|
|
ImGui::RadioButton("Left", &preview_cam, 0);
|
|
ImGui::RadioButton("Left", &preview_cam, 0);
|
|
|
ImGui::SameLine();
|
|
ImGui::SameLine();
|
|
@@ -438,10 +441,11 @@ int main() {
|
|
|
|
|
|
|
|
if (camera.is_capturing()) {
|
|
if (camera.is_capturing()) {
|
|
|
// draw frame in the screen
|
|
// draw frame in the screen
|
|
|
|
|
+ float width_normal = 1.0f * frame_height * image_width / frame_width / image_height;
|
|
|
if (preview_cam == 0) { // left cam
|
|
if (preview_cam == 0) { // left cam
|
|
|
- left_ar.render({-1, 1, 2, -2});
|
|
|
|
|
|
|
+ left_ar.render({-width_normal, 1, 2 * width_normal, -2});
|
|
|
} else {
|
|
} else {
|
|
|
- right_ar.render({-1, 1, 2, -2});
|
|
|
|
|
|
|
+ right_ar.render({-width_normal, 1, 2 * width_normal, -2});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|