Automated Engineering Drawing Comparison Using Python and Computer Vision

Introduction

Comparing engineering drawing revisions is a common task in many design and manufacturing teams. When a drawing changes, engineers need to carefully review the new revision and understand what exactly was modified compared to the previous version.

This process is usually done manually by placing two drawings side-by-side and visually scanning them. For simple drawings this is manageable, but for large drawings containing multiple views, notes, and annotations, it becomes time-consuming and sometimes difficult to track all changes accurately.

In this tutorial I share an experiment that attempts to automate part of this process using Python, computer vision, and OCR techniques. The goal is not to replace engineering judgment but to assist engineers by highlighting potential changes between two drawing revisions.

Problem Statement

When a drawing revision is released, engineers typically need to verify:

Which views have changed

Whether new labels or annotations were added

If notes were modified

Whether any visual elements were added or removed

Manually comparing drawings can take time and there is always a risk of missing a small change.

This experiment explores how computer vision techniques can help identify differences automatically and provide a structured summary of potential changes.

Overview of the Workflow

The system follows a multi-step workflow to compare two drawing revisions.

The main stages include:

Drawing alignment

Pixel difference detection

Region of Interest (ROI) comparison

OCR extraction from notes

Token comparison

Evaluation of detection results

Each stage focuses on identifying different types of changes in the drawing.

  1. Step 1: Drawing Alignment

    Before performing any comparison, the old and new drawings must be aligned.

    Even a small shift between the images can create false differences during pixel comparison. Alignment ensures that both drawings overlap correctly so that only actual changes are detected.

    After alignment, the two drawings are ready for visual analysis.

  2. Step 2: Pixel Difference Detection

    The next step is to compute pixel differences between the aligned drawings.

    This process highlights regions where the images differ. These areas may correspond to:


    • Added drawing elements
    • Removed labels or annotations
    • Modified geometry
    • Updated text or notes

    The output is essentially a visual map of where differences occur between the two drawings.

  3. Step 3: Region of Interest (ROI) Comparison

    Engineering drawings contain several logical sections such as views, notes, and title blocks.

    Instead of analyzing the entire drawing as a single image, the system defines Regions of Interest (ROI) for specific drawing areas.

    Example ROI regions include:


    • Section view
    • Front view
    • Side view
    • Notes block
    • Title block

    Each region is analyzed separately to provide a more structured comparison.

  4. Step 4: OCR Extraction from Notes

    Many important changes occur in drawing notes.

    To analyze textual differences, Optical Character Recognition (OCR) is used to extract text from selected drawing regions.

    The extracted text is then normalized and compared between the old and new drawings.

    This allows the system to detect when:


    • New notes are added
    • Existing notes are removed
    • Text content is modified


  5. Step 5: Engineering Token Comparison

    After text extraction, the system compares tokens such as:


    • labels
    • section identifiers
    • annotation symbols

    Token comparison helps identify textual changes that may not be obvious through visual comparison alone.

  6. Step 6: Evaluating Detection Performance

    To understand how well the system detects changes, several evaluation metrics were used.


    Precision

    Percentage of detected changes that are correct.


    Recall

    Percentage of actual changes that were successfully detected.


    Accuracy

    Overall performance of the detection system.

    Evaluation also included:



    • confusion matrix analysis
    • ROI classification accuracy
    • token detection performance

    These metrics help evaluate whether the system can reliably detect drawing changes while minimizing false detections.

    Benefits of Automated Drawing Comparison

    Automating parts of the drawing comparison process can help engineering teams in several ways:



    • Faster revision review
    • Easier identification of modified regions
    • Reduced manual scanning effort
    • Better support for quality control processes

    Even partial automation can help engineers focus on meaningful design changes rather than manually searching through large drawings.

    Current Limitations

    This experiment is still an early exploration and has several limitations.

    Some challenges include:



    • OCR accuracy depends on drawing quality
    • complex engineering symbols require specialized detection methods
    • geometric changes may require more advanced analysis
    • drawing layouts vary across organizations

    Despite these limitations, the experiment shows that computer vision techniques can assist drawing comparison workflows.

    Future Improvements

    Several improvements could make the system more powerful:



    • automatic detection of dimensions and tolerances
    • recognition of engineering symbols such as weld or GD&T symbols
    • dynamic ROI detection rather than predefined templates
    • improved OCR models for technical drawings
    • integration with CAD or PDM systems

    These enhancements could make automated drawing comparison more useful in real engineering environments.

    Project Repository

    The implementation used in this experiment is available on GitHub.

    The repository includes:



    • Python implementation of the drawing comparison workflow
    • exported HTML notebook version of the experiment
    • project documentation

    GitHub repository:

    https://github.com/ramugopal92/engineering-drawing-change-detection

    Author

    Ramu Gopal

    Mechanical Engineer | CAD Automation Developer

    Founder – The Tech Thinker

    Follow for more SolidWorks automation tutorials

Comments

Please do not open any links and do not make calls (including WhatsApp) to any numbers from messages sent by accounts such as Grabcad Verification, etc. - these are phishing ones. Please do not make any payments. Our security team is currently working on a solution.