Skip to content

vector_field_lengthVectorFieldLengthVectorFieldLengthvector_field_lengthvector_field_length🔗

Short description🔗

vector_field_lengthVectorFieldLengthVectorFieldLengthvector_field_lengthvector_field_length — Compute the length of the vectors of a vector field.

Signature🔗

vector_field_length( image VectorField, out image Length, string Mode )void VectorFieldLength( const HObject& VectorField, HObject* Length, const HTuple& Mode )static void HOperatorSet.VectorFieldLength( HObject vectorField, out HObject length, HTuple mode )def vector_field_length( vector_field: HObject, mode: str ) -> HObject

Herror vector_field_length( const Hobject VectorField, Hobject* Length, const char* Mode )

Herror T_vector_field_length( const Hobject VectorField, Hobject* Length, const Htuple Mode )

HImage HImage::VectorFieldLength( const HString& Mode ) const

HImage HImage::VectorFieldLength( const char* Mode ) const

HImage HImage::VectorFieldLength( const wchar_t* Mode ) const (Windows only)

HImage HImage.VectorFieldLength( string mode )

Description🔗

vector_field_lengthVectorFieldLength compute the length of the vectors of the vector field VectorFieldvectorFieldvector_field and returns them in Lengthlengthlength. vector_field_lengthVectorFieldLength only accepts vector fields of the semantic type vector_field_relative. The parameter Modemodemode can be used to specify how the lengths are computed. For Modemodemode = 'length'"length", the Euclidean length of the vectors is computed. For Modemodemode = 'squared_length'"squared_length", the square of the length of the vectors is computed. This avoids having to compute a square root internally, which is a costly operation on many processors, and hence saves runtime on these processors. Note that the VectorFieldvectorFieldvector_field must be in relative coordinates as returned by optical_flow_mgOpticalFlowMg.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on domain level.

  • Automatically parallelized on tuple level.

Parameters🔗

VectorFieldvectorFieldvector_field (input_object) singlechannelimage(-array) → object (vector_field)HObject (vector_field)HImage (vector_field)HObject (vector_field)Hobject (vector_field)

Input vector field

Lengthlengthlength (output_object) singlechannelimage(-array) → object (real)HObject (real)HImage (real)HObject (real)Hobject * (real)

Length of the vectors of the vector field.

Modemodemode (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Mode for computing the length of the vectors.

Default: 'length'"length"
List of values: 'length', 'squared_length'"length", "squared_length"

Result🔗

If the parameter values are correct, the operator vector_field_lengthVectorFieldLength returns the value 2 (H_MSG_TRUE). If the input is empty (no input images are available) the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

optical_flow_mgOpticalFlowMg

Possible successors

thresholdThreshold

Module🔗

Foundation