From 4d83405a898048b92697165f2bce7fc26f96df32 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 11 Mar 2013 13:29:58 +0700 Subject: [PATCH] sdfasdfasd --- build/classes/image2d/EdgeDetector.class | Bin 713 -> 700 bytes build/classes/image2d/EdgeOperator.class | Bin 2102 -> 2093 bytes build/classes/image2d/Image2D.class | Bin 2277 -> 2192 bytes nbproject/build-impl.xml | 17 ++++++-- nbproject/genfiles.properties | 4 +- nbproject/private/private.properties | 2 +- src/image2d/EdgeDetector.java | 50 +++++++++++------------ src/image2d/EdgeOperator.java | 2 +- src/image2d/Image2D.java | 16 ++++---- 9 files changed, 51 insertions(+), 40 deletions(-) diff --git a/build/classes/image2d/EdgeDetector.class b/build/classes/image2d/EdgeDetector.class index 3925f673827501a4933f9e8bdd2e7afab1509515..54cd5d5079c18a280c77dd40065b9e583acbf977 100644 GIT binary patch delta 23 fcmX@fx`%Z_Gb8854pT-p*2IE>oXW{(822B``x*ZN0Pv&@^Z)<= diff --git a/build/classes/image2d/EdgeOperator.class b/build/classes/image2d/EdgeOperator.class index 3e9d5117b207ca39dbc3144786a93b81ae0c3757..441c94a1cb533fe1920c7768191ebd777326d4b6 100644 GIT binary patch delta 18 ZcmdlcuvTEgCpOl^f`XjN&5Vqu>;OYj1}Fdk delta 35 qcmZ20uuWjXCt<$g{G`+z|AN$_#FEVXJVpi=jme6Pa+{?Xh1mh>eG3%; diff --git a/build/classes/image2d/Image2D.class b/build/classes/image2d/Image2D.class index 5460122612107878818213db501cfcfeaf2fd96d..bd30a09c3adb9b57509aaeb7c1d8163e032751e7 100644 GIT binary patch delta 743 zcmYL{TTfF#6otQ2Xs4VUq%DXRm10pqlGgWB>1^S1*6nd^2h1u*ngQnjF*6L8s!llM^NuU5b+?C7jaaw1#fQ8Iw|d zW)Hni`gA;Na*lot=d~v2E8+qJ8bX?1)G(;HWa6V$F*N@+W%T)}R)j5v8L=28Vo=#0 z2u*}j;gM9sa5NE0hT~JQNHR1X9f>qfOpPnXEXKL4h+0fAsfg(qS0ofy^ygG2ZmX^J zbJf5Tjfcl0Eu&4HI(CN>5fS^Dwn#E#ag9_aXRBztZgGQ~29EYfVkRQhTijOMvAD}U zi?oJW<`nlW9`MlOk%q_2Sv=wCf~UZ+Ep*x67(SmovtBj~xusfg0~nJOq9pq{<53;y z99Ga%yvT}xJx58>|%G`fx#Z}V#p2%x3Tvx DY^#20 delta 855 zcmYL{TTc^F6otPjZBLm@fudALK?M;+kt*Jcq5>)^3W$n;7m6JUSXyigh_@=y?OPsY({542Xqe7sB=icVUFlDDLBe8L9>e%og7*P$8|ikDRM%= zNx>ot{GhChDO0aU?kuRj3#__(OA%mH3i0^!wEss;3l^; zob^^DVZ{u_xh=S3aF=@q_Z2+gq2Q6hW1bj1Rq%|51`|Bj-sWW4YH}C0uMbD#{gIHy z;)TrqV908)64r%8G^XM1?T-Xisx8`Mg{7vole3!lW0_+@TUjg*P(3y@DSeH^GSJ4c zBV_jLp@MaixtNjpO6k;1 znhjJ*?|Dq)V9?fm hzfL_ + + + + + @@ -393,7 +398,7 @@ is divided into following sections: - + @@ -407,6 +412,9 @@ is divided into following sections: + + + @@ -534,7 +542,7 @@ is divided into following sections: - + @@ -548,6 +556,9 @@ is divided into following sections: + + + @@ -920,7 +931,7 @@ is divided into following sections: - + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 25b228c..4828ea9 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.50.2.46 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=464b3301 -nbproject/build-impl.xml.script.CRC32=2a31616b -nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46 +nbproject/build-impl.xml.script.CRC32=662ac0ff +nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties index 445b0eb..d60f9d3 100644 --- a/nbproject/private/private.properties +++ b/nbproject/private/private.properties @@ -1,2 +1,2 @@ compile.on.save=true -user.properties.file=C:\\Documents and Settings\\pratchaya\\.netbeans\\7.1.2\\build.properties +user.properties.file=C:\\Documents and Settings\\pratchaya\\Application Data\\NetBeans\\7.3\\build.properties diff --git a/src/image2d/EdgeDetector.java b/src/image2d/EdgeDetector.java index e62c2e0..96f23df 100644 --- a/src/image2d/EdgeDetector.java +++ b/src/image2d/EdgeDetector.java @@ -1,25 +1,25 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package image2d; - -import java.awt.Color; -import java.awt.image.BufferedImage; - -/** - * - * @author pratchaya - */ -public class EdgeDetector { - - public static BufferedImage findEdgeSobel(BufferedImage _image) { - // get kernel horizontal - int horizontal[][] = EdgeOperator.edgeHorizontal(); - // get kernel vertical - int vertical[][] = EdgeOperator.edgeVertical(); - // get result - return EdgeOperator.sobelOperation(_image, horizontal, vertical); - - } -} +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package image2d; + +import java.awt.Color; +import java.awt.image.BufferedImage; + +/** + * + * @author pratchaya + */ +public class EdgeDetector { + + public static BufferedImage EdgeSobel(BufferedImage _image) { + // get kernel horizontal + int horizontal[][] = EdgeOperator.edgeHorizontal(); + // get kernel vertical + int vertical[][] = EdgeOperator.edgeVertical(); + // get result + return EdgeOperator.apply(_image, horizontal, vertical); + + } +} diff --git a/src/image2d/EdgeOperator.java b/src/image2d/EdgeOperator.java index 1769f27..51d953d 100644 --- a/src/image2d/EdgeOperator.java +++ b/src/image2d/EdgeOperator.java @@ -37,7 +37,7 @@ public static int[][] edgeVertical() { } // ----------------------------- end sobel --------------------------------- - public static BufferedImage sobelOperation(BufferedImage _image, int horizon[][], int vertical[][]) { + public static BufferedImage apply(BufferedImage _image, int horizon[][], int vertical[][]) { BufferedImage imageOutput = new BufferedImage(_image.getWidth(), _image.getHeight(), BufferedImage.TYPE_3BYTE_BGR); // Set initial BufferedImage int kernelXY = horizon.length / 2; diff --git a/src/image2d/Image2D.java b/src/image2d/Image2D.java index 8f9e698..b1526af 100644 --- a/src/image2d/Image2D.java +++ b/src/image2d/Image2D.java @@ -16,17 +16,17 @@ public class Image2D { public Image2D() { Toolkit toolkit = Toolkit.getDefaultToolkit(); Dimension dim = toolkit.getScreenSize(); - String url = "images/wl2.jpg"; // this program have 4 images : wr.png ,sh.jpg , ca.jpg , icon.jpg ,r1,r2,r3,r4.jpg + String url = "C:\\javacv-bin\\samples\\rice.jpg"; // this program have 4 images : wr.png ,sh.jpg , ca.jpg , icon.jpg ,r1,r2,r3,r4.jpg BufferedImage image = ImageReader.load_image(url); image = Gaussian.apply(image, 7, 0.84089642); //.94089642 image = Grayscale.apply(image); - //image = AutoBalance.apply(image); - image = Threshold.apply(image); - image = Opening.apply(image, 3); - image = Opening.apply(image, 3); - image = Opening.apply(image, 3); - image = Closing.apply(image, 2); - image = EdgeDetector.findEdgeSobel(image); + // image = AutoBalance.apply(image); + image = Threshold.apply(image); + image = Opening.apply(image, 3); + image = Opening.apply(image, 3); + image = Opening.apply(image, 3); + // image = Closing.apply(image, 2); + //image = EdgeDetector.EdgeSobel(image); // swing for tester { JFrame frame = new JFrame("Display Image");