Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ttk
spam
Commits
46cb9cbb
Commit
46cb9cbb
authored
Aug 10, 2020
by
Edward Andò
Browse files
histogram tools import for testing
parent
46469e88
Pipeline
#47834
failed with stages
in 11 minutes and 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tools/helpers/histogramTools.py
View file @
46cb9cbb
from
__future__
import
print_function
import
matplotlib.pyplot
as
plt
import
numpy
import
spam.plotting.greyLevelHistogram
import
numpy
def
findHistogramPeaks
(
image
,
valley1
=
20000
,
valley2
=
[],
phases
=
2
,
gaussianFit
=
False
,
returnSigma
=
False
,
mask
=
True
,
showGraph
=
False
,
greyRange
=
[
0
,
65535
],
bins
=
256
):
...
...
@@ -54,7 +53,8 @@ def findHistogramPeaks(image, valley1=20000, valley2=[], phases=2, gaussianFit=F
The peaks of the phases of the image.
"""
import
scipy.optimize
import
spam.plotting.greyLevelHistogram
def
gauss
(
x
,
a
,
mu
,
sigma
,
offset
):
return
a
*
numpy
.
exp
(
-
1
*
(
x
-
mu
)
**
2
/
(
2
*
sigma
**
2
))
+
offset
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment