ImageEn, unit ievision

TIEVisionObjectTracker.locateNewPosition

TIEVisionObjectTracker.locateNewPosition


Declaration

function locateNewPosition(image: TIEVisionImage; out backProjectedImage: TIEVisionImage): TIEVisionRotatedRect; safecall;


Description

Locate the new position of the object. Before call locateNewPosition you must call setInitialPosition.



Parameter Description
image Source image
backProjectedImage Image resulting of backprojection of object histogram

Note: You can use IEVisionRect to convert to a TIEVisionRect


Demo

Demo  Demos\IEVision\TrackObjects\TrackObjects.dpr


Example

// Create our tracking object
m_objectTracker := IEVisionLib.createObjectTracker();

// Specify the object to track
ImageEnView1.IEBitmap.Origin := ieboTOPLEFT;
image := IEVisionLib.createImage(ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height, ievUINT8, 3, ImageEnView1.IEBitmap.Rowlen, ImageEnView1.IEBitmap.ScanLine[0]);
with ImageEnView1 do
  m_objectTracker.setInitialPosition(image, IEVisionRect(SelX1, SelY1, SelX2 - SelX1, SelY2 - SelY1));

// As video frame changes, locate new position of the object
rotRect := m_objectTracker.locateNewPosition(ImageEnView1.IEBitmap.GetIEVisionImage().flip(ievY_AXIS), backProj);
... Show rotRect, e.g. with a rectangular shape layer


See Also

setInitialPosition