'Declaration
Public Function FirstLine() As CiLine
public CiLine FirstLine()
public function FirstLine(): CiLine;
public function FirstLine() : CiLine;
public: CiLine^ FirstLine();
Return Value
Nothing or null when no more lines are available.
'Declaration
Public Function FirstLine() As CiLine
public CiLine FirstLine()
public function FirstLine(): CiLine;
public function FirstLine() : CiLine;
public: CiLine^ FirstLine();
Lines are identified based on values of pLineCurvature, pMinLineLength, pMaxLineGap and pMaxLineAngle properties
void ListLines(string imageFile) { // Open image file CiServer ci = Inlite.ClearImageNet.Server.GetThreadServer(); CiTools Tools = ci.CreateTools(); Tools.Image.Open(imageFile, 1); // Do processing CiLine Line; Tools.pLineCurvature = ELineCurvature.ciCurvVeryLow; Tools.pMaxLineAngle = 4.5; Tools.pMaxLineGap = 5; Tools.pMinLineLength = 100; Tools.pLineDirection = ELineDirection.ciLineVertAndHorz; Line = Tools.FirstLine(); while (Line != null) { Console.Write(" Line Angle=" + Line.Angle + " Thickness=" + Line.Thickness); Console.Write(" Rect=" + "(" + Line.Rect.left + "," + Line.Rect.top + " - " + Line.Rect.right + "," + Line.Rect.bottom + ")"); Console.Write(" Start (" + Line.Start.x + "," + Line.Start.y + ") End (" + Line.End.x + "," + Line.End.y + ")"); Console.Write(" Dir=" + Line.Direction.ToString() + Environment.NewLine); Line = Tools.NextLine(); } }
Sub ListLines(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 Line As CiLine Tools.pLineCurvature = ELineCurvature.ciCurvVeryLow Tools.pMaxLineAngle = 4.5 Tools.pMaxLineGap = 5 Tools.pMinLineLength = 100 Tools.pLineDirection = ELineDirection.ciLineVertAndHorz Line = Tools.FirstLine() Do While Not Line Is Nothing Console.Write(" Line Angle=" + Line.Angle + " Thickness=" + Line.Thickness) Console.Write(" Rect=" + "(" + Line.Rect.left + "," + Line.Rect.top + " - " + Line.Rect.right + "," + Line.Rect.bottom + ")") Console.Write(" Start (" + Line.Start.x + "," + Line.Start.y + ") End (" + Line.End.x + "," + Line.End.y + ")") Console.Write(" Dir=" + Line.Direction.ToString() + Environment.NewLine) Line = Tools.NextLine() Loop End Sub