Calculate global opencv 2.4.x movement C ++

Here are two images that were taken before the surgeon performed any action, and the other after that.

Before: enter image description here

After: enter image description here

Difference: (after - to) + 128. (Adding 128 is simply the best image) enter image description here

As the white arrows pointed out, global movement affected all objects.

So, I need to evaluate it in order to get more valuable information about what is happening on stage.

I already knew that it OpenCV 3.0helps in this context when he implemented some methods that evaluate the dominant movement between two images or two point lists. But I still use OpenCV 2.4.xit because I have dependencies with libraries already installed on my machine, so I'm looking for alternative solutions or any other code that does what I want.

+4
source share
1 answer

You are looking for a dense optical flow algorithm :

Result for

cv::calcOpticalFlowFarneback(img1, img2, flowField, 0.5, 3, 10, 5, 5, 1.1)

- This is the next flow field in which you clearly see the changes: enter image description here

Regarding global motion detection:

  • ( ), : .
  • , .
+2

Source: https://habr.com/ru/post/1624996/


All Articles