CImExtract:new


The new method creates an instance of the CImExtract class. You must call new before using any class methods or properties. Note that this object can also be created using the new_imextract function.

Syntax

C = CImExtract:new()

bullet.gif    Creates a default CImExtract object with properties initialized to default values.

C = CImExtract:new( Params )

bullet.gif    Creates a CImExtract object with default properties updated to values in the ImExtractParams table Params.

C = CImExtract:new( CImExtract_old )

bullet.gif    This is a copy constructor. It creates a new CImExtract object initialized to the members of theCImExtract_old argument.

Example

The following script creates a new CImExtract object, attaches an image window and an image, then extracts sources from that image. An ImExtractParams table is used to set several specific properties. Note that each of these table entries must include a comma.

E = CImExtract:new()

-- create a new CImExtract

 

 

Params =

 -- ImExtractParams properties to change

{

  

  bProcFilter = true,

 

  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

}

  

E:SetParams(Params)

  

 

 

V = attachlist_imageview()

-- connect to an image window

Assert( V, "No image window")

 -- exit if no image window

-- grab an image from the window, V

 

if V:Count() > 1 then

  

  I = CImage:AttachFromList( V )

-- pick the image from the CImageView V

  Assert( I, "No Images available")

 -- exit if no image

else

 

  I = V:GetImage()

-- pick the only image in the window

end

 

 

 

bSuccess = E:Extract(I)

-- run the image extraction procedure

Related Topics

CImExtract class, delete, new_imextract, ImExtractParams Table

 


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