Lakshya-Kejriwal/Real-Time-Video-Stabilization

Compiling problems...

Opened this issue · 1 comments

I am compiling your code using this command and it seems to be working.

g++ $(pkg-config --cflags --libs /usr/local/Cellar/opencv@2/2.4.13.7_2/lib/pkgconfig/opencv.pc) -std=c++11 main.cpp videostab.cpp -o main.out && ./main.out

g++ $(pkg-config --cflags --libs /usr/local/Cellar/opencv@3/3.4.5/lib/pkgconfig/opencv.pc) -std=c++11 main.cpp videostab.cpp -o main.out

But I am getting this:

OpenCV Error: Assertion failed ((npoints = prevPtsMat.checkVector(2, CV_32F, true)) >= 0) in calcOpticalFlowPyrLK, file /tmp/opencv@2-20190104-5517-24qljy/opencv-2.4.13.7/modules/video/src/lkpyramid.cpp, line 845
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /tmp/opencv@2-20190104-5517-24qljy/opencv-2.4.13.7/modules/video/src/lkpyramid.cpp:845: error: (-215) (npoints = prevPtsMat.checkVector(2, CV_32F, true)) >= 0 in function calcOpticalFlowPyrLK

I am using openCV 2.4.13.7, and g++ (clang),

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Check to see if features1 is empty or not before calling calcOpticalFlowPyrLK. If it is empty simply return the frame2.