{"id":27747,"library":"flow-vis","title":"FlowVis","description":"A Python package for easy visualization of optical flow fields, providing utilities to convert flow vectors into color-coded images for quick inspection. Current version 0.1, released as an initial alpha with simple generation and display functions; maintenance is sporadic.","status":"active","version":"0.1","language":"python","source_language":"en","source_url":"https://github.com/tomrunia/OpticalFlow_Visualization","tags":["optical flow","visualisation","computer vision","numpy"],"install":[{"cmd":"pip install flow-vis","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"For array operations on flow fields","package":"numpy","optional":false},{"reason":"Used for visualization and color mapping","package":"opencv-python","optional":true}],"imports":[{"note":"flow_viz is a function inside the flow_vis module, not a top-level module.","wrong":"import flow_viz","symbol":"flow_viz","correct":"from flow_vis import flow_viz"},{"wrong":null,"symbol":"make_colorwheel","correct":"from flow_vis import make_colorwheel"}],"quickstart":{"code":"import numpy as np\nfrom flow_vis import flow_viz\n\n# Create a dummy flow field (height, width, 2)\nflow = np.random.uniform(-10, 10, (100, 200, 2)).astype(np.float32)\n\n# Visualize\nrgb = flow_viz(flow)\n\n# Optionally display using OpenCV\nimport cv2\ncv2.imshow('Optical Flow', rgb)\ncv2.waitKey(0)\ncv2.destroyAllWindows()","lang":"python","description":"Generate a color-coded visualization from a flow array."},"warnings":[{"fix":"Normalize your flow values to a sensible range (e.g., clip to [-20,20]) or adjust the function's internal parameters.","message":"The input flow array must be of shape (H, W, 2) with the last dimension containing (dx, dy). The values are not normalized; the function will clip to a default range [-20, 20] pixels.","severity":"gotcha","affected_versions":"all"},{"fix":"Install opencv-python separately: pip install opencv-python.","message":"The package uses 'cv2' (OpenCV) internally but does not declare it as a hard dependency, causing import errors if OpenCV is missing.","severity":"deprecated","affected_versions":"all"},{"fix":"Use the resulting image directly with OpenCV or matplotlib; for float display, convert to float32 and divide by 255.","message":"The function 'flow_viz' returns an RGB image in uint8 format with values in [0,255]. Do not expect normalized float output.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use: from flow_vis import flow_viz","cause":"The correct import is from the module 'flow_vis', not 'flow_viz'. The function is named 'flow_viz' inside 'flow_vis'.","error":"ImportError: cannot import name 'flow_viz' from 'flow_viz'"},{"fix":"Install opencv-python: pip install opencv-python","cause":"OpenCV is required but not installed automatically.","error":"ModuleNotFoundError: No module named 'cv2'"},{"fix":"Ensure your flow array is a 3D numpy array with last dimension size 2.","cause":"The flow array must have shape (H, W, 2). If you provide a scalar or wrong dimensions, it fails.","error":"ValueError: operands could not be broadcast together with shapes"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}