解决了画面不全的问题,并且提高了分辨率,画面更全

This commit is contained in:
2025-12-02 21:28:58 +08:00
parent eb32ca121d
commit 3aff16a9e0
2 changed files with 4 additions and 4 deletions

View File

@@ -319,8 +319,8 @@ bool MindVisionCamera::set_resolution(int width, int height){
res.iIndex = 0xFF; res.iIndex = 0xFF;
res.iWidth = width; res.iWidth = width;
res.iHeight = height; res.iHeight = height;
res.iWidthFOV = res.iWidth; res.iWidthFOV = capability.sResolutionRange.iWidthMax;
res.iHeightFOV = res.iHeight; res.iHeightFOV = capability.sResolutionRange.iHeightMax;
res.iHOffsetFOV = 0; res.iHOffsetFOV = 0;
res.iVOffsetFOV = 0; res.iVOffsetFOV = 0;
@@ -329,7 +329,7 @@ bool MindVisionCamera::set_resolution(int width, int height){
this->width = width; this->width = width;
this->height = height; this->height = height;
image_resolution = res; image_resolution = res;
return false; return true;
} }
return false; return false;
} }

View File

@@ -64,7 +64,7 @@ void set_camera_resolution(MindVisionCamera& camera, int width, int height) {
int main(int /*argc*/, char* /*argv*/[]) { int main(int /*argc*/, char* /*argv*/[]) {
std::string target_color = "red"; std::string target_color = "red";
int cam_id = 0; int cam_id = 0;
cv::Size default_resolution(640, 480); cv::Size default_resolution(1280, 720);
bool use_ttl = false; // Set to false to disable TTL communication bool use_ttl = false; // Set to false to disable TTL communication
// Define optional resolution list (adjust based on camera support) // Define optional resolution list (adjust based on camera support)