From e6c60ca8902b69364a2578490840d87173b6162b Mon Sep 17 00:00:00 2001 From: Kevin Keraudren Date: Fri, 4 Dec 2015 23:10:53 +0000 Subject: [PATCH 1/4] fixed typos in seam carving example. --- doc/examples/plot_seam_carving.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/examples/plot_seam_carving.py b/doc/examples/plot_seam_carving.py index f1dcb948..b8cce29f 100644 --- a/doc/examples/plot_seam_carving.py +++ b/doc/examples/plot_seam_carving.py @@ -46,22 +46,22 @@ plt.imshow(resized) out = transform.seam_carve(img, eimg, 'vertical', 200) plt.figure() -plt.title('Resized using Seam-Carving') +plt.title('Resized using Seam Carving') plt.imshow(out) """ .. image:: PLOT2RST.current_figure -As you can see, resizing as distorted the rocket and the objects around, -whereas seam carving has reszied by removing the empty spaces in between. +As you can see, resizing has distorted the rocket and the objects around, +whereas seam carving has resized by removing the empty spaces in between. Object Removal -------------- -Seam Carving can also be used to remove atrifacts from images. To do that, we -have to ensure that pixels to be removes get less importance. In the following +Seam carving can also be used to remove artifacts from images. To do that, we +have to ensure that pixels to be removed get less importance. In the following code I approximately mark the rocket with a mask, and then decrease the -importance of those pixels +importance of those pixels. """ From a0c5270e943ac2c2ace48ebb28210d80751b02d3 Mon Sep 17 00:00:00 2001 From: Kevin Keraudren Date: Fri, 4 Dec 2015 23:54:52 +0000 Subject: [PATCH 2/4] text improvement in seam carving example. --- doc/examples/plot_seam_carving.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/plot_seam_carving.py b/doc/examples/plot_seam_carving.py index b8cce29f..499d1181 100644 --- a/doc/examples/plot_seam_carving.py +++ b/doc/examples/plot_seam_carving.py @@ -52,8 +52,8 @@ plt.imshow(out) """ .. image:: PLOT2RST.current_figure -As you can see, resizing has distorted the rocket and the objects around, -whereas seam carving has resized by removing the empty spaces in between. +Resizing distorts the rocket and surrounding objects, whereas seam carving +removes empty spaces and preserves object proportions. Object Removal -------------- From bed6f6069b433a21447caa6909bfc05308b14b30 Mon Sep 17 00:00:00 2001 From: Kevin Keraudren Date: Sat, 5 Dec 2015 00:05:18 +0000 Subject: [PATCH 3/4] small text improvement in seam carving example --- doc/examples/plot_seam_carving.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/examples/plot_seam_carving.py b/doc/examples/plot_seam_carving.py index 499d1181..20beb9d0 100644 --- a/doc/examples/plot_seam_carving.py +++ b/doc/examples/plot_seam_carving.py @@ -58,9 +58,9 @@ removes empty spaces and preserves object proportions. Object Removal -------------- -Seam carving can also be used to remove artifacts from images. To do that, we -have to ensure that pixels to be removed get less importance. In the following -code I approximately mark the rocket with a mask, and then decrease the +Seam carving can also be used to remove artifacts from images. +This requires to downweigh the pixels to be removed. In the following +code, the rocket is thus approximately masked to decrease the importance of those pixels. """ From 817b090c7c22d2fbd773aac53cf6c8dbb46f14e3 Mon Sep 17 00:00:00 2001 From: Kevin Keraudren Date: Sat, 5 Dec 2015 14:23:23 +0000 Subject: [PATCH 4/4] text improvement in seam carving example, added some newlines between plt.imshow() and """PLOT2RST""" --- doc/examples/plot_seam_carving.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/examples/plot_seam_carving.py b/doc/examples/plot_seam_carving.py index 20beb9d0..129b0da0 100644 --- a/doc/examples/plot_seam_carving.py +++ b/doc/examples/plot_seam_carving.py @@ -39,7 +39,6 @@ plt.figure() plt.title('Resized Image') plt.imshow(resized) - """ .. image:: PLOT2RST.current_figure """ @@ -59,9 +58,9 @@ Object Removal -------------- Seam carving can also be used to remove artifacts from images. -This requires to downweigh the pixels to be removed. In the following -code, the rocket is thus approximately masked to decrease the -importance of those pixels. +This requires weighting the artifact with low values. Recall lower weights are +preferentially removed in seam carving. The following code masks the rocket's +region with low weights, indicating it should be removed. """ @@ -78,6 +77,7 @@ plt.figure() plt.title('Object Marked') plt.imshow(masked_img) + """ .. image:: PLOT2RST.current_figure """ @@ -90,6 +90,7 @@ out = transform.seam_carve(img, eimg, 'vertical', 90) resized = transform.resize(img, out.shape) plt.imshow(out) plt.show() + """ .. image:: PLOT2RST.current_figure """