ImageEn, unit ievision

TIEVisionORBFeaturesDetector


Declaration

TIEVisionORBFeaturesDetector = interface(TIEVisionBase)


Description

TIEVisionORBFeaturesDetector is the interface for ORB keypoint detector and descriptor extractor.




Demo

Demo  Demos\IEVision\ImageAlignment\ImageAlignment.dpr


Example

var
  img1, img2: TIEBitmap;
  orb: TIEVisionORBFeaturesDetector;
  hmat: TIEVisionMatrix;
  imgres: TIEVisionImage;
begin
  img1 := TIEBitmap.Create('scanned-form.jpg');
  img2 := TIEBitmap.Create('form.jpg');

  // detect matching points of the two images
  orb := IEVisionLib().createORBFeaturesDetector();
  orb.detect(img1.GetIEVisionImage(), img2.GetIEVisionImage());

  // optionally show matching graph (matching points links)
  //ImageEnView2.IEBitmap.AssignIEVisionImage(orb.getMatchingGraph());
  //ImageEnView2.Update();

  // find homography matrix (hmat) from matching points
  hmat := IEVisionLib().createMath().findHomography(orb.getPoints1(), orb.getPoints2(), ievRANSAC);

  // adjust "scanned-form" to the same skew of "form" image
  imgres := img1.GetIEVisionImage().warpPerspective(hmat, IEVisionSize(img2.Width, img2.Height));

  // show final result
  ImageEnView1.IEBitmap.AssignIEVisionImage(imgres);
  ImageEnView1.Update();

  img2.Free();
  img1.Free();
end;


Methods and Properties

Public Method  detect
Public Method  getMatchingGraph
Public Method  getPoints1
Public Method  getPoints2


See Also

- findHomography
- isValidHomography
- warpPerspective