# 视觉引导运控上位机调试软件 **Repository Path**: cqnetdev/VisualGuidEmotioncontrol ## Basic Information - **Project Name**: 视觉引导运控上位机调试软件 - **Description**: 软件WinFrom+OpenCV,硬件雷赛控制器+三轴机台。开发视觉识别轨迹引导运动控制的调试与自动采集检测运动,另外还有使用GDI实现的写字机功能 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2026-06-02 - **Last Updated**: 2026-06-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # VisualGuidEmotioncontrol Visual Guidance Motion Control System ## Project Overview This project is a visual guidance motion control system built on Windows Forms, integrating industrial camera image acquisition, image processing, coordinate calibration, and multi-axis motion control. The system enables visual recognition of target objects and converts image coordinates into mechanical coordinates for precise motion control. ## Features - **Industrial Camera Control**: Supports image acquisition and display from Hikvision GigE cameras - **Image Processing**: Track detection, polygon recognition, and contour extraction using OpenCvSharp - **Coordinate Calibration**: Conversion from image coordinates to mechanical coordinates - **Motion Control**: Precise multi-axis motion control via Leadshine LTSMC motion control card - **Trajectory Generation**: Supports text-to-trajectory conversion, polygon trajectory generation, and continuous motion - **Manual Control**: Supports manual jog control for each axis and movement to safe positions ## Technology Stack - **Framework**: .NET Framework 4.7.2 + Windows Forms - **Camera SDK**: Hikrobot MvCameraControl.NET (Hikvision) - **Image Processing**: OpenCvSharp 4.x - **Motion Control**: Leadshine LTSMC.dll (Leadshine SMC IDE) - **JSON Processing**: Newtonsoft.Json - **Communication**: TCP/IP Ethernet communication ## Project Structure ``` VisualGuidEmotioncontrol/ ├── LaisaiMotionService/ # Motion control service program │ ├── LTSMC.cs # Motion control card DLL import definitions │ └── Program.cs # Main service program ├── WindowsFormsApp/ # Main application │ ├── Helper/ # Helper classes │ │ ├── CalibrationHelper.cs # Calibration helper class │ │ ├── ImageProcessor.cs # Image processing class │ │ ├── LaisaiMotionController.cs # Motion controller wrapper class │ │ ├── MotionClient.cs # Motion service client │ │ ├── PolygonProcessor.cs # Polygon processing class │ │ └── TextToTrajectory.cs # Text-to-trajectory class │ ├── MainForm.cs # Main form │ ├── LTSMC.cs # Motion control DLL definitions │ └── App.config # Application configuration ├── MvCameraControl.Net.dll # Hikvision camera SDK └── OpenCvSharp.dll # OpenCV wrapper library ``` ## Core Module Descriptions ### 1. CalibrationHelper (Coordinate Calibration) Implements conversion from image coordinates to mechanical coordinates, supporting a two-point calibration algorithm: - Image coordinate → Mechanical coordinate transformation - Calibration parameters saving and loading (in JSON format) ### 2. ImageProcessor (Image Processing) Image processing and trajectory point extraction from track images: - Image grayscale conversion and thresholding - Contour detection and line fitting - Trajectory point generation ### 3. PolygonProcessor (Polygon Processing) Polygon region detection and trajectory planning: - Polygon contour detection - Polygon vertex extraction - Polygon trajectory generation ### 4. TextToTrajectory (Text-to-Trajectory) Converts input text into motion trajectories: - Font rendering and contour extraction - Stroke trajectory planning - 3D trajectory point generation (X, Y, Z) ### 5. LaisaiMotionController (Motion Control) Wrapper for Leadshine motion control card: - Initialization and connection closure - Single-axis and multi-axis continuous motion - Homing and movement to safe positions - Velocity and position querying ## Hardware Requirements - Leadshine motion control card (LTSMC series) - Hikvision GigE industrial camera - Support for Ethernet / RS232 communication ## Software Dependencies - Windows 7/10/11 (64-bit) - .NET Framework 4.7.2 or higher - Visual Studio 2019 or higher ## Quick Start ### 1. Configure Camera Connection Click the "Connect Camera" button on the main interface; the system will automatically enumerate and connect to the camera device. ### 2. Initialize Motion Control The motion control card is initialized automatically upon startup, connecting via Ethernet to the designated IP: `192.168.1.64` ### 3. Coordinate Calibration 1. Align the camera with the calibration reference object 2. Enter the mechanical coordinates in the "Calibration" section 3. Click the calibration button to complete two-point calibration ### 4. Motion Control - **Manual Control**: Use directional buttons to control each axis - **Automatic Operation**: Enter target coordinates and click the "Run" button - **Trajectory Motion**: Generate trajectory after image processing and perform continuous motion ## Configuration Details ### Motion Control Configuration (App.config) ```xml ``` ### Calibration Parameters (calibration.json) The system automatically saves calibration parameters, including: - ScaleX, ScaleY: Scaling factors - OffsetX, OffsetY: Offset values - FixedZ: Fixed Z-axis height ## Notes 1. Ensure the motion control card is network-connected to the PC 2. Coordinate calibration is required for first-time use 3. Confirm limit switch configurations for all axes before motion 4. In emergencies, use the emergency stop button to halt all motion ## License This project is for learning and research purposes only. All SDKs and DLLs are copyrighted by their respective manufacturers.