Skip to main content
100%

direction shader for OpenCV flows

✓ Published0🌍 Public
RRandomEtc
Last edited Jul 26, 2012
Created on Jul 26, 2012

This example visualizes optical flow direction and magnitude as a color-coded image, showing flow orientation through hue and flow strength through saturation. The GLSL shader reads horizontal and vertical flow components from two texture samplers, `xTex` and `yTex`, and computes per-pixel angle via `atan` and magnitude via `length`. It converts these values to HSL and then RGB using custom conversion functions, producing a smooth, rainbow-like representation of the flow field. The code relies on OpenCV-generated flow data passed as textures to the shader for real-time rendering.

AI-generated description

Similar vizzes