# \#optflow

**URL:** https://forum.opencv.org/tag/optflow/243.md

[Latest](https://forum.opencv.org/latest.md) · [Categories](https://forum.opencv.org/categories.md) · [Tags](https://forum.opencv.org/tags.md)

---

## [Defining the strategy to perform forgery detection](https://forum.opencv.org/t/defining-the-strategy-to-perform-forgery-detection/22860)

<div class="topic-metadata">

**Author:** [@EngelsLeonhardt](https://forum.opencv.org/u/EngelsLeonhardt)\
**Replies:** 5\
**Last updated:** [July 3, 2025, 3:57pm UTC](https://forum.opencv.org/t/defining-the-strategy-to-perform-forgery-detection/22860 "2025-07-03T15:57:00Z")

</div>

Hello community, this is my first post here. I am learning to use OpenCV to help me develop a way to identify video forgeries, such as inter-frame forgery detection. For that, I am using the Gunnar-Farneback method to co…

---

## [Cross modal satellite coregistration using cv2.optflow](https://forum.opencv.org/t/cross-modal-satellite-coregistration-using-cv2-optflow/20785)

<div class="topic-metadata">

**Author:** [@Paolo\_Giannoccaro](https://forum.opencv.org/u/Paolo_Giannoccaro)\
**Replies:** 9\
**Last updated:** [April 12, 2025, 8:31am UTC](https://forum.opencv.org/t/cross-modal-satellite-coregistration-using-cv2-optflow/20785 "2025-04-12T08:31:05Z")

</div>

I am experimenting with the library cv2.optflow to manage coregistration between two satellite images (optical vs. SAR). To date, I have tried calcOpticalFlowFarneback with modest results. Do you have any suggestions of …

---

## [OpticalFlowDual\_TVL1\_Impl::calc keep allocates memory](https://forum.opencv.org/t/opticalflowdual-tvl1-impl-calc-keep-allocates-memory/20244)

<div class="topic-metadata">

**Author:** [@n37jan](https://forum.opencv.org/u/n37jan)\
**Replies:** 7\
**Last updated:** [February 20, 2025, 6:36am UTC](https://forum.opencv.org/t/opticalflowdual-tvl1-impl-calc-keep-allocates-memory/20244 "2025-02-20T06:36:32Z")

</div>

Hi I’m building an application that uses OpenCV’s OpticalFlowDual\_TVL1\_Impl. It is basically gets sequence of image frames, and do optical flow motion vector estimation. While I was doing performance profiling using Nsi…

---

## [Rlof lof\_param-\>useInitialFlow = true; error: (-215:Assertion failed) nextPtsMat.checkVector(2, CV\_32F, true) == npoints in function 'calcLocalOpticalFlowCore' 。](https://forum.opencv.org/t/rlof-lof-param-useinitialflow-true-error-215-assertion-failed-nextptsmat-checkvector-2-cv-32f-true-npoints-in-function-calclocalopticalflowcore/19352)

<div class="topic-metadata">

**Author:** [@hu\_fang](https://forum.opencv.org/u/hu_fang)\
**Replies:** 1\
**Last updated:** [November 29, 2024, 7:13am UTC](https://forum.opencv.org/t/rlof-lof-param-useinitialflow-true-error-215-assertion-failed-nextptsmat-checkvector-2-cv-32f-true-npoints-in-function-calclocalopticalflowcore/19352 "2024-11-29T07:13:33Z")

</div>

cv::Mat img1 = cv::imread(“/home/hfm/slam/CLionProjects/rlof/image/1.png”); cv::Mat img2 = cv::imread(“/home/hfm/slam/CLionProjects/rlof/image/2.png”); if (img1.empty() || img2.empty()) { std::cerr \<\< “Error: Could no…

---

## [calcOpticalFlowSparseRLOF Assertion Error in InitialFlow](https://forum.opencv.org/t/calcopticalflowsparserlof-assertion-error-in-initialflow/8669)

<div class="topic-metadata">

**Author:** [@ggml](https://forum.opencv.org/u/ggml)\
**Replies:** 2\
**Last updated:** [November 26, 2024, 12:14pm UTC](https://forum.opencv.org/t/calcopticalflowsparserlof-assertion-error-in-initialflow/8669 "2024-11-26T12:14:29Z")

</div>

Hello, I am trying to use SparseRLOF Optical Flow to calculate displacement of falling particles. I have already done this using Lucas Kanade and it worked fine. I wanted to give this algorithm a shot and see if it does …

---

## [Derive affine transformation from dense optical flow](https://forum.opencv.org/t/derive-affine-transformation-from-dense-optical-flow/17318)

<div class="topic-metadata">

**Author:** [@nji9](https://forum.opencv.org/u/nji9)\
**Replies:** 0\
**Last updated:** [April 16, 2024, 7:15pm UTC](https://forum.opencv.org/t/derive-affine-transformation-from-dense-optical-flow/17318 "2024-04-16T19:15:18Z")

</div>

I’m about to determine the 2D affine transformation between two versions of an image. My idea was to compute optical flow between the images and then use that flow to compute the 2D affine transformation. I want to us…

---

## [Estimation of an objects velocity in a video](https://forum.opencv.org/t/estimation-of-an-objects-velocity-in-a-video/16118)

<div class="topic-metadata">

**Author:** [@bjr1973](https://forum.opencv.org/u/bjr1973)\
**Replies:** 2\
**Last updated:** [January 31, 2024, 5:25pm UTC](https://forum.opencv.org/t/estimation-of-an-objects-velocity-in-a-video/16118 "2024-01-31T17:25:07Z")

</div>

I would like to calculate the velocity that the horse is moving in a video like below I have a known distance on the horse itself so I can calculate the distances on the horse, but as the camera is ‘walking with’ the …

---

## [Lucas Kanade implementation](https://forum.opencv.org/t/lucas-kanade-implementation/12911)

<div class="topic-metadata">

**Author:** [@Chaitanya\_Kolluru](https://forum.opencv.org/u/Chaitanya_Kolluru)\
**Replies:** 3\
**Last updated:** [June 11, 2023, 12:03am UTC](https://forum.opencv.org/t/lucas-kanade-implementation/12911 "2023-06-11T00:03:53Z")

</div>

I would like to know how OpenCV’s implementation of the lucas kanade algorithm returns the location of the tracked points in the next frame. If I’m not mistaken, the algorithm computes the flow vectors in the x and y dir…

---

## [cuda\_FarnebackOpticalFlow.calc](https://forum.opencv.org/t/cuda-farnebackopticalflow-calc/12059)

<div class="topic-metadata">

**Author:** [@rokalax](https://forum.opencv.org/u/rokalax)\
**Replies:** 2\
**Last updated:** [February 20, 2023, 1:29pm UTC](https://forum.opencv.org/t/cuda-farnebackopticalflow-calc/12059 "2023-02-20T13:29:08Z")

</div>

Hello, I have installed and tested successfully with a simple clahe the CUDA opencv python package. I am not able to make the cuda\_FarnebackOpticalFlow.calc work. This is my code: gpu\_previous = cv2.cuda\_GpuMat() …

---

## [Why the output of Dense Optical Flow in OpenCV is not continuous？](https://forum.opencv.org/t/why-the-output-of-dense-optical-flow-in-opencv-is-not-continuous/11860)

<div class="topic-metadata">

**Author:** [@pinocchio2018](https://forum.opencv.org/u/pinocchio2018)\
**Replies:** 1\
**Last updated:** [February 3, 2023, 9:19am UTC](https://forum.opencv.org/t/why-the-output-of-dense-optical-flow-in-opencv-is-not-continuous/11860 "2023-02-03T09:19:10Z")

</div>

Hi, I asked a question in stackoverflow. Due to I am new user, I can’t put whole content here. (there is limitation for new user to upload too many pic ) please check my question url for details

---

## [How to determine average x + y motion of keypoints in video?](https://forum.opencv.org/t/how-to-determine-average-x-y-motion-of-keypoints-in-video/8983)

<div class="topic-metadata">

**Author:** [@solid](https://forum.opencv.org/u/solid)\
**Replies:** 6\
**Last updated:** [August 22, 2022, 1:24pm UTC](https://forum.opencv.org/t/how-to-determine-average-x-y-motion-of-keypoints-in-video/8983 "2022-08-22T13:24:52Z")

</div>

Good day :slight\_smile: I’m upgrading a testbench for 3D-printing with a high-speed camera, and I want to use the camera to determine motion of the filament (x-axis). I would also like to know the twist of the filament …

---

## [Full-frame motion detection - where to start?](https://forum.opencv.org/t/full-frame-motion-detection-where-to-start/9906)

<div class="topic-metadata">

**Author:** [@sbixby](https://forum.opencv.org/u/sbixby)\
**Replies:** 4\
**Last updated:** [August 20, 2022, 8:48am UTC](https://forum.opencv.org/t/full-frame-motion-detection-where-to-start/9906 "2022-08-20T08:48:31Z")

</div>

I’m a novice to anything video related. I have a need to analyze video frames from a camera that points at the ground, to detect movement of the camera over the ground. I am not looking for motion other than the whole …

---

## [Optical flow from given affine transformations](https://forum.opencv.org/t/optical-flow-from-given-affine-transformations/7022)

<div class="topic-metadata">

**Author:** [@mercury](https://forum.opencv.org/u/mercury)\
**Replies:** 0\
**Last updated:** [January 7, 2022, 3:31pm UTC](https://forum.opencv.org/t/optical-flow-from-given-affine-transformations/7022 "2022-01-07T15:31:18Z")

</div>

Dear community, In my simulation, foreground images(fg) move on background images(bg) along a continuous trajectory (polynomial, Bezier parametrized with time ) while being continuously scaled and rotated. It means tha…

---

## [Compensate micromovement between stills](https://forum.opencv.org/t/compensate-micromovement-between-stills/8877)

<div class="topic-metadata">

**Author:** [@StevenP](https://forum.opencv.org/u/StevenP)\
**Replies:** 0\
**Last updated:** [May 23, 2022, 12:06pm UTC](https://forum.opencv.org/t/compensate-micromovement-between-stills/8877 "2022-05-23T12:06:32Z")

</div>

Hi, I am building a photogrammetric head scanner, that aims at high-resolution normal maps (8k+) from multi-angle lighting. The goal is to create image sets of at least 8 lighting situations in the shortest possible am…

---

## [cv::cuda::NvidiaOpticalFlow\_2\_0::create takes about 30 seconds](https://forum.opencv.org/t/cv-create-takes-about-30-seconds/9878)

<div class="topic-metadata">

**Author:** [@Alexander\_Soare](https://forum.opencv.org/u/Alexander_Soare)\
**Replies:** 1\
**Last updated:** [August 17, 2022, 2:21pm UTC](https://forum.opencv.org/t/cv-create-takes-about-30-seconds/9878 "2022-08-17T14:21:09Z")

</div>

To use the official example script (linked below) I built OpenCV from source following the instructions from the Nvidia Optical Flow SDK (with slightly modified build flags to enable JPEG, OPENEXR, and Eigen). The OpenCV…

---

## [How to use cuda::SparsePyrLKOpticalFlow in multi thread environment](https://forum.opencv.org/t/how-to-use-cuda-sparsepyrlkopticalflow-in-multi-thread-environment/9632)

<div class="topic-metadata">

**Author:** [@keivan\_moazami](https://forum.opencv.org/u/keivan_moazami)\
**Replies:** 11\
**Last updated:** [July 30, 2022, 11:51am UTC](https://forum.opencv.org/t/how-to-use-cuda-sparsepyrlkopticalflow-in-multi-thread-environment/9632 "2022-07-30T11:51:30Z")

</div>

When I using cuda::SparsePyrLKOpticalFlow in multi thread application failed to calc optical flow properly. I run it on different cuda::GpuMats and in separate cuda::Streams with separate Algorithm instances. I create …

---

## [What are temp1,temp2 used for?](https://forum.opencv.org/t/what-are-temp1-temp2-used-for/7770)

<div class="topic-metadata">

**Author:** [@jeremy](https://forum.opencv.org/u/jeremy)\
**Replies:** 4\
**Last updated:** [March 4, 2022, 2:24am UTC](https://forum.opencv.org/t/what-are-temp1-temp2-used-for/7770 "2022-03-04T02:24:01Z")

</div>

Hi，I am try to understand source code of sparsePyrLKOptical algorithm, i see code in page above, it seems temp1, temp2 is used for nothing, just a multiply operation, so I wonder what are they used for? or just debug c…

---

## [Lktrack optical flow showing poor performance with fast object movement](https://forum.opencv.org/t/lktrack-optical-flow-showing-poor-performance-with-fast-object-movement/7495)

<div class="topic-metadata">

**Author:** [@west2788](https://forum.opencv.org/u/west2788)\
**Replies:** 3\
**Last updated:** [February 9, 2022, 7:51pm UTC](https://forum.opencv.org/t/lktrack-optical-flow-showing-poor-performance-with-fast-object-movement/7495 "2022-02-09T19:51:21Z")

</div>

Hi all, I’m working on a problem where I need to estimate the velocity of objects in a scene. The camera is static, and the objects move strictly perpendicular to the camera, so optical flow seems like a good way to ach…

---

## [DIS optical flow SIGSEGV error when changing parameters](https://forum.opencv.org/t/dis-optical-flow-sigsegv-error-when-changing-parameters/7236)

<div class="topic-metadata">

**Author:** [@Juneee\_Oh](https://forum.opencv.org/u/Juneee_Oh)\
**Replies:** 1\
**Last updated:** [January 25, 2022, 11:33pm UTC](https://forum.opencv.org/t/dis-optical-flow-sigsegv-error-when-changing-parameters/7236 "2022-01-25T23:33:24Z")

</div>

Hi, I try to use a dataset to calculate optical flow results with OpenCV. But when I try different parameters, the code seems very unstable, often showing this error: Process finished with exit code 139 (interrupted by …

---

## [Need some help with CUDA Optical Flow in Python](https://forum.opencv.org/t/need-some-help-with-cuda-optical-flow-in-python/2868)

<div class="topic-metadata">

**Author:** [@Dasyud](https://forum.opencv.org/u/Dasyud)\
**Replies:** 3\
**Last updated:** [April 20, 2021, 5:45pm UTC](https://forum.opencv.org/t/need-some-help-with-cuda-optical-flow-in-python/2868 "2021-04-20T17:45:07Z")

</div>

There is no Python documentation available for the CUDA optical flow modules. I have been trying to obtain the Brox optical flow and used some workarounds for bugs I encountered. However, the output doesn’t make any sen…

---

## [Detecting forward or backwards camera movement using OpticalFlow?](https://forum.opencv.org/t/detecting-forward-or-backwards-camera-movement-using-opticalflow/5783)

<div class="topic-metadata">

**Author:** [@kilowhisky](https://forum.opencv.org/u/kilowhisky)\
**Replies:** 2\
**Last updated:** [October 22, 2021, 5:07pm UTC](https://forum.opencv.org/t/detecting-forward-or-backwards-camera-movement-using-opticalflow/5783 "2021-10-22T17:07:46Z")

</div>

I’m trying to detect if a camera is moving backwards or forwards using OpenCV. From the examples and tutorials i see that OpticalFlow using the Lucas-Kanade algorithm may be my best option. Luckily for me, i do not reall…

---

## [Infos about mapping3d](https://forum.opencv.org/t/infos-about-mapping3d/5378)

<div class="topic-metadata">

**Author:** [@lben0110](https://forum.opencv.org/u/lben0110)\
**Replies:** 3\
**Last updated:** [October 13, 2021, 2:55am UTC](https://forum.opencv.org/t/infos-about-mapping3d/5378 "2021-10-13T02:55:33Z")

</div>

Hi @Tetragramm, I’m interested in your 3Dmapping application, developped in the opencv\_contrib on your github and I have some questions, I hope you can help me with. My use-case consists on estimating 3d detected objec…

---

## [Is DIS Optical Flow available on Android?](https://forum.opencv.org/t/is-dis-optical-flow-available-on-android/4850)

<div class="topic-metadata">

**Author:** [@Nipun\_Ramani](https://forum.opencv.org/u/Nipun_Ramani)\
**Replies:** 3\
**Last updated:** [August 20, 2021, 3:24pm UTC](https://forum.opencv.org/t/is-dis-optical-flow-available-on-android/4850 "2021-08-20T15:24:39Z")

</div>

Hi, I am using Farneback Optical Flow and I am looking for an alternative dense optical flow algorithm implementation. The paper I am trying to implement uses DIS and I would like to use it on Android but it seems it’s o…

---

## [cv2.optflow.calcOpticalFlowSparseRLOF Giving Assertion Error](https://forum.opencv.org/t/cv2-optflow-calcopticalflowsparserlof-giving-assertion-error/4835)

<div class="topic-metadata">

**Author:** [@help](https://forum.opencv.org/u/help)\
**Replies:** 6\
**Last updated:** [August 19, 2021, 11:33pm UTC](https://forum.opencv.org/t/cv2-optflow-calcopticalflowsparserlof-giving-assertion-error/4835 "2021-08-19T23:33:14Z")

</div>

Hello, I am trying to use SparseRLOF Optical Flow to calculate displacement of falling particles. I have already done this using Lucas Kanade and it worked fine. I wanted to give this algorithm a shot and see if it does …

---

## [Using the optical flow for motion detection in Supernova remnants in astronomy](https://forum.opencv.org/t/using-the-optical-flow-for-motion-detection-in-supernova-remnants-in-astronomy/4236)

<div class="topic-metadata">

**Author:** [@Aktro](https://forum.opencv.org/u/Aktro)\
**Replies:** 1\
**Last updated:** [July 8, 2021, 4:37pm UTC](https://forum.opencv.org/t/using-the-optical-flow-for-motion-detection-in-supernova-remnants-in-astronomy/4236 "2021-07-08T16:37:15Z")

</div>

Hi, This topic is about a recent experimentation I’ve tried on using the openCV optical flow implementation to measure the velocity and expansion of the blast wave in an exploded star (known as supernova remnant) using …

---

## [How to Follow the Action on a Basketball Court](https://forum.opencv.org/t/how-to-follow-the-action-on-a-basketball-court/3180)

<div class="topic-metadata">

**Author:** [@tps](https://forum.opencv.org/u/tps)\
**Replies:** 6\
**Last updated:** [May 12, 2021, 2:20pm UTC](https://forum.opencv.org/t/how-to-follow-the-action-on-a-basketball-court/3180 "2021-05-12T14:20:13Z")

</div>

Hi All Is it possible? I want to track players ( and the basketball if possible ) on a basketball court and decide where the action is. Tracking input video comes from a stationary wide angel camera that covers the en…

---

## [Bug: Brox Optical Flow (CUDA) with opencv-python giving errors](https://forum.opencv.org/t/bug-brox-optical-flow-cuda-with-opencv-python-giving-errors/2846)

<div class="topic-metadata">

**Author:** [@Dasyud](https://forum.opencv.org/u/Dasyud)\
**Replies:** 3\
**Last updated:** [April 19, 2021, 8:01pm UTC](https://forum.opencv.org/t/bug-brox-optical-flow-cuda-with-opencv-python-giving-errors/2846 "2021-04-19T20:01:40Z")

</div>

I have been trying to use the CUDA implementation of Brox Optical Flow, but no Python documentation is available. I managed to use create(), but I keep running into errors while using the calc() function. I’m using a sy…
