Object Measurement & DXF Export from Images (AI-Powered)
Автор: Coder Aqib
Загружено: 21 апр. 2025 г.
Просмотров: 25 просмотров
✅ Project Overview
This project is an end-to-end computer vision solution that automatically detects physical objects in an image, accurately measures them in real-world units (millimeters), and exports the result as a scalable DXF (AutoCAD-compatible) file. The core challenge was to create a robust, automated pipeline that performs with minimal user input while ensuring high measurement accuracy — ideal for clients working in manufacturing, product design, CNC machining, or quality inspection.
🔍 Key Features
1. Automatic Object Detection
Uses background subtraction and morphological operations to extract all objects from an image, even in cluttered or noisy backgrounds.
2. Reference Object Calibration
Detects a known reference object (a coin) in the image and computes a precise scaling factor (mm/px) using OpenCV contours and geometric heuristics.
3. Edge Detection & Contour Tracing
Clean object edges are extracted and converted into vector contours with pixel-level precision.
4. DXF Generation
The object outlines are transformed into vector splines and exported as .dxf files, which are fully compatible with CAD tools like AutoCAD, LibreCAD, SolidWorks, and Fusion360.
5. GUI Integration with Gradio
Built a user-friendly frontend using Gradio for non-technical users to upload images and receive DXF files instantly.
🧠 Tech Stack
Python – Core logic and image processing
OpenCV – Contour detection, shape analysis, and measurement scaling
NumPy & PIL – Image manipulation and pre-processing
Gradio – Lightweight web UI for file upload and preview
DXF Libraries – For spline-based vector export
🧪 Challenges Solved
1. 🔄Pixel-to-mm Conversion:
Achieved reliable mm-per-pixel conversion using real-world object calibration, ensuring all dimensions in the final DXF are true to scale.
2. 📐 Precision Vectorization:
Converted noisy raster outlines into smooth, scalable vector paths suitable for downstream CAD/CAM workflows.
🎯 Use Cases
Product prototyping & reverse engineering
CNC-ready shape extraction from sketches
Quality control via image-based object measurement
Educational tools for geometric analysis
🧩 What I Contributed
Designed and developed the full pipeline from image input to DXF export
Built a calibration mechanism using reference object detection
Implemented a clean and interactive GUI
Debugged and improved measurement precision by over 95% accuracy
Modularized code for future extension (e.g., auto-classification or multi-object tagging)

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: