void MeasureHistogram(string imageFile)
{
// Open image file
CiServer ci = Inlite.ClearImageNet.Server.GetThreadServer();
CiTools Tools = ci.CreateTools();
Tools.Image.Open(imageFile, 1);
// Do processing
int[] Hist; int i; int start;
Hist = Tools.MeasureHorzHistogram();
start = 0; if (Tools.Image.IsZone) { start = Tools.Image.Zone.top; }
for (i = 0; i < Hist.Length; i++)
{ Console.WriteLine("Row=" + (start + i) + " Pixels=" + Hist[i]); }
Hist = Tools.MeasureVertHistogram();
start = 0; if (Tools.Image.IsZone) { start = Tools.Image.Zone.top; }
for (i = 0; i < Hist.Length; i++)
{ Console.WriteLine("Col=" + (start + i) + " Pixels=" + Hist[i]); }
}
Sub MeasureHistogram(imageFile As String)
' Open image file
Dim ci As CiServer = Inlite.ClearImageNet.Server.GetThreadServer()
Dim Tools As CiTools = ci.CreateTools()
Tools.Image.Open(imageFile, 1)
' Do processing
Dim Hist As Integer(), i As Integer, start As Integer
Hist = Tools.MeasureHorzHistogram()
start = 0 : If (Tools.Image.IsZone) Then start = Tools.Image.Zone.top
For i = 0 To Hist.Length - 1
Console.WriteLine("Row=" + start + i + " Pixels=" + Hist(i))
Next
Hist = Tools.MeasureVertHistogram()
start = 0 : If (Tools.Image.IsZone) Then start = Tools.Image.Zone.left
For i = 0 To Hist.Length - 1
Console.WriteLine("Col=" + start + i + " Pixels=" + Hist(i))
Next
End Sub