i trying use opencv load video file in java using netbeans. know way of doing it? can't find solutions searching online.
you need add c:\opencv\build\x86\vc11\bin path variable... , write:
private void mymethod(...) { mat frame = new mat(); videocapture camera = new videocapture("c:/myname/mypc/desktop/thelordoftherings.mp4"); jframe jframe = new jframe("mytitle"); jframe.setdefaultcloseoperation(jframe.exit_on_close); jlabel vidpanel = new jlabel(); jframe.setcontentpane(vidpanel); jframe.setvisible(true); while (true) { if (camera.read(frame)) { imageicon image = new imageicon(mat2bufferedimage(frame)); vidpanel.seticon(image); vidpanel.repaint(); } } }
Comments
Post a Comment