Commit cd6384d1 authored by aknecht2's avatar aknecht2
Browse files

Fixed colorDAta function.

parent 26f80bd4
...@@ -1375,7 +1375,7 @@ class Image(object): ...@@ -1375,7 +1375,7 @@ class Image(object):
def extractColorData(self, nonzero = True, returnhist = False): 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 :type nonzero: bool
:return: Mean & median for each channel. :return: Mean & median for each channel.
:rtype: list :rtype: list
...@@ -1394,8 +1394,8 @@ class Image(object): ...@@ -1394,8 +1394,8 @@ class Image(object):
if returnhist: if returnhist:
return hist 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])], 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[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[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[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: if self.conn:
self._addColumn("rmean") self._addColumn("rmean")
......
Supports Markdown
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