Skip to content

Commit 46e7fc8

Browse files
authored
Merge pull request #30 from ichiro-its/hotfix/init-camera-settings
[Hotfix] - Add Initial Camera Settings
2 parents 4b03d05 + 7c72527 commit 46e7fc8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/shisen_cpp/camera/node/camera_node.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,10 @@ CaptureSetting CameraNode::on_configure_capture_setting(
192192
}
193193

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

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

src/shisen_cpp/camera/provider/image_provider.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ ImageProvider::ImageProvider(const Options & options)
3838

3939
video_capture->set(cv::CAP_PROP_FRAME_WIDTH, options.width);
4040
video_capture->set(cv::CAP_PROP_FRAME_HEIGHT, options.height);
41+
video_capture->set(cv::CAP_PROP_AUTOFOCUS, 0); // Disable autofocus
42+
video_capture->set(cv::CAP_PROP_AUTO_WB, 0); // Disable auto white balance
43+
video_capture->set(cv::CAP_PROP_AUTO_EXPOSURE, 1); // Set auto exposure to manual mode
44+
video_capture->set(cv::CAP_PROP_SHARPNESS, 0); // Set sharpness to 0
45+
video_capture->set(cv::CAP_PROP_FOCUS, 0); // Set focus to 0
4146
}
4247

4348
ImageProvider::~ImageProvider()

0 commit comments

Comments
 (0)