android - cvtColor not working properly in OpenCV for Java -


I am trying to use the calcCopticalFlowPyrLK method and it failed to throw an emphasis Lives:

/ P>

  OpenCV error: failure failed ((npoints = prevPtsMat.checkVector (2, CV_32F, true)) gt; = 0)   

and the probe vector checks that the input matrix is ​​2 channel and it has a color depth of CV_32F. My input is a mat with 4 channels and CV_8U has a color depth when I try to change it every time this Fails to change I used

  Mat prevFrame; // Input matte CVCameraViewFrame replaced in RGB mat = new mat (Rows, Calls, CVTEP.CV_32F); Imgproc.cvtColor (prevFrame, previous, imgproc. COLOR_BGRA2GRAY); Prev.convertTo (formerly, CvType.CV_32F);   

But when I check later, the right depth (CV_32F) is, but only 1 element is the channel. I am struggling with this for hours and I can not understand what the problem is.

The logic is that the previous PTSmate has failed on the vector, which is the third argument for the calcopticalflowPyrLK call. It seems that the matrix you are defining here is the first argument and it should be a channel image because it is already there.

I think that you are using a point array for the third argument and you may need to create an MatOfPoint2f () for the array explicitly. I think it has been described in:

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -