Log in

View Full Version : How to use USBCamera.getImage()


Adamd51
20-04-2016, 13:51
I am trying to obtain the image from the camera for vision processing and assign it to an instance of Image. Whenever I do I get error code "-1074397163: Image Acquisition Not In Progress". I have removed everything from the code that might be interfering and have come up with the following code which still creates the error. What am I missing? Am I doing something wrong? Thank you.

public class Robot extends IterativeRobot{

//imports

final static USBCamera usbCam = new USBCamera("cam1");/*This the correct camera*/

public void autonomousInit()
{
Image frame;
Robot.usbCam.getImage(frame);
}
}

(That is all the code, I have not omitted anything)

Skragnoth
20-04-2016, 15:06
You need to call:

usbCam.startCapture();

Then you can get the image.