2017-01-19 18:46:23 -0600 | received badge | ● Editor (source) |
2017-01-19 18:45:49 -0600 | commented question | Java VideoCapture is Open, But Mat.read(frame) is Always false Thanks Caracal! |
2017-01-10 14:02:04 -0600 | asked a question | Java VideoCapture is Open, But Mat.read(frame) is Always false The java code below is supposed to take a snapshot, by reading the from the frame of the connected camera. However, though camera.isOpened is True, the camera.read(frame) is always false. I've followed several walkthrus from stack overflow and posts from here including: waiting for 11s for the VideoCapture camera to open, and inserting camera.read(frame) before the " if(camera.read(frame))" because a post solution was stated the first camera.read(frame) is always false. Because of the code implementation, it loops the if-else block until terminated from the console so the ---Output--- below is the first few loops. Despite that, mine is always false. I added an else block in within the while(true) body, to check if the camera is null, but its not (see Output below). The camera is opencv compatible as well. But nothing so far. Any suggestions help, its a rare case please help. More details are provided at the bottom. Thank you! VidCap isOpened =true Frame Width: 640.0 Frame Height: 480.0 In progress... frame = Mat [ 00CV_8UC1, isCont=false, isSubmat=false, nativeObj=0x26ae6d0, dataAddr=0x0 ] camera.read(frame) = false is camera still open? true Else cont... camera read: false frame = Mat [ 00CV_8UC1, isCont=false, isSubmat=false, nativeObj=0x26ae6d0, dataAddr=0x0 ] camera.read(frame) = false is camera still open? true Else cont... camera read: false ------Sources & Equipment------ *Youtube video of code: How to install OpenCV and use it with Java and configure it with Eclipse ? Taha Emara *OpenCV Intallaion: opencv-java-tutorials.readthedocs.io *Camera from Amazon: ELP Mini Aluminum Black Case Usb Security Camera With 170degree Wide Angle Fisheye Lens And 3Meters USB Cable For Home Security And Machine Vision System *Computer: Windows 10 64bit, 4G RAM =================== |