diff options
Diffstat (limited to 'Algorithms/Part-II')
-rw-r--r-- | Algorithms/Part-II/2-SeamCarving/Makefile | 2 | ||||
-rw-r--r-- | Algorithms/Part-II/2-SeamCarving/ResizeDemo.java | 6 | ||||
-rw-r--r-- | Algorithms/Part-II/2-SeamCarving/ok.png | bin | 0 -> 301380 bytes |
3 files changed, 5 insertions, 3 deletions
diff --git a/Algorithms/Part-II/2-SeamCarving/Makefile b/Algorithms/Part-II/2-SeamCarving/Makefile index 335e05e..75cedde 100644 --- a/Algorithms/Part-II/2-SeamCarving/Makefile +++ b/Algorithms/Part-II/2-SeamCarving/Makefile @@ -32,7 +32,7 @@ check: $(BIN) $(CLASSES) check.sh ./check.sh HJoceanTransposed test: $(BIN) $(CLASSES) - java $(CLASSPATH) ResizeDemo ./data/HJocean.png 200 100 + java $(CLASSPATH) ResizeDemo ./data/HJocean.png 200 100 && cmp -b ok.png out.png && echo "OK" zip: $(BIN) $(ALGS4)/bin/findbugs $(BIN).class diff --git a/Algorithms/Part-II/2-SeamCarving/ResizeDemo.java b/Algorithms/Part-II/2-SeamCarving/ResizeDemo.java index 1b9f01d..d78eb44 100644 --- a/Algorithms/Part-II/2-SeamCarving/ResizeDemo.java +++ b/Algorithms/Part-II/2-SeamCarving/ResizeDemo.java @@ -40,14 +40,16 @@ public class ResizeDemo { int[] verticalSeam = sc.findVerticalSeam(); sc.removeVerticalSeam(verticalSeam); } + Picture outputImg = sc.picture(); System.out.printf("new image size is %d columns by %d rows\n", sc.width(), sc.height()); System.out.println("Resizing time: " + sw.elapsedTime() + " seconds."); - inputImg.show(); - outputImg.show(); + // inputImg.show(); + // outputImg.show(); + outputImg.save("out.png"); } } diff --git a/Algorithms/Part-II/2-SeamCarving/ok.png b/Algorithms/Part-II/2-SeamCarving/ok.png Binary files differnew file mode 100644 index 0000000..0e8b890 --- /dev/null +++ b/Algorithms/Part-II/2-SeamCarving/ok.png |