diff --git a/bin/lab9_image_processing/ImageFilters.class b/bin/lab9_image_processing/ImageFilters.class index d20a9bb..b77ea0e 100644 Binary files a/bin/lab9_image_processing/ImageFilters.class and b/bin/lab9_image_processing/ImageFilters.class differ diff --git a/bin/lab9_image_processing/ImageProcessing.class b/bin/lab9_image_processing/ImageProcessing.class index 51633e8..ff37c01 100644 Binary files a/bin/lab9_image_processing/ImageProcessing.class and b/bin/lab9_image_processing/ImageProcessing.class differ diff --git a/src/lab9_image_processing/09b-ImageProcessing-FR.pdf b/src/lab9_image_processing/09b-ImageProcessing-FR.pdf new file mode 100644 index 0000000..9ecb095 Binary files /dev/null and b/src/lab9_image_processing/09b-ImageProcessing-FR.pdf differ diff --git a/src/lab9_image_processing/ImageFilters.java b/src/lab9_image_processing/ImageFilters.java index 51ea42d..84ef797 100644 --- a/src/lab9_image_processing/ImageFilters.java +++ b/src/lab9_image_processing/ImageFilters.java @@ -16,8 +16,9 @@ public class ImageFilters { /** * Write your code hereunder */ + int[][] foo = a.clone(); - return null; + return foo; } /** diff --git a/src/lab9_image_processing/ImageProcessing.java b/src/lab9_image_processing/ImageProcessing.java index 4e1a1cd..00bad1d 100644 --- a/src/lab9_image_processing/ImageProcessing.java +++ b/src/lab9_image_processing/ImageProcessing.java @@ -5,18 +5,21 @@ public class ImageProcessing { public static void main(String[] args) { - final String imageUsed = "/images/rice.jpg"; + //final String imageUsed = "/images/rice.jpg"; + final String imageUsed = "/images/imageProcessing.jpg"; + final String imageUsed2 = "/images/imageProcessing_empty.jpg"; /** * Create the windows from images */ - ImageGraphics org = new ImageGraphics(imageUsed, "Original", -450, -250); - ImageGraphics cpy = new ImageGraphics(imageUsed, "Copy", 0, -250); + ImageGraphics org = new ImageGraphics(imageUsed, "Original", -450, -200); + ImageGraphics cpy = new ImageGraphics(imageUsed2, "Copy", 0, -200); int[][] thePixels = org.getPixelsBW(); int[][] theCopy = ImageFilters.duplicate(thePixels); - // Simple copy and display + //Simple copy and display + org.setPixelsBW(thePixels); cpy.setPixelsBW(theCopy); } } diff --git a/src/lab9_image_processing/TestArray.java b/src/lab9_image_processing/TestArray.java new file mode 100644 index 0000000..f22f094 --- /dev/null +++ b/src/lab9_image_processing/TestArray.java @@ -0,0 +1,21 @@ +package lab9_image_processing; + +public class TestArray { + + public static void main(String[] args) { + double[] foo = new double[1000]; + for (int i = 0; i < foo.length; i++) { + foo[i] = i+1; + } + System.out.println(new TestArray().average(foo)); + } + + public double average(double[] tableau){ + double total = 0.0; + for (double d : tableau) { + total += d; + } + + return (total/tableau.length); + } +}