Ask Your Question

Ioanna's profile - activity

2017-09-08 11:58:28 -0600 received badge  Famous Question (source)
2016-07-20 00:51:24 -0600 received badge  Popular Question (source)
2015-03-04 21:58:08 -0600 received badge  Notable Question (source)
2014-05-19 16:24:57 -0600 received badge  Popular Question (source)
2014-01-30 04:39:34 -0600 marked best answer Error :no opencv_java246 in java.library.path

I am following this http://docs.opencv.org/doc/tutorials/introduction/desktop_java/java_dev_intro.html to install openCv for java. I am running the example according to this link.

The following error appear.

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java246 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860) at java.lang.Runtime.loadLibrary0(Runtime.java:845) at java.lang.System.loadLibrary(System.java:1084) at openCvHello.main(openCvHello.java:9) I am trying to solve it 5 days ago. Please help me as soon as posible

2013-10-30 00:48:49 -0600 asked a question Output of calcOpticalFlowFarneback

Hello, I am using this function calcOpticalFlowFarneback

public static void calcOpticalFlowFarneback(Mat prev, Mat next, Mat flow, double pyr_scale, int levels, int winsize, int iterations, int poly_n, double poly_sigma, int flags) Computes a dense optical flow using the Gunnar Farneback's algorithm.

The function finds an optical flow for each prev pixel using the [Farneback2003] algorithm so that

prev(y,x) ~ next(y + flow(y,x)[1], x + flow(y,x)[0])

Parameters: prev - first 8-bit single-channel input image. next - second input image of the same size and the same type as prev. flow - computed flow image that has the same size as prev and type CV_32FC2. pyr_scale - parameter, specifying the image scale (<1) to build pyramids for each image; pyr_scale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous one. levels - number of pyramid layers including the initial image; levels=1 means that no extra layers are created and only the original images are used. winsize - averaging window size; larger values increase the algorithm robustness to image noise and give more chances for fast motion detection, but yield more blurred motion field. iterations - number of iterations the algorithm does at each pyramid level. poly_n - size of the pixel neighborhood used to find polynomial expansion in each pixel; larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field, typically poly_n =5 or 7. poly_sigma - standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial expansion; for poly_n=5, you can set poly_sigma=1.1, for poly_n=7, a good value would be poly_sigma=1.5.

i did not understand how to use the flow matrix! What is it containing!?

2013-10-27 16:38:45 -0600 commented answer Show (Mat) image

Thank you my hero.This part it is not working if ( m.channels() > 1 ) { Imgproc.cvtColor(m,m2,Imgproc.COLOR_BGR2RGB); type = BufferedImage.TYPE_3BYTE_BGR; } i do not know why maybe because of the image type->image = new BufferedImage( 800, 600, BufferedImage.TYPE_INT_ARGB);

2013-10-26 11:51:42 -0600 asked a question Show (Mat) image

In new release OpenCV 2.4.6, how can I display image ( Mat ) on window using JAVA. I couldn't find the JAVA method from API?

2013-10-15 11:30:30 -0600 asked a question calcOpticalFlowFarneback motion depiction

Hello, using the calcOpticalFlowFarneback function i want to show the motion base on the flow matrix output of this function. How can i do this?

Thanks in advance

2013-10-15 10:21:21 -0600 commented question Assertion failed in Video.java class

My hero thank you very much:) it is working:D

2013-10-14 16:07:57 -0600 asked a question Assertion failed in Video.java class

I am running my code : import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.highgui.Highgui; import org.opencv.video.Video;

public class openCvHello { public static void main( String[] args ) { System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); Mat mat = Mat.eye( 600, 800, CvType.CV_8UC1 ); Mat prev=Mat.ones( 800, 600, CvType.CV_8UC1 ); Mat next =Mat.ones( 800, 600, CvType.CV_8UC1 ); Mat flow=Mat.ones( 800, 600, CvType.CV_32FC2);

   String prev_img_path ="C:/Users/user/Desktop/SampleImages/Frame19.tif";
   String next_img_path ="C:/Users/user/Desktop/SampleImages/Frame20.tif";

  File file_prev_img = new File(prev_img_path);

  if (file_prev_img.exists()) { // This is true
          prev = Highgui.imread(file_prev_img.getAbsolutePath());  //file.getPath() also same
         if ( prev.empty() ) 
         { System.out.println( "prev image does not exist!!"); }
     }
  File file_next_img = new File(next_img_path);
  if (file_next_img.exists()) { // This is true
      next = Highgui.imread(file_next_img.getAbsolutePath());  //file.getPath() also same
     if ( next.empty() ) 
     { System.out.println( "next image does not exist!!"); }
 }


   Video.calcOpticalFlowFarneback(prev,next,flow,0.5,1, 1, 1, 7,1.5,Video.OPTFLOW_USE_INITIAL_FLOW );
  System.out.println( "flow = " + flow.dump() );

} } this error occur OpenCV Error: Assertion failed (prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyr_scale < 1) in unknown function, file ......\src\opencv\modules\video\src\optflowgf.cpp, line 579 Exception in thread "main" CvException [org.opencv.core.CvException: ......\src\opencv\modules\video\src\optflowgf.cpp:579: error: (-215) prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyr_scale < 1 ] at org.opencv.video.Video.calcOpticalFlowFarneback_0(Native Method) at org.opencv.video.Video.calcOpticalFlowFarneback(Video.java:293)

I already ask many questions for the calcOpticalFlowFarneback(). I am wondering if you can not help me who i have to ask?

2013-10-14 00:06:09 -0600 commented question Use calcOpticalFlowFarneback java

it seems that the problem is on images! there is any sample that it is working?

2013-10-13 23:59:12 -0600 commented question Use calcOpticalFlowFarneback java

this is my code.. import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.File; import java.net.URL;

import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.highgui.Highgui; import org.opencv.video.Video;

public class openCvHello { public static void main( String[] args ) { System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); Mat mat = Mat.eye( 800, 600, CvType.CV_8UC1 ); Mat prev=Mat.ones( 800, 600, CvType.CV_8UC1 ); Mat next =Mat.ones( 800, 600, CvType.CV_8UC1 ); Mat flow=Mat.ones( 800, 600, CvType.CV_32FC2);

   String prev_img_path ="C:/img19.jpg";
   String next_img_path ="C:/Users/user/Desktop/SampleImages/Frame40.jpg";

  File file_prev_img = new File(prev_img_path);
2013-10-13 23:58:29 -0600 commented question Use calcOpticalFlowFarneback java

I resolve that issue. i am not sure what it was the problem!! Now have this isseu inside the function... OpenCV Error: Assertion failed (prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyr_scale < 1) in unknown function, file ......\src\opencv\modules\video\src\optflowgf.cpp, line 579 Exception in thread "main" CvException [org.opencv.core.CvException: ......\src\opencv\modules\video\src\optflowgf.cpp:579: error: (-215) prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyr_scale < 1 ] at org.opencv.video.Video.calcOpticalFlowFarneback_0(Native Method) at org.opencv.video.Video.calcOpticalFlowFarneback(Video.java:293) at openCvHello.main(openCvHello.java:48)

2013-10-13 12:02:25 -0600 commented question cummon questions for openCv in java-desktop

Can anyone help me!

2013-10-13 12:01:34 -0600 commented question cummon questions for openCv in java-desktop

Finally, the images are not empty but this error appeared: OpenCV Error: Assertion failed (prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyr_scale < 1) in unknown function, file ......\src\opencv\modules\video\src\optflowgf.cpp, line 579 Exception in thread "main" CvException [org.opencv.core.CvException: ......\src\opencv\modules\video\src\optflowgf.cpp:579: error: (-215) prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyr_scale < 1 ] at org.opencv.video.Video.calcOpticalFlowFarneback_0(Native Method) at org.opencv.video.Video.calcOpticalFlowFarneback(Video.java:293) at openCvHello.main(openCvHello.java:48) Video.calcOpticalFlowFarneback(prev,next,flow,0.5,1, 1, 1, 7,1.5 :(

2013-10-13 10:48:16 -0600 commented question cummon questions for openCv in java-desktop

where i have to locate my image to find it? in the src directory?

2013-10-13 09:36:38 -0600 commented question cummon questions for openCv in java-desktop

thanks!! it is empty! :)

2013-10-13 08:17:25 -0600 commented question cummon questions for openCv in java-desktop