PANDORE Version 6 GREYC-IMAGE

parraysize



Returns the size of array in a collection.



Synopsis

parraysize name [col_in|-]

Description

parraysize returns the size of the array name in the input collection col_in. The value can then be get by operator pstatus.

Parameters

Inputs

Outputs

Result

Returns an integer or FAILURE in case of bad input.

Examples

Classifies beans into the jellybean.pan image from sample of each bean stored in the directory 'base' (Unix version).

# Learning
   classes=1;
   for i in base/*.pan
   do
      pim2array ind $i /tmp/tmp1 
      parraysize ind.1 /tmp/tmp1
      size=`pstatus`
      pcreatearray ind.C Ushort $size $classes | pcolcatenateitem /tmp/tmp1 - i-01.pan
      if [ -f base.pan ]
      then pcolcatenateitem i-01.pan base.pan base.pan
      else cp i-01.pan base.pan
      fi
      classes=`expr $classes + 1`
   done 

# Classification
   pproperty 0 jellybeans.pan
   ncol=`pstatus`
   pproperty 1 jellybeans.pan
   nrow=`pstatus`

   pim2array ind jellybeans.pan | pknn ind ind ind 10 base.pan - | parray2im $ncol $nrow 0 ind | pim2rg - out.pan

See also

Array

C++ prototype

Long PArraySize( const Collection &col_in, const std::string &name );

Version française

Retourne la taille d'un vecteur dans une collection.


Author: Alexandre Duret-Lutz