Measure image skew
Public Function MeasureSkew() As Double
Result range is from -45 degrees to 45 degrees. Value is negative, if image skewed counterclockwise and positive if image is skewed clockwise.
Measures image or ROI skew relative to the nearest vertical or horizontal axis.
Level of confidence in percent is set in rConfidence.
Measure Skew and Rotation
|VB Sample (Visual Basic)||Copy Code|
Public Sub T_MeasureSkewAndRotation(ByRef Tools As CiTools) Dim nSkew, eRot nSkew = Tools.MeasureSkew Debug.Print "Skew=" & nSkew & " Confidence=" & Tools.rConfidence & "%" eRot = Tools.MeasureRotation Debug.Print "Rotation=" & _ Switch(eRot = ciRotUnknown, "Unknown", _ eRot = ciRotNone, "None", _ eRot = ciRotLeft, "TurnedLeft", _ eRot = ciRotRight, "TurnedRight", _ eRot = ciRotUpsideDown, "UpsideDown", _ eRot = ciRotLeftOrRight, "TurnedLeftOrRight", _ eRot = ciRotPortrait, "Portrait") & _ " Confidence=" & Tools.rConfidence & "%" End Sub