Ask Your Question
0

calcOpticalFlowFarneback with JavaCV

asked 2013-05-01 20:03:31 -0500

rossbrown gravatar image

updated 2013-05-01 20:16:39 -0500

I can't get calcOpticalFlowFarneback to work in javacv.

when I compile it says it needs

  required: IplImageArray,IplImageArray,CvArr,   double,int,int,int,int,double,int
  found:    IplImage,     IplImage,     IplImage,double,int,int,int,int,double,int

but the documentation doesn't mention IplImageArray.

if I do put it into IplImageArray,

IplImage image1_gray = cvCreateImage( cvSize(image1.width(),image1.height()), IPL_DEPTH_8U, 1 );

   IplImage image2_gray = cvCreateImage( cvSize(image2.width(),image2.height()), IPL_DEPTH_8U, 1 );
   IplImage flow  = cvCreateImage( cvSize(image1.width(),image1.height()), IPL_DEPTH_32F, 2 );

   cvConvertImage(image1, image1_gray, CV_CVTIMG_FLIP);
   cvConvertImage(image2, image2_gray, CV_CVTIMG_FLIP);     

   IplImageArray image1array = new IplImageArray(image1_gray);
   IplImageArray image2array = new IplImageArray(image2_gray);
   calcOpticalFlowFarneback(image1_gray, image2_gray, flow, 0.5, 1, 1, 1, 7,
                               1.5,OPTFLOW_FARNEBACK_GAUSSIAN);

then it crashes with

OpenCV Error: Assertion failed (func != 0) in unknown function, file ..\..\..\src\opencv\modules\core\src\convert.cpp, line 1095

calcOpticalFlowPyrLK works fine.

javacv 2.4.4

java 1.7.0_17

edit retag flag offensive close merge delete

Comments

Hello, did you manage to solve this issue? I'm having the same problem.

Dawit gravatar imageDawit ( 2014-04-03 23:01:53 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-05-05 21:17:38 -0500

rossbrown gravatar image

cvCalcOpticalFlowFarneback() uses CvArray or IplImage

I don't know what calcOpticalFlowFraneback() is, but it is something.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-05-01 20:03:31 -0500

Seen: 610 times

Last updated: May 05 '13