Skip to content

CVKit Flow Metric (f8.cvkit.flowmetric)

No description.

  • Service class: f8.cvkit.flowmetric
  • Version: 0.0.1
  • Source directory: f8/cvkit/flow_metric
  • Tags: cv, optical_flow, flow_metric, scalar_field

When to Use

  • Use f8.cvkit.flowmetric when you want compact motion metrics instead of a full optical flow field.
  • It is a good fit for activity level, direction bias, and threshold-driven motion logic.
  • In practice it is often easier to build control logic from these summary metrics than from raw dense flow.

Common Wiring Patterns

  • A common chain is video source -> f8.cvkit.denseoptflow -> f8.cvkit.flowmetric -> f8.pyengine.
  • It is especially useful when the next step is state switching, thresholding, or numerical remapping.
  • Keep a preview branch available during early tuning so motion spikes can be compared against the actual image.

Pitfalls / Gotchas

  • If the metrics feel abstract, go back to the original video or dense flow view rather than tuning blindly.
  • Scene cuts, flashes, and abrupt camera changes can create extreme motion peaks.
  • If you really need object-level tracking rather than global motion, use templatematch or tracking instead.

Service Reference

How to Run

../win/f8cvkit_flow_metric_service.exe
  • Workdir: ./
  • Environment overrides: none

Typical Inputs / Outputs

  • Data inputs: none
  • Data outputs: monitor
  • Commands: none

Service State Fields

Name Access Required On Node Schema Description
inputFlowShmName rw true true string Input flow SHM name (format flow2_f16, e.g. shm.xxx.flow).
computeEveryNFrames rw true false integer / default=1 Compute selected flow metric once per N new flow frames.
metricMode rw true false string / enum[divergence, magnitude, curl, strain] / default=divergence Flow metric mode: divergence | magnitude | curl | strain.
metricScale rw true false number / default=1.0 Scale factor applied to computed metric values before output.
scalarShmName ro true true string Output SHM name for scalar metric field.
scalarShmFormat ro true false string Output payload format. Fixed to scalar1_f32.
lastError ro true false string Last error message.
active rw true false boolean / default=True Service lifecycle state (activate/deactivate).
svcId ro true false string Readonly: current service instance id (svcId).

Key Fields That Matter

  • inputFlowShmName (Input Flow SHM, rw): Input flow SHM name (format flow2_f16, e.g. shm.xxx.flow). Schema: string.
  • computeEveryNFrames (Compute Every N Frames, rw): Compute selected flow metric once per N new flow frames. Schema: integer / default=1.
  • metricMode (Metric Mode, rw): Flow metric mode: divergence | magnitude | curl | strain. Schema: string / enum[divergence, magnitude, curl, strain] / default=divergence.
  • metricScale (Metric Scale, rw): Scale factor applied to computed metric values before output. Schema: number / default=1.0.
  • scalarShmName (Scalar SHM Name, ro): Output SHM name for scalar metric field. Schema: string.
  • scalarShmFormat (Scalar SHM Format, ro): Output payload format. Fixed to scalar1_f32. Schema: string.
  • lastError (Last Error, ro): Last error message. Schema: string.
  • active (Active, rw): Service lifecycle state (activate/deactivate). Schema: boolean / default=True.

Service Commands

None

Service Data Input Ports

None

Service Data Output Ports

Name Required On Node Schema Description
monitor true false object{active, alive, cpu, error, ...} Unified runtime monitor snapshots (health/resource/perf/error).

Operators

None

  • No bundled scenario references this node yet.