How to use USBCamera.getImage()

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{


final static USBCamera usbCam = new USBCamera(“cam1”);/This the correct camera/

public void autonomousInit()
Image frame;

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

You need to call:


Then you can get the image.