GithubHelp home page GithubHelp logo

adityaintwala / image2cad Goto Github PK

View Code? Open in Web Editor NEW
87.0 3.0 23.0 13.46 MB

An application to translate raster image of CAD drawing sheet to a user editable DXF format.

License: Apache License 2.0

Python 100.00%
feature-extraction feature-detection line-detection circle-detection arrow-detection text-detection ocr-recognition cad cam image-processing

image2cad's Introduction

Image2CAD

Copyright (C) 2016, Aditya Intwala.

A prototype application to translate a raster image of CAD drawing to user editable DXF CAD format, using concepts of Image Processing and Machine Learning. This is based on the paper Image to CAD: Feature Extraction and Translation of Raster Image of CAD Drawing to DXF CAD Format by Aditya Intwala.

The idea is to make the open-sourced version more robust and accurate with integrating the Machine Learning models for the individual stages of current pipeline similar to original version but more accurate and robust with the help of collaboration.

The opensourced version is slightly different than what is presented in the paper. The OCR in original version was hand tailored for Mechanical drawings fonts and GD&T symbols which was more accurate than present Tessaract OCR. This version is based on OpenCV 3.0 while original was based on OpenCV 2.0.

Demo Video

Image 2 CAD Demo

Cite

Please cite the below research if using as is or with any modification in your research.

@inproceedings{intwala2019image,
  title={Image to CAD: Feature Extraction and Translation of Raster Image of CAD Drawing to DXF CAD Format},
  author={Intwala, Aditya},
  booktitle={International Conference on Computer Vision and Image Processing},
  pages={205--215},
  year={2019},
  organization={Springer}
}

Contribution Guidelines

Please get in touch with the author for contribution related queries.

Introduction

A CAD drawing has various drawing features like entity lines, dimensional lines, dimensional arrows, dimensional text, support lines, reference lines, Circles, GD&T symbols and drawing information metadata. The problem of automated or semi-automated recognition of feature entities from 2D CAD drawings in the form of raster images has multiple usages in various scenarios. The present research work explores the ways to extract this information about the entities from 2D CAD drawings raster images and to set up a workflow to do it in automated or semi-automated way. The algorithms and workflow have been tested and refined using a set of test CAD images which are fairly representative of the CAD drawings encountered in practice. The overall success rate of the proposed process is 90% in fully automated mode for the given sample of the test images. The prototype is used to generate user editable DXF CAD file from raster images of CAD drawings which could be then used to update/edit the CAD model when required using CAD packages. The current work is a stripped-down version of original work presented in paper; this might not reproduce same results as the paper but the workflow is highly relatable to the original pipeline. The stripped-down version has not got the generalization, robustness or the stability of the original version.

Usage

''' python Image2CAD.py ..//TestData//1.png '''

Input

The script requires one positional argument and few optional parameters:

  • image_path - Complete path to the image file of CAD drawing.

Output

The output of the script would be multiple files:

  • *.I2C - A custom Image2CAD file conatining extracted and corelated feature information which than can be processed to DXF file.
  • *.png - Multiple output images of various individual feature detected.

Arrowhead Feature Detection

Input Image Detected Arrowheads Output Image
Input Image Detected Arrowheads Output Image
Input Image Detected Arrowheads Output Image
Input Image Detected Arrowheads Output Image
Input Image Detected Arrowheads Output Image

Dimensional Line Feature Detection

Input Image Detected Dimensional Lines Output Image
Input Image Detected Dimensional Lines Output Image
Input Image Detected Dimensional Lines Output Image
Input Image Detected Dimensional Lines Output Image
Input Image Detected Dimensional Lines Output Image

Dimensional Text Feature Detection

Input Image Detected Dimensional Text Output Image
Input Image Detected Dimensional Text Output Image
Input Image Detected Dimensional Text Output Image
Input Image Detected Dimensional Text Output Image
Input Image Detected Dimensional Text Output Image

Line Feature Detection

Input Image Detected Lines Output Image
Input Image Detected Lines Output Image
Input Image Detected Lines Output Image
Input Image Detected Lines Output Image
Input Image Detected Lines Output Image

Circle Feature Detection

Input Image Detected Circles Output Image
Input Image Detected Circles Output Image

Major Dependencies

  • OpenCV 3.4.2
  • TessaractOCR
  • ezdxf
  • numpy
  • scipy

image2cad's People

Contributors

adityaintwala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

image2cad's Issues

request requirements.txt

Hi. this code is cool and what I need.
But I've encountered error for run image2CAD.py
I think it's because version of libraries doesn't match between python, opencv, tesseract
So I request requirements.txt please
I'll wait for your answer. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.