ImageEn, unit ievision

TIEVisionImage.detectLines

TIEVisionImage.detectLines


Declaration

function detectLines(detector: TIEVisionLinesDetector = ievBinaryDescriptor): TIEVisionVectorScalarInt32; safecall;


Description

Detects lines using a Binary Descriptor or LSDDetector detector.

Parameter Description
detector Detection algorithm to use.


Demo

Demo  Demos\IEVision\LinesDetectVideo\LinesDetectVideo.dpr


Example

var
  lines: TIEVisionVectorScalarInt32;
  i: integer;
begin
  ImageEnView.IO.LoadFromFile('input.jpg');
  lines := ImageEnView.IEBitmap.GetIEVisionImage().detectLines(ievBinaryDescriptor);
  // draw results
  ImageEnView.IEBitmap.PixelFormat := ie24RGB;
  ImageEnView.IEBitmap.Origin := ieboBOTTOMLEFT;
  for i := 0 to lines.size() - 1 do
  begin
    with lines.getScalarInt32(i) do
    begin
      with ImageEnView.IEBitmap.Canvas do
      begin
        Pen.Width := 2;
        Pen.Color := TRGB2TColor(CreateRGB(Random(255), Random(255), Random(255)));
        MoveTo(val[0], val[1]);
        LineTo(val[2], val[3]);
      end;
    end;
  end;
  ImageEnView.Update();
end;