HALCON Reference Manual 10.0.2
Table of Contents / Matrix / Features ClassesClassesClasses | | | Operators

mean_matrixmean_matrixmean_matrixMeanMatrixMeanMatrix (Operator)

Name

mean_matrixmean_matrixmean_matrixMeanMatrixMeanMatrix — Returns the elementwise mean of a matrix.

Signature

mean_matrix( : : MatrixID, MeanType : MatrixMeanID)

Herror mean_matrix(const Hlong MatrixID, const char* MeanType, Hlong* MatrixMeanID)

Herror T_mean_matrix(const Htuple MatrixID, const Htuple MeanType, Htuple* MatrixMeanID)

Herror mean_matrix(const HTuple& MatrixID, const HTuple& MeanType, Hlong* MatrixMeanID)

HMatrix HMatrix::MeanMatrix(const HTuple& MeanType) const

void HOperatorSetX.MeanMatrix(
[in] VARIANT MatrixID, [in] VARIANT MeanType, [out] VARIANT* MatrixMeanID)

IHMatrixX* HMatrixX.MeanMatrix([in] BSTR MeanType)

static void HOperatorSet.MeanMatrix(HTuple matrixID, HTuple meanType, out HTuple matrixMeanID)

HMatrix HMatrix.MeanMatrix(string meanType)

Description

The operator mean_matrixmean_matrixmean_matrixMeanMatrixMeanMatrix returns the mean values of the elements of the MatrixMatrixMatrixMatrixmatrix defined by the matrix handle MatrixIDMatrixIDMatrixIDMatrixIDmatrixID. A new matrix MatrixMeanMatrixMeanMatrixMeanMatrixMeanmatrixMean is generated with the result and the matrix handle MatrixMeanIDMatrixMeanIDMatrixMeanIDMatrixMeanIDmatrixMeanID of this matrix is returned. Access to the elements of the matrix is possible e.g. with the operator get_full_matrixget_full_matrixget_full_matrixGetFullMatrixGetFullMatrix.

The type of mean determination of the matrix can be selected via the parameter MeanTypeMeanTypeMeanTypeMeanTypemeanType:

'columns'"columns""columns""columns""columns":

The mean is returned for each column of the MatrixMatrixMatrixMatrixmatrix separately. The resulting matrix MatrixMeanMatrixMeanMatrixMeanMatrixMeanmatrixMean has one row and the identical number of columns as the input matrix.

Example:


           /   8.0   4.0  -3.0  \
  Matrix = \  -6.0   2.0   7.0  /      MeanType = 'columns'

  ->   MatrixMean = [  1.0   3.0   2.0  ]
  

'rows'"rows""rows""rows""rows":

The mean is returned for each row of the MatrixMatrixMatrixMatrixmatrix separately. The resulting matrix MatrixMeanMatrixMeanMatrixMeanMatrixMeanmatrixMean has the identical number of rows as the input matrix and one column.

Example:


           /   8.0   4.0  -3.0  \
  Matrix = \  -6.0   2.0   7.0  /      MeanType = 'rows'

                    / 3.0 \
  ->   MatrixMean = \ 1.0 /
  

'full'"full""full""full""full":

The mean is returned using all elements of the MatrixMatrixMatrixMatrixmatrix. The resulting matrix MatrixMeanMatrixMeanMatrixMeanMatrixMeanmatrixMean has one row and one column.

Example:


           /   8.0   4.0  -3.0  \
  Matrix = \  -6.0   2.0   7.0  /      MeanType = 'full'

  ->   MatrixMean = [ 2.0 ]
  

Parallelization

Parameters

MatrixIDMatrixIDMatrixIDMatrixIDmatrixID (input_control)  matrix HMatrix, HTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Matrix handle of the input matrix.

MeanTypeMeanTypeMeanTypeMeanTypemeanType (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Type of mean determination.

Default value: 'columns' "columns" "columns" "columns" "columns"

List of values: 'columns'"columns""columns""columns""columns", 'rows'"rows""rows""rows""rows", 'full'"full""full""full""full"

MatrixMeanIDMatrixMeanIDMatrixMeanIDMatrixMeanIDmatrixMeanID (output_control)  matrix HMatrix, HTupleHMatrix, HTupleHMatrixX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Matrix handle with the mean values of the input matrix.

Result

If the parameters are valid, the operator mean_matrixmean_matrixmean_matrixMeanMatrixMeanMatrix returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Possible Predecessors

create_matrixcreate_matrixcreate_matrixCreateMatrixCreateMatrix

Possible Successors

get_full_matrixget_full_matrixget_full_matrixGetFullMatrixGetFullMatrix, get_value_matrixget_value_matrixget_value_matrixGetValueMatrixGetValueMatrix

See also

norm_matrixnorm_matrixnorm_matrixNormMatrixNormMatrix, sum_matrixsum_matrixsum_matrixSumMatrixSumMatrix

Module

Foundation


Table of Contents / Matrix / Features ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH