cv::CalcOpticalFlowPyrLKでハマる

OpenCV Error: Assertion failed (mtype == type0 || (CV_MAT_CN(mtype) == CV_MAT_CN(type0) && *1 in create, file /tmp/homebrew-opencv-2.4.2-IGYN/OpenCV-2.4.2/modules/core/src/matrix.cpp, line 1405

というエラー。
まぁどれかの型がおかしいんでしょうね、というところまではわかるんだけど。。

原因は
void calcOpticalFlowPyrLK(InputArray prevImg, InputArray nextImg, InputArray prevPts, InputOutputArray nextPts, OutputArray status, OutputArray err, Size winSize=Size(21,21), int maxLevel=3, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), int flags=0, double minEigThreshold=1e-4 )

のstatus
status – Output status vector. Each element of the vector is set to 1 if the flow for the corresponding features has been found. Otherwise, it is set to 0.
だけを読んで、ノリでstd::vectorにしてみたのが間違いでした。
std::vectorが正解のようです。

ドキュメント読んでもその辺はわかんないので、サンプルコード見ましょうってかんじなのかな。

*1:1 << type0) & fixedDepthMask) != 0