Skip to content

Commit

Permalink
sdfasdfasd
Browse files Browse the repository at this point in the history
  • Loading branch information
NSLog0 committed Mar 11, 2013
1 parent 6fa2dda commit 4d83405
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 40 deletions.
Binary file modified build/classes/image2d/EdgeDetector.class
Binary file not shown.
Binary file modified build/classes/image2d/EdgeOperator.class
Binary file not shown.
Binary file modified build/classes/image2d/Image2D.class
Binary file not shown.
17 changes: 14 additions & 3 deletions nbproject/build-impl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ is divided into following sections:
</and>
</condition>
</target>
<target name="-init-test-properties">
<property name="test.binaryincludes" value="&lt;nothing&gt;"/>
<property name="test.binarytestincludes" value=""/>
<property name="test.binaryexcludes" value=""/>
</target>
<target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
Expand All @@ -393,7 +398,7 @@ is divided into following sections:
</sequential>
</macrodef>
</target>
<target if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
<target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
Expand All @@ -407,6 +412,9 @@ is divided into following sections:
<fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
<filename name="@{testincludes}"/>
</fileset>
<fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
<filename name="${test.binarytestincludes}"/>
</fileset>
</batchtest>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
Expand Down Expand Up @@ -534,7 +542,7 @@ is divided into following sections:
</sequential>
</macrodef>
</target>
<target if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
<target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
<macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
Expand All @@ -548,6 +556,9 @@ is divided into following sections:
<fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
<filename name="@{testincludes}"/>
</fileset>
<fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
<filename name="${test.binarytestincludes}"/>
</fileset>
</batchtest>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
Expand Down Expand Up @@ -920,7 +931,7 @@ is divided into following sections:
<target if="has.persistence.xml" name="-copy-persistence-xml">
<mkdir dir="${build.classes.dir}/META-INF"/>
<copy todir="${build.classes.dir}/META-INF">
<fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
<fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
</copy>
</target>
<target name="-post-compile">
Expand Down
4 changes: 2 additions & 2 deletions nbproject/genfiles.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ [email protected]
# 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
2 changes: 1 addition & 1 deletion nbproject/private/private.properties
Original file line number Diff line number Diff line change
@@ -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
50 changes: 25 additions & 25 deletions src/image2d/EdgeDetector.java
Original file line number Diff line number Diff line change
@@ -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);

}
}
2 changes: 1 addition & 1 deletion src/image2d/EdgeOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions src/image2d/Image2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 4d83405

Please sign in to comment.