ClearImage .NET API
MeasureVertHistogram Method (CiTools)
Example 





Inlite.ClearImage Namespace > CiTools Class : MeasureVertHistogram Method
Measure vertical histogram
Syntax
'Declaration
 
Public Function MeasureVertHistogram() As System.Integer()
'Usage
 
Dim instance As CiTools
Dim value() As System.Integer
 
value = instance.MeasureVertHistogram()
public System.int[] MeasureVertHistogram()
public function MeasureVertHistogram(): System.array of Integer; 
public function MeasureVertHistogram() : System.int[];
public:
System.array<int>^ MeasureVertHistogram(); 

Return Value

An array of integers with the number of pixels in each row.
Remarks
Method requires bi-tonal image (object.Image.BitsPerPixel = 1).
Example
Measure Vertical and Horizontal Histograms
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
See Also

Reference

CiTools Class
CiTools Members
MeasureHorzHistogram Method
MeasureVertHistogram Method