Collision Avoidance using OpenCV on iPad

为君一笑 提交于 2019-12-04 14:42:54

1

HOW is optical flow used to detect impending collision?

I've never used optical flow, but the first google request gave me this paper:

Obstacle Detection using Optical Flow

I don't know if you've already read it. It shows how to estimate time to contact at every angle.

2

This shows me an image which only has colored horizontal lines on the screen, nothing similar to my original test image.

I suppose that output of goodFeaturesToTrack is not an image, but a table of points. See, for example, how they are used in a Python example (in the old version of OpenCV). The same probably applies to the output of calcOpticalFlowPyrLK. Look what's there in debug first. I usually use Python + OpenCV to understand what's the output of unfamiliar OpenCV functions.

4

I'm having a little difficulty understanding the datatypes used in this project. InputArray, OutputArray etc are the types accepted by OpenCV APIs. Yet in processFrame function, cv::Mat was being passed to Canny edge detection method. Do I pass cv::Mat to calcOpticalFlowPyrLK() for prevImage and nextImage?

From the documentation:

This is the proxy class for passing read-only input arrays into OpenCV functions. .... _InputArray is a class that can be constructed from Mat, Mat_<T>, Matx<T, m, n>, std::vector<T>, std::vector<std::vector<T> > or std::vector<Mat>. It can also be constructed from a matrix expression.

So you can just pass Mat. Some older functions still expect only Mat.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!