Skip to content

ENH: implement mean and triangle thresholding - #2126

Merged
soupault merged 1 commit into
scikit-image:masterfrom
sciunto:mean_triangle_threshold
Jun 10, 2016
Merged

soupault merged 1 commit into
scikit-image:masterfrom
sciunto:mean_triangle_threshold

Conversation

@sciunto

@sciunto sciunto commented Jun 2, 2016

Copy link
Copy Markdown
Member

Description

Replaces #2124 (was too difficult to rebase)

return bin_centers[(threshold + upper_bound) // 2]


def threshold_mean(image):

@ahojnnes ahojnnes Jun 3, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example in the gallery?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahojnnes As said in the main discussion, I'll refactor the examples later.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started to do the job in #2110

@ahojnnes

ahojnnes commented Jun 9, 2016

Copy link
Copy Markdown
Member

LGTM.

# Check that most of the pixels are identical
# See numpy #7685 for a future np.testing API
unequal_pos = np.where(t_img.ravel() != t_inv_inv_img.ravel())
assert(len(unequal_pos[0]) / len(t_img.ravel()) < 1e-2)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning behind this value?
Also, len(t_img.ravel()) == t_img.size.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value just sounds reasonable...

@codecov-io

codecov-io commented Jun 9, 2016 •

Copy link
Copy Markdown

Current coverage is 90.52%

Merging #2126 into master will increase coverage by 0.02%

@@             master      #2126   diff @@
==========================================
  Files           297        297          
  Lines         21230      21277    +47   
  Methods           0          0          
  Messages          0          0          
  Branches       1949       1951     +2   
==========================================
+ Hits          19215      19262    +47   
  Misses         1665       1665          
  Partials        350        350          

Powered by Codecov. Last updated by 40c7d7f...fc1192a

Parameters
----------
image : (N, M) ndarray
Grayscale input image.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change the signature -> (N, M[, ..., P]) and description.

@sciunto

sciunto commented Jun 9, 2016

Copy link
Copy Markdown
Member Author

@soupault Fixed ;)

@soupault

soupault commented Jun 9, 2016 •

Copy link
Copy Markdown
Member

@sciunto please, squash the commits, and we're done.

@sciunto

sciunto commented Jun 9, 2016

Copy link
Copy Markdown
Member Author

squashed :)

@soupault

Copy link
Copy Markdown
Member

@sciunto Thanks! I've added a requirement to the checklist in #2110 .

@soupault
soupault merged commit 2616f94 into scikit-image:master Jun 10, 2016
@sciunto
sciunto deleted the mean_triangle_threshold branch June 10, 2016 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants