Recent versions of Mathematica contain OpenCVLink, presumably for support of image processing routines in WL. Its internal nature means that it is, understandably, relatively incomplete and undocumented.
I have some optic flow calculations to do, and, indeed, I see that two CUDA implementations are available,
$OpticalFlowFarneback
and
$OpticalFlowDualTVL1
but their parameters are not as easily decipherable as some of the other implementations ($Dilation for example).
I was wondering if anyone out there had successfully parsed the unparsable or, barring that, someone has a .mc link that uses OpenCV that I can just steal as a template.Maybe even WRI could think of releasing some of these incomplete undocumented links to the GitHub-o-verse where the public could enhance and refine them?
I understand it would be useful to add usage to our OpenCVLink functions and we’ll consider putting some effort in doing so. But, keep in mind that we have them so that we use them one way or the other with WL functions.
$OpticalFlowFarneback is the method used in ImageDisplacements. You can access $OpticalFlowDualTVL1 using the undocumented Method->“TotalVariation”, but our tests show that this method is not giving results of consistent quality and that’s why we haven’t exposed it.
OK great, thank you- good to know about the Dual TVL 1… I know precisely what you’re talking about re: consistency, seems that things have to be ‘just right’ for it to work. Also, I didn’t know the Farneback is presently used in ImageDisplacements so I’ll play around there also.
I hope everything is going well for you.
I tried to use the OpticalFlow for a small project and did something. I’m not sure whether I went the right way or not. May I get your help.?
I came across this post that shows how optical flow is used in the tracking cell’s motion.
As I am a hydrologist, I decided to use the optical flow for measuring river
flow velocity. I recorded a short video (10 seconds) from the Sumida River, Japan.
I did something and got the initial results. Please have a look at the enclosed
notebook and the video.
The main aim of this notebook is the extraction of velocity components.