Ask Your Question

Revision history [back]

:load a file video from path

Hello,I have a problem: load a file video from path with openCV; with webcam all right..with path bad ...don't work ;( this is my code: help me... premetto che con lacquisizione video non ho nessun problema, il problema si pone quando devo caricare un video da locale...ecco il codice

import org.opencv.core.*; import org.opencv.highgui.Highgui; import org.opencv.highgui.VideoCapture;

public class VideoCaptureFile {

public static void main (String args[]){

System.loadLibrary(Core.NATIVE_LIBRARY_NAME); VideoCapture camera = new VideoCapture("C://video.avi");

if(!camera.isOpened()){ System.out.println("Error"); }

Mat frame = new Mat(); while(true){ if (camera.read(frame)){ System.out.println("Frame Obtained"); System.out.println("Captured Frame Width " + frame.width() + " Height " + frame.height()); Highgui.imwrite("camera.jpg", frame);
System.out.println("OK"); break; } } camera.release(); } }

OUTPUT :error

click to hide/show revision 2
retagged

updated 2014-03-04 03:30:41 -0600

berak gravatar image

:load a file video from path

Hello,I have a problem: load a file video from path with openCV; with webcam all right..with path bad ...don't work ;( this is my code: help me... premetto che con lacquisizione video non ho nessun problema, il problema si pone quando devo caricare un video da locale...ecco il codice

import org.opencv.core.*; import org.opencv.highgui.Highgui; import org.opencv.highgui.VideoCapture;

public class VideoCaptureFile {

public static void main (String args[]){

System.loadLibrary(Core.NATIVE_LIBRARY_NAME); VideoCapture camera = new VideoCapture("C://video.avi");

if(!camera.isOpened()){ System.out.println("Error"); }

Mat frame = new Mat(); while(true){ if (camera.read(frame)){ System.out.println("Frame Obtained"); System.out.println("Captured Frame Width " + frame.width() + " Height " + frame.height()); Highgui.imwrite("camera.jpg", frame);
System.out.println("OK"); break; } } camera.release(); } }

OUTPUT :error

click to hide/show revision 3
No.3 Revision

updated 2014-03-04 03:31:37 -0600

berak gravatar image

:load a file video from path

Hello,I have a problem: load a file video from path with openCV; with webcam all right..with path bad ...don't work ;( this is my code: help me... premetto che con lacquisizione video non ho nessun problema, il problema si pone quando devo caricare un video da locale...ecco il codice

import org.opencv.core.*;
import org.opencv.highgui.Highgui;
import org.opencv.highgui.VideoCapture; 

public class VideoCaptureFile {

{ public static void main (String args[]){

args[]){ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); VideoCapture camera = new VideoCapture("C://video.avi");

VideoCapture("C://video.avi"); if(!camera.isOpened()){ System.out.println("Error"); }

Mat frame = new Mat(); while(true){ if (camera.read(frame)){ System.out.println("Frame Obtained"); System.out.println("Captured Frame Width " + frame.width() + " Height " + frame.height()); Highgui.imwrite("camera.jpg", frame);
System.out.println("OK"); break; } } camera.release(); } }

}

OUTPUT :error

click to hide/show revision 4
No.4 Revision

updated 2014-03-04 03:34:14 -0600

berak gravatar image

:load load a file video from path

Hello,I have a problem: load a file video from path with openCV; with webcam all right..with path bad ...don't work ;( this is my code: help me... premetto che con lacquisizione video non ho nessun problema, il problema si pone quando devo caricare un video da locale...ecco il codice

import org.opencv.core.*;
import org.opencv.highgui.Highgui; 
import org.opencv.highgui.VideoCapture; 

public class VideoCaptureFile {

public static void main (String args[]){

 System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
 VideoCapture camera = new VideoCapture("C://video.avi");

if(!camera.isOpened()){
   System.out.println("Error");
  } 

  Mat frame = new Mat();
  while(true){
    if (camera.read(frame)){ 
       System.out.println("Frame Obtained");
       System.out.println("Captured Frame Width " + 
       frame.width() + " Height " + frame.height());
       Highgui.imwrite("camera.jpg", frame);    
       System.out.println("OK");
       break;
      } 
    } 
 camera.release();
   }
  }

OUTPUT :error