Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.18 KB

edgeDetectionUsingDilation.md

File metadata and controls

45 lines (28 loc) · 1.18 KB

Edge Detection - using Dilation

Introduction

We're going to detect edges of an image, using combination of Dilation & Subtraction.

  • First grayscale image
  • Now dilate gray scaled image
  • Then subtract gray scaled image from dilated one
  • We've edge highlighted image

Note :: Assumes foreground objects are in White i.e. rgb(255, 255, 255), which is to be edge detected, because we're using Dilation as our base op !!!

Usage

  • Make sure you've downloaded in.itzmeanjan.filterit.jar & set it as your Java project dependency.

  • Now add following code into a Java source file.

import in.itzmeanjan.filterit.ImportExportImage;
import in.itzmeanjan.filterit.edgedetection.EdgeDetectionUsingDilation;


public class Main{

        public static void main(String [] args){
                System.out.println(
                    ImportExportImage.exportImage(
                        new EdgeDetectionUsingDilation().detect("shoe.jpg"), "edgeDetectionUsingDilation.jpg"));
        }

}
  • Compile & run code

Result

Source Edge Highlighted
dream edgeDetectionUsingDilation

Thanking you :)