PDA

View Full Version : [Q] CurrentContour problem



Unregistered
January 3, 2006, 01:04:43
Hil all.

I purchased a license key yesterday and have a problem in CurrentContour method of BlobFinder.

At first, added MVSmartContrl in Delphi 7 IDE.
MVSC_Blob: TMVSmartControl;

and added OnFilterEvent handler of MVSC_Blob.
procedure TFormMain.MVSC_BlobFilterEvent(ASender: TObject; Cookie, EventCode: Integer);
var
IFilter: IInterface;
IBlobFinder: IMVBlobFinder;
pContour: MV_POINT;
cCount: Integer;
cMax: SYSINT;
begin

if (Cookie = BlobCookie) and (Update = True) and
(EventCode = MV_ALGORITHM_END_EVENT) then
begin
FilterGraph.GetFilter('MV Blob Finder', IFilter);
if(IFilter <> nil) then
begin
IFilter.QueryInterface(IID_IMVBlobFinder, IBlobFinder);
if(IBlobFinder <> nil) then
begin
cMax := 100000;
try
IBlobFinder.CurrentContour(pContour, cMax, cCount);
except
on E: Exception do Caption := 'Error';
end;
end;
end;
end;

Above code always make exception and when I debug in Delphi, sometimes
makes my PC to restart.
Would you tell me the right usage to use CurrentContour method?

Thanks in advance.

Bernd Peretzke
January 3, 2006, 09:27:54
Hi,

The pContour has to be an array of MV_POINT. Unfortunately Delphi converts the type from a pointer of MV_POINT to MV_POINT. Look at the iMVBlobFinder.idl for the interface definition.

Regards
Bernd

Bernd Peretzke
January 3, 2006, 11:31:50
Hi,

I have extend the interface from the IMVBlobFinder. Now you can get the contour points with standard datatypes. Please contact support@montivision.com to get the new version of the MV Blob Finder filter.

Regards
Bernd