CImExtract:SetParams


The SetParams method changes the properties for extracting sources from an image. The CImExtract properties are initialized to reasonable values. The purpose of this method is to change these properties by setting new values in an ImExtractParams table. See the Mira User's Guide for more information regarding source extraction.

Syntax

bSuccess = CImExtract:SetParams( ImExtractParams_table)

bullet.gif    where ImExtractParams_table is a table of type ImExtractParams containing properties to change.

bullet.gif    On success, true is returned.

Example

Suppose an image window exists on the Mira screen and you wish to draw a point marker on the image. The script below sets several properties for the extraction process before calling Extract. Note that your table does not need to be named Params.

V = attachlist_imageview()

-- attach an image window

Assert( V, "No image window")

-- leave script if no image window

 

 

I = V:GetImage()

-- get the top-most or only image

Assert( I, "No image selected")

-- leave script if no image

 

 

E = new_imextract()

-- create a CImExtract object

Params =

-- setup an ImExtractParams table

{

-- use a comma after each "name=value" pair

  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)

-- set the new properties

 

 

bSuccess = E:Extract( I )

-- extract sources from image I

Related Topics

CImExtract class, ImExtractParams Table


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