CLsqFit:GetNumChannels CLsqFit:GetPt

CLsqFit:GetNumPtsUsed


The GetNumPtsUsed method returns the number of points used in computing the fit. This number ignores points that were deleted or rejected from the total number of points added to the sample.

Syntax

nPts = CLsqFit:GetNumPtsUsed()

nPts = CLsqFit:GetNumPtsUsed( nChannel )

n1, n2, n3, n4 = CLsqFit:GetNumPtsUsed()

bullet.gif    nChannel is an optional argument that specifies the channel for multi-channel (RGB) data.

bullet.gif    nPts,n1, n2,n3, and n4 are the number of points used for fitting all channels when nChannel is not specified.

Example

The following script fits a 2x2 polynomial with data rejection enabled, then retrieves the number of points used in the fit.

L = new_lsqfit()

-- create a CLsqFit object

L:SetNumCoefs( {2.2} )

-- set 2x2 coefficients to fit a warped plane

L:AddPt( {3, 5}, 5.15 )

-- add a point with x = 3, y = 5, z = 5.15

-- add more points to the fit

 

L:DoRejection( true )

-- enable bad data rejection

L:Fit()

-- Fit the polynomial

nU = L:GetNumPtsUsed()

-- number of points used

nR = L:GetNumPtsRejected()

-- number of points rejected

Printf( "nUsed=%d, nRej= %d\n", nU, nR )

-- list the number used and number rejected

Related Topics

CLsqFit class

GetNumPts

GetNumPtsRejected

GetNumPtsDeleted

DoRejection

Data Rejection

 


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