- OpticalFlowLKDoG: https://www.mathworks.com/help/releases/R2022b/vision/ref/opticalflowlkdog.html
- OpticalFlowLK: https://www.mathworks.com/help/releases/R2022b/vision/ref/opticalflowlk.html
- OpticalFlowFarneback: https://www.mathworks.com/help/releases/R2022b/vision/ref/opticalflowfarneback.html
- OpticalFlowHS: https://www.mathworks.com/help/releases/R2022b/vision/ref/opticalflowhs.html
Error in MATLAB opticalFlow function from the vision toolbox
14 次查看(过去 30 天)
显示 更早的评论
I am trying to run the RealTime_dense_descriptors code from GitHub. Since this is an old MATLAB code & I have the R2022b release, I had to make the following modifications:
- I changed the code to read the .avi video using a fullfile function. That part runs fine now (atleast from what I see).
- I replaced 'vision.OpticalFlow' with 'opticalFlow' in the Video2OpticalFlow.m file.
The old OpticalFlow function takes several arguments as shown in the Video2OpticalFlow.m file. Here's a snippet:
opticalFlowClass = opticalFlow('OutputValue', ...
'Horizontal and vertical components in complex form', 'Method', method);
When I run the demo.m file, I get the following error:
Error using opticalFlow
Must have at least two input arguments or no input argument.
Error in Video2OpticalFlow (line 28)
opticalFlowClass = opticalFlow('OutputValue', ...
Error in Video2DenseHOFVolumes (line 33)
opticalFlow = Video2OpticalFlow(video, flowMethod);
Error in demo (line 90)
Video2DenseHOFVolumes(sampledVid, blockSize, numBlocks, numOr, flowMethod);
However, I am unsure how to modify the code to fix this error. Could someone provide guidance on how to resolve this issue and modify the code accordingly? Any help would be appreciated. Thank you.
0 个评论
回答(1 个)
Abhinav Aravindan
2024-11-15,9:34
The “vision.OpticalFlow” system object estimates object velocities from one image or video frame to another. It uses either the Horn-Schunck or the Lucas-Kanade method. This function appears to have been removed from MATLAB R2016a. You may use one of the below mentioned alternative functions as per your requirement in MATLAB R2022b instead of the “opticalFlow” function to resolve the error.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!