Gallery: Use Horse to illustrate Convex Hull #2431

merged 2 commits into from Jan 15, 2017


None yet

5 participants

sciunto commented Jan 5, 2017 edited


These modifications are on my disk for a while. I had to push the invert() function and a fix on the horse picture and I forgot in the mean time this patch.

Here, I propose to use the horse to illustrate the convex hull transformation. To me, this illustration is much more straightforward than the previous one. In the original version, getting a int picture with additional gray pixels from a binary image as an input is visually puzzling to me.
This new version also has the advantage to show the use of invert().

The idea is to improve again our examples for the next release.


@sciunto sciunto Use Horse to illustrate Convex Hull
@sciunto sciunto added this to the 0.13 milestone Jan 5, 2017
codecov-io commented Jan 5, 2017 edited

Current coverage is 90.68% (diff: 100%)

Merging #2431 into master will not change coverage

@@             master      #2431   diff @@
  Files           304        304          
  Lines         21417      21417          
  Methods           0          0          
  Messages          0          0          
  Branches       1838       1838          
  Hits          19421      19421          
  Misses         1655       1655          
  Partials        341        341          

Powered by Codecov. Last update 42f2e7d...d868ea2


In general, I approve this, but would like to discuss the change a bit.

- [0, 0, 0, 0, 0, 0, 0, 0, 0]], dtype=float)
-original_image = np.copy(image)
+# The original image is inverted as the object must be white.
soupault Jan 6, 2017 Member

-> "Invert the image so to make horse silhouette have higher intensity values"?

sciunto Jan 7, 2017 Member

But Convex-hull works only on binary images. Do you think that "higher" is appropriated?

soupault Jan 7, 2017 Member

I just think that it is worthwhile to mention the correspondence between intensities and colors here.
From the first read this sentence was very unclear to me: object be white -> it was black? -> what does it mean to be white? -> what does invert actually do?. I think if you could clarify this a bit, it wil be perfect!

chull = convex_hull_image(image)
-image[chull] += 1
soupault Jan 6, 2017 Member

I really like the way the current example looks.
@sciunto Have you tried to add an 1-pixel contour of the horse to the second plot? For the horse image I think it should be less 'puzzling'. 🤔

sciunto Jan 7, 2017 Member

OK. I think I'll try to make a second plot to better explain that gray = added pixels.

@soupault soupault self-assigned this Jan 6, 2017
@sciunto sciunto Add a plot to show the difference
@sciunto sciunto requested a review from emmanuelle Jan 10, 2017
sciunto commented Jan 10, 2017

@emmanuelle Do you have time to make the second review?

@soupault soupault requested a review from alexandrejaguar Jan 14, 2017

Nice example! Thanks @sciunto!

@jni jni merged commit 0cd5528 into scikit-image:master Jan 15, 2017

4 checks passed

codecov/patch Coverage not affected when comparing 42f2e7d...d868ea2
codecov/project 90.68% (+0.00%) compared to 42f2e7d
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
jni commented Jan 15, 2017

Thanks @sciunto and thanks @soupault and @alexandrejaguar for the reviews!

@sciunto sciunto deleted the sciunto:convex_hull_ex branch Jan 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment