CImExtract:Copy


The Copy method copies the properties of another CImExtract object or ImExtractParams table into an existing CImExtract object. Both CImExtract objects must already exist before calling Copy. To copy another CImExtract object or an ImExtractParams table at creation time, use the copy-constructor form of the CImExtract:new method or the new_imextract function.

Syntax

bSuccess = CImExtract:Copy( CImExtract_old )

bSuccess = CImExtract:Copy( ImExtractParams_old )

bullet.gif    where CImExtract_old is another CImExtract object.

bullet.gif    ImExtractParams is a table of type ImExtractParams containing selected properties to be copied.

bullet.gif    On failure, bSuccess is returned as true.

Remarks

Use this method to copy CImExtract properties from one CImExtract object to another that already exists (i.e., not as part of its creation). For two objects B and A, do not use the trivial statement B = A, as this simply makes B an alias for to the object A. Instead, use B:Copy(A) for the new object B and old object A.

Example

Suppose a CImExtract object E1 exists. The following script shows two ways to copy the properties of E1 or an ImExtractParams table into another CImExtract object E2. Note that the properties of E1 or the ImExtractParams table could also be copied into E2 at creation time using the new constructor or the new_imextract function.

E2 = new_imextract()

-- create an CImExtract E2

bSuccess = E2:Copy(E1)

-- copy the properties of object E1

 

 

Params =

-- ImExtractParams properties to change

{

  

  bProcFilter = true,

-- each name=value pair must end with a comma

  bFilterUseSepMin = true,

 

  nFilterSepMin = 10,

 

  bFilterUseAreaMax = true,

 

  nFilterAreaMax= 100,

 

  nBgMethod = 1,

 

  nDetectTreshold = 45,

-- threshold value = 45

  nDetectTest = 0,

-- use pixels greater than or equal to threshold

}

  

E2:Copy(Params)

 -- copy selected properties from Params

 

 

Related Topics

CImExtract class, new_imextract, ImExtractParams


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.