try fix gray
This commit is contained in:
@@ -282,7 +282,21 @@ private:
|
|||||||
|
|
||||||
// Set pixel format to RGB8 (try to force color output)
|
// Set pixel format to RGB8 (try to force color output)
|
||||||
// PixelType_Gvsp_RGB8_Packed = 0x02100014
|
// PixelType_Gvsp_RGB8_Packed = 0x02100014
|
||||||
(void)MV_CC_SetEnumValue(camera_handle_, "PixelFormat", PixelType_Gvsp_RGB8_Packed);
|
int set_ret = MV_CC_SetEnumValue(camera_handle_, "PixelFormat", PixelType_Gvsp_RGB8_Packed);
|
||||||
|
if (set_ret != MV_OK) {
|
||||||
|
FYT_WARN("camera_driver", "Failed to set PixelFormat to RGB8: [0x{:x}]", set_ret);
|
||||||
|
} else {
|
||||||
|
FYT_INFO("camera_driver", "PixelFormat set to RGB8");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for pixel format to take effect
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
|
|
||||||
|
// Verify pixel format
|
||||||
|
MVCC_ENUMVALUE enum_value = {0};
|
||||||
|
if (MV_CC_GetEnumValue(camera_handle_, "PixelFormat", &enum_value) == MV_OK) {
|
||||||
|
FYT_INFO("camera_driver", "Current PixelFormat: 0x{:x}", enum_value.nCurValue);
|
||||||
|
}
|
||||||
|
|
||||||
// Set exposure / gain
|
// Set exposure / gain
|
||||||
(void)MV_CC_SetFloatValue(camera_handle_, "ExposureTime", static_cast<float>(exposure_time_));
|
(void)MV_CC_SetFloatValue(camera_handle_, "ExposureTime", static_cast<float>(exposure_time_));
|
||||||
|
|||||||
Reference in New Issue
Block a user