Measure image skew
Visual Basic |
---|
Public Function MeasureSkew() As Double |
Measures image or zone skew relative to the nearest vertical or horizontal axis.
rConfidence property contains confidence level in percents.
Sub MeasureSkewRotation(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 skew As Double, rot As EPageRotation skew = Tools.MeasureSkew Debug.Print "Skew=" & skew & " Confidence=" & Tools.rConfidence & "%" & vbCrLf rot = Tools.MeasureRotation Debug.Print "Rotation=" & _ Switch(rot = ciRotUnknown, "Unknown", _ rot = ciRotNone, "None", _ rot = ciRotLeft, "TurnedLeft", _ rot = ciRotRight, "TurnedRight", _ rot = ciRotUpsideDown, "UpsideDown", _ rot = ciRotLeftOrRight, "TurnedLeftOrRight", _ rot = ciRotPortrait, "Portrait") & _ " Confidence=" & Tools.rConfidence & "%" End Sub