Desktop ApplicationCompleted

StitchAI — Industrial Vision and CNC Automation System

A fully integrated AI-powered vision and CNC automation system for manufacturing

Developer: Mustafa Kürşad Başer
Started: January 2025
Completed: June 2025
StitchAI — Industrial Vision and CNC Automation System

StitchAI is a comprehensive automation platform designed to transform manufacturing workflows by integrating real-time computer vision, segmentation, motion planning, and CNC machine control.

Rather than relying on pre-designed DXF files, StitchAI captures raw visual data directly from industrial cameras, processes it through advanced algorithms, and automates production via G-code generation and CNC communication.

Key Modules:

  • Vision Processing: Real-time capture, correction, and enhancement of raw images via Basler cameras.
  • Perspective Calibration: Accurate 4-point matrix calibration for real-world coordinate mapping.
  • AI-Powered Segmentation: Integrated Segment Anything Model (SAM) with support for manual refinement and morphological operations.
  • Path Planning: Geometrically optimized route generation with offset calculations and intelligent processing order.
  • G-code Generation: High-fidelity G-code output with simulation and visual verification.
  • Machine Communication: Full Modbus (RTU/TCP) support, serial/Ethernet I/O, and real-time monitoring of CNC and PLC systems.
  • Workflow Automation: Batch processing, job parameter management, and recipe-driven execution.

Industrial Applications:

  • Textile and Leather Processing: Automated stitching and cutting guided by computer vision.

Technology Stack:

  • Frontend/UI: PyQt6 for a high-performance desktop interface
  • Computer Vision: OpenCV, NumPy, pypylon
  • AI & Segmentation: PyTorch, Segment Anything Model (Meta AI)
  • Geometric Computation: Shapely, ezdxf
  • CNC & Communication: pymodbus, pyserial

Core Features:

  • Perspective & affine coordinate transformation
  • SAM-based AI segmentation and manual overrides
  • Edge detection and contour tracing
  • Geometry-based G-code generation with toolpath compensation
  • Real-time machine state monitoring and manual override support

Example Use Cases:

  • Full automatic processing: From image capture to CNC execution with a single click
  • Manual segmentation and route adjustment workflows
  • DXF import and G-code generation from predefined vectors

Workflow Overview:

  1. Calibrate camera perspective and align coordinates
  2. Capture real-time material imagery
  3. Segment regions of interest (automatically or manually)
  4. Optimize toolpaths and configure process parameters
  5. Generate and simulate G-code
  6. Execute via Modbus-connected CNC machine

Troubleshooting & Diagnostics:

  • Visual aids for camera alignment and lighting conditions
  • SAM model error handling and contrast optimization
  • Communication diagnostics for PLC and CNC integration

This solution is designed for manufacturers seeking precision, flexibility, and full-stack automation from image to execution.

Tech Stack

PythonPyQt6OpenCVPyTorchModbusSegment Anything ModelShapely

Mustafa Kürşad BAŞER

Software Engineer

A software engineer who brings complex problems together with elegant solutions and loves to add value by sharing what he learns.

Software Development
Neuroscience
History & Philosophy

© 2025 Mustafa Kürşad BAŞER. All rights reserved.

Çerez Tercihleri

Size daha iyi bir deneyim sunabilmek için çerezleri kullanıyoruz. Analitik ve reklam amaçlı çerezler hakkında detaylı bilgi için ayarları özelleştirebilirsiniz.