Grip Error!

Please help!! We have been working on vision processing code recently using the generated grip pipeline code and have been running into an error. The error that occurs while trying to process the image is:

ERROR 1 ERROR Unhandled exception: CvException [org.opencv.core.CvException: cv::Exception: /var/lib/jenkins/workspace/OpenCV-roborio/modules/imgproc/src/color.cpp:7943: error: (-215) scn == 3 || scn == 4 in function cvtColor
] at [org.opencv.imgproc.Imgproc.cvtColor_1(Native Method), org.opencv.imgproc.Imgproc.cvtColor(Unknown Source), org.usfirst.frc.team386.robot.GripPipeline.rgbThreshold(GripPipeline.java:131), org.usfirst.frc.team386.robot.GripPipeline.process(GripPipeline.java:57), org.usfirst.frc.team386.robot.Robot.teleopPeriodic(Robot.java:29), edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:130), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:247)] edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:249)

Information that may be helpful:
We are using an USB camera.
We are coding in eclipse.

Any help is useful, thank you so much!

cvtColor only works on 3-channel or 4-channel images (RGB, RGBA). You may be converting a grayscale (1-channel) image.

This happened to us - you have to make sure you are calling the hsv (or hsl, or another cvt-color type method) on an rgb image, as sam said. What we were doing was inadvertently calling the function on the hsv image. Make sure that the mat you are feeding into it is always rgb.