Detecting a Horizontal or Vertical Line Using Projection

 

Objective

Following this tutorial, you will learn how to use EasyImage to detect defects (horizontal/vertical line) in a gray-level image.

You'll need first to load a source image (step 1), set a vector (step 2), and then detect the defect (horizontal line) (step 3).

Defects can be detected using the image projection

Step 1: Load the source image

1. From the main menu, click EasyImage, then Projection.
2. Click the Open icon of the Source Image area, and load the image file EasyImage\Leather.bmp.
3. Keep the default variable name for the new image object, and click OK.

Step 2: Set the destination vector

1. Click the New icon in the Destination Vector area.
2. Select the BW32 option for the vector type, and click OK.

Step 3: Detect the defects

1. In the Image Projection dialog box, select the column button, and click Execute to perform the operation.
2. The resulting vector and the corresponding plot are displayed in the destination vector window. The graphical result also appears on the image. Each vector value is the sum of all pixels values across the corresponding horizontal row (or vertical column). By this mean, horizontal (or vertical) defects are easily detected.