Commit cd6384d1 authored by aknecht2's avatar aknecht2

Fixed colorDAta function.

parent 26f80bd4
......@@ -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 pixelsself. 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")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment