farneback optical flow in opencv for java
Hello, As i find out there is implementation for the Farneback optical flow in openCV c, c++ and java. Is there any implementation in java?
Thanks in advance, Ioanna
yes, look here
Thank you very much!
Finally i installed openCV successfully. However it is so hard to define the variables and to use the function..Is there any manual which can help very beginners for java?
hey, nice to hear, that you got it running now ;)
unfortunately, there are no real beginner-tutorials for java. there are some for android, but apart from the same language, pretty much different situation.
I used to use openCv in c++ and it was awesome. Know i can really to something! Let's say i am trying to to the following:
import org.opencv.core.CvType; import org.opencv.core.Mat;
public class openCvHello { public static void main( String[] args ) { // System.loadLibrary( Core.NATIVE_LIBRARY_NAME );
} }
However, i am getting this error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: The method calcOpticalFlowFarneback(Mat, Mat, Mat, double, int, int, int, int, double, int) is undefined for the type openCvHello
hey ;)
from the doc page, again: flow - computed flow image that has the same size as prev and type CV_32FC2.
so the type for your flow mat is wrong here, too. should be CvType.CV_32FC2 instead. that 'flow' matrix will hold the x and y movement for each pixel
also, chuckle a bit about things being peculiar in java here