ImageEn, unit ievision

TIEVisionORBFeaturesDetector


Declaration

TIEVisionORBFeaturesDetector = interface(TIEVisionBase)


Description

An interface for the ORB keypoint detector and descriptor extractor.



Note: A shortcut method for this is available: OrbDetectAndDeskew


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());

  // 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);

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


Methods and Properties

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


See Also

createORBFeaturesDetector
findHomography
isValidHomography
warpPerspective