Skip to content

Commit

Permalink
feat: add init camera settings
Browse files Browse the repository at this point in the history
  • Loading branch information
FaaizHaikal committed Jul 2, 2024
1 parent 4b03d05 commit 7c72527
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/shisen_cpp/camera/node/camera_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,10 @@ CaptureSetting CameraNode::on_configure_capture_setting(
}

if (new_capture_setting.temperature.is_not_empty()) {
video_capture->set(cv::CAP_PROP_AUTO_WB, 0);
video_capture->set(cv::CAP_PROP_WB_TEMPERATURE, new_capture_setting.temperature);
}

if (new_capture_setting.exposure.is_not_empty()) {
video_capture->set(cv::CAP_PROP_AUTO_EXPOSURE, 1);
video_capture->set(cv::CAP_PROP_EXPOSURE, new_capture_setting.exposure);
}

Expand Down
5 changes: 5 additions & 0 deletions src/shisen_cpp/camera/provider/image_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ ImageProvider::ImageProvider(const Options & options)

video_capture->set(cv::CAP_PROP_FRAME_WIDTH, options.width);
video_capture->set(cv::CAP_PROP_FRAME_HEIGHT, options.height);
video_capture->set(cv::CAP_PROP_AUTOFOCUS, 0); // Disable autofocus
video_capture->set(cv::CAP_PROP_AUTO_WB, 0); // Disable auto white balance
video_capture->set(cv::CAP_PROP_AUTO_EXPOSURE, 1); // Set auto exposure to manual mode
video_capture->set(cv::CAP_PROP_SHARPNESS, 0); // Set sharpness to 0
video_capture->set(cv::CAP_PROP_FOCUS, 0); // Set focus to 0
}

ImageProvider::~ImageProvider()
Expand Down

0 comments on commit 7c72527

Please sign in to comment.