Vision processing - Not an image error

We’ve had a problem while trying to do some basic vision processing, when we try to get an image then threshold that image, every method we do on the result fails(things we’ve tried: write,getHeight, getWidth, convexHull, particleFilter) and the error we receive:

Unhandled exception: VisionException [ imaqError: -1074396120: Not an image.]

The camera seems to be fine(we can see the image on the dashboard, and when we write the image we get after using getImage() it’s valid) so we’re kinda stuck and don’t know what to do.
We’d love to get some help to solve this :slight_smile:

Here is an example of some code we ran:

package org.usfirst.frc.team2231.robot;

import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.image.BinaryImage;
import edu.wpi.first.wpilibj.image.ColorImage;
import edu.wpi.first.wpilibj.image.NIVisionException;

public class Robot extends SampleRobot {
int session;
Image frame;
ColorImage image;
BinaryImage thresholdImage;
AxisCamera camera;

public void robotInit() {

    // open the camera at the IP address assigned. This is the IP address that the camera
    // can be accessed through the web interface.
    camera = new AxisCamera("");

public void operatorControl() {

    while (isOperatorControl() && isEnabled()) {
        try {
  		image = camera.getImage();
  		thresholdImage = image.thresholdHSL(0, 255, 0, 255, 0, 255);
  	} catch (NIVisionException e) {
  		// TODO Auto-generated catch block

        /** robot code here! **/
        Timer.delay(0.005);		// wait for a motor update time

public void test() {


And the error:

ERROR Unhandled exception: VisionException [ imaqError: -1074396120: Not an image.] at [ Method),, edu.wpi.first.wpilibj.image.BinaryImage.write(, org.usfirst.frc.team2231.robot.Robot.operatorControl(, edu.wpi.first.wpilibj.SampleRobot.startCompetition(, edu.wpi.first.wpilibj.RobotBase.main(]

Have you looked at the 2015 vision examples? They have working examples of thresholding.

I looked at the examples and they worked :slight_smile:
Thanks for the help,
But I was just wondering: the examples use the “”
and in the last years we’ve used “edu.wpi.first.wpilibj.image” - are they not supported anymore?