Measure vertical histogram
Visual Basic |
---|
Public Function MeasureVertHistogram() As Variant |
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