Skip to content

httpsoa/Weld-Continuity-Check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Weld Continuity Check

An automated computer vision script to detect imperfections in T-fillet welds. This project uses image processing techniques to distinguish between continuous weld beads and discontinuous defects like porosity or cracks.

πŸ› οΈ Tech Stack

  • Language: Python 3
  • Library: OpenCV (cv2), NumPy
  • Technique: Canny Edge Detection, Morphological Filtering

✨ Features

  • Region of Interest (ROI): Automatically masks the top and bottom of the image to focus strictly on the welding zone.
  • Noise Reduction: Uses Gaussian Blur to filter out micro-spatter and surface texture.
  • Smart Filtering: Distinguishes defects based on contour length:
    • Ignored: Small noise (< 10px) and continuous weld lines (> 100px).
    • Detected: Medium-sized broken segments (10px - 100px) representing defects.
  • Coordinate Logging: Outputs exact (x, y) coordinates of every detected imperfection.

πŸš€ How It Works

  1. Preprocessing: The image is converted to grayscale and smoothed with a 5x5 Gaussian Blur.
  2. Masking: A rectangular mask creates a "tunnel vision" effect, isolating the center weld.
  3. Edge Detection: cv2.Canny (Thresholds 50, 150) identifies high-contrast edges.
  4. Analysis: The script calculates the arcLength of every contour. Continuous lines are marked green (safe), while broken lines are marked red (defects).

πŸ’» How to Run

  1. Clone the repository.
  2. Ensure you have the required libraries:
    pip install opencv-python numpy
  3. Place your weld image (e.g., badweld2.jpg) in the project folder.
  4. Run the script:
    python weld_check.py

🧠 What I Learned

  • How to use Canny Edge Detection to extract structural features from metal surfaces.
  • Using Bitwise Operations (Masking) to focus algorithms on specific image regions.
  • Calculating Moments to find the centroid coordinates of irregular shapes.
weldcheckvideo.mp4

About

A small python project to see the imperfectations on welds.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages