In [14]:
from Accord.Statistics.Visualizations import *
from Accord.Imaging.Converters import *
from Accord.Imaging import Tools
from Graphics import makePicture
In [15]:
image = makePicture("lucysmall.jpg")
image
Out[15]:
In [16]:
import System.Drawing
from System import Array
import clr
labels = ["blue", "green", "red"]
for i in range(3):
    conv = ImageToArray(0, 255, i)
    # there has to be a better way!
    c = conv.Convert.Overloads[System.Drawing.Bitmap, clr.GetClrType(Array[float]).MakeByRefType()]
    array = c(image.toBitmap())
    ih = Histogram()
    ih.Compute(array, 255)
    d = [(bin.Range.Min, bin.Value) for bin in ih.Bins]
    s = calico.GoogleChart("ColumnChart", ("x", labels[i]), d, {'logScale': 1, 'colors': [labels[i]]})
    #calico.display(s.GetRepresentations()["text/html"])
    calico.display(s)
In [6]:
from Graphics import *
Picture(image.toBitmap())
Out[6]:
In [ ]: