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
Sub MeasureHistogram(imageFile As String)
' Open image file
Dim Ci As New CiServer
Dim Tools As CiTools: Set Tools = Ci.CreateTools
Tools.Image.Open imageFile
' Do processing
Dim Hist, i, start
Hist = Tools.MeasureHorzHistogram
For i = LBound(Hist) To UBound(Hist)
start = 0: If (Tools.Image.IsZone) Then start = Tools.Image.Zone.Top
Debug.Print "Row=" & start + i & " Pixels=" & Hist(i) & vbCrLf
Next
Hist = Tools.MeasureVertHistogram
For i = LBound(Hist) To UBound(Hist)
start = 0: If (Tools.Image.IsZone) Then start = Tools.Image.Zone.Left
Debug.Print "Col=" & start + i & " Pixels=" & Hist(i) & vbCrLf
Next
End Sub