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
aknecht2
Image Harvest
Commits
cd6384d1
Commit
cd6384d1
authored
Apr 21, 2016
by
aknecht2
Browse files
Fixed colorDAta function.
parent
26f80bd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
ih/imgproc.py
View file @
cd6384d1
...
...
@@ -1375,7 +1375,7 @@ class Image(object):
def
extractColorData
(
self
,
nonzero
=
True
,
returnhist
=
False
):
"""
:param nonzero: Whether or not to look at only nonzero pixels. Default true.
:param nonzero: Whether or not to look at only nonzero pixels
self
. Default true.
:type nonzero: bool
:return: Mean & median for each channel.
:rtype: list
...
...
@@ -1394,8 +1394,8 @@ class Image(object):
if
returnhist
:
return
hist
colors
=
[
[
np
.
mean
(
hist
[
0
][
np
.
nonzero
(
hist
[
0
])]
if
nonzero
else
hist
[
0
]),
np
.
median
(
hist
[
0
][
np
.
nonzero
(
hist
[
0
])]
if
nonzero
else
hist
[
0
])],
[
np
.
mean
(
hist
[
0
][
np
.
nonzero
(
hist
[
1
])]
if
nonzero
else
hist
[
1
]),
np
.
median
(
hist
[
0
][
np
.
nonzero
(
hist
[
1
])]
if
nonzero
else
hist
[
1
])],
[
np
.
mean
(
hist
[
0
][
np
.
nonzero
(
hist
[
2
])]
if
nonzero
else
hist
[
2
]),
np
.
median
(
hist
[
0
][
np
.
nonzero
(
hist
[
2
])]
if
nonzero
else
hist
[
2
])]
[
np
.
mean
(
hist
[
1
][
np
.
nonzero
(
hist
[
1
])]
if
nonzero
else
hist
[
1
]),
np
.
median
(
hist
[
1
][
np
.
nonzero
(
hist
[
1
])]
if
nonzero
else
hist
[
1
])],
[
np
.
mean
(
hist
[
2
][
np
.
nonzero
(
hist
[
2
])]
if
nonzero
else
hist
[
2
]),
np
.
median
(
hist
[
2
][
np
.
nonzero
(
hist
[
2
])]
if
nonzero
else
hist
[
2
])]
]
if
self
.
conn
:
self
.
_addColumn
(
"rmean"
)
...
...
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