added histograms to fancy imshow and colormixer.

Unfortunately im suffering from circular references when the window is
initializing. It doesnt crash, but it throws a few exceptions...
A refactor is in order.
This commit is contained in:
sccolbert
2009-11-06 02:24:03 +01:00
parent 93fb7de121
commit efbaa849dd
3 changed files with 247 additions and 3 deletions
+20 -1
View File
@@ -339,4 +339,23 @@ class ColorMixer(object):
'''
R, G, B = _colormixer.py_hsv_2_rgb(H, S, V)
return (R, G, B)
return (R, G, B)
def histograms(self, nbins):
'''Calculate the channel histograms of the current image.
Parameters
----------
nbins : int
The number of bins.
Returns
-------
out : (rcounts, gcounts, bcounts, vcounts)
The binned histograms of the RGB channels and grayscale intensity.
This is a NAIVE histogram routine, meant primarily for fast display.
'''
return _colormixer.histograms(self.img, nbins)