I have a very basic query about storing vectors in OpenCV, but since I’ve always worked in MATLAB, I am finding it really difficult to perform the same vector operations in C++.
So here’s my problem, I have computed optical flow using the basic cvGoodFeaturesToTrack() and cvCalcOpticalFlowPyrLK() functions and find the flow lines’ end points and show them on the image as lines of optical flow.
However, I want to store these flow line end points in a vector and then save it as a text file which I can then send to MATLAB for reading.
I really don’t know how I can create these vectors that store these points and save them on a text file.
Can anyone help?
Thanks,
Yash
Based on the OP’s comments on the question i think this is a good way to do it:
This code should give you the following file at the local directory:
pointsOutput.m:
which in matlab will give you the fiollowing matrix:
Assuming you have two points in that list with x and y = 1 and 2, 3 and 4.
Hope this helps.