Finds the edges in a given image using the Sobel operator.
-
Download the SobelEdgeDetection.java file.
-
Put the java file and an input image of your choice together in a folder.
-
Navigate to the folder.
-
Run
javac *.java
to compile the code. -
Run
java SobelEdgeDetection filename
where filename is the name of your input file.For example:
java SobelEdgeDetection flower.png
. -
Note that if no filename is given as an argument, it will use "flower.png" as a default.
-
Open the folder to find the output image called "sobel.png".