LAB: Grayscale Image Segmentation -Gear

LAB: Grayscale Image Segmentation

I. Introduction

Goal: Defective Gear Inspection System

Plastic gears are widely used in many applications, including toys, RC cars, and plastic-based hardware. Since they are made of plastic, it is fragile and can have broken gear teeth. You are asked to develop a machine vision system that can inspect defective plastic gears.

Download the test imagearrow-up-right

After analyzing histogram, applying thresholding and morphology, we can identify and extract the target objects from the background by finding the contours around the connected pixels.

II. Procedure

  • Design algorithms to detect defective gear for given images.

    • Include a flowchart to explain the algorithm flow.

  • You should apply image processing algorithms, which you have learnt in class, as much as possible.

  • If you want to use other algorithms that were not covered in class, then you should briefly explain how that algorithm works.

  • For the output, you should calculate the following

    • Number of defective teeth

    • Diameter of the gear

    • Quality Inspection (Pass or Fail)

  • You must explain each process with appropriate results

  • You MUST include all the following in the report.

    • A simple flowchart to explain your algorithm

    • Apply appropriate filters to enhance image

    • Explain how the appropriate threshold value was chosen (if used)

    • Apply the appropriate morphology method to segment parts (if necessary)

      • Find the contour and draw the segmented objects. See Appendix

    • Explain how to determine the defective teeth

Output Examples

Examples: Output images of each process

III. Report

You are required to write a concise lab report and submit the program files.

First, read LAB Report Instruction

Lab Report:

  • Use the given Lab Report Template

  • Show what you have done with concise explanations and example results of each necessary process

  • In the appendix, show your source code.

  • You must write the report in markdown file (*.md),

    • Recommend (Typora 0.x < 1.x) or Notion

    • When embedding images

      Option 1) If you are using local path images: You must include local image folder with the report in zip file

      Option 2) Use online link for images.

  • Submit in both PDF and original documentation file/images

Source Code:

  • Zip all the necessary source files.

  • Only the source code files. Do not submit visual studio project files etc.

Appendix

Tip: (contour_demo.cpp)

Last updated

Was this helpful?