From 3aff16a9e002bf5050d8455b2a7b35417476dfe4 Mon Sep 17 00:00:00 2001 From: LLida <3199335945@qq.com> Date: Tue, 2 Dec 2025 21:28:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=86=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E4=B8=94=E6=8F=90=E9=AB=98=E4=BA=86=E5=88=86=E8=BE=A8=E7=8E=87?= =?UTF-8?q?=EF=BC=8C=E7=94=BB=E9=9D=A2=E6=9B=B4=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MindVisionCamera.cpp | 6 +++--- src/MindVisionMain.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MindVisionCamera.cpp b/src/MindVisionCamera.cpp index fe38b12..5494c63 100644 --- a/src/MindVisionCamera.cpp +++ b/src/MindVisionCamera.cpp @@ -319,8 +319,8 @@ bool MindVisionCamera::set_resolution(int width, int height){ res.iIndex = 0xFF; res.iWidth = width; res.iHeight = height; - res.iWidthFOV = res.iWidth; - res.iHeightFOV = res.iHeight; + res.iWidthFOV = capability.sResolutionRange.iWidthMax; + res.iHeightFOV = capability.sResolutionRange.iHeightMax; res.iHOffsetFOV = 0; res.iVOffsetFOV = 0; @@ -329,7 +329,7 @@ bool MindVisionCamera::set_resolution(int width, int height){ this->width = width; this->height = height; image_resolution = res; - return false; + return true; } return false; } \ No newline at end of file diff --git a/src/MindVisionMain.cpp b/src/MindVisionMain.cpp index be33365..4b706b2 100644 --- a/src/MindVisionMain.cpp +++ b/src/MindVisionMain.cpp @@ -64,7 +64,7 @@ void set_camera_resolution(MindVisionCamera& camera, int width, int height) { int main(int /*argc*/, char* /*argv*/[]) { std::string target_color = "red"; 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 // Define optional resolution list (adjust based on camera support)