Aside from posting code, there are some generally good things to do which will also help diagnose...
a) After getting an image from GetImage, check to see if the pointer is non-null.
b) If it's non-null, check that image->GetHeight() and image->GetWidth() are non-zero. I've seen other threads where zero sized images come back if the brightness is zero and things are rather dark.
c) Use GetError() to get the error back from WPILib and validate the reason via Code and Description.
in pseudo-code from the office...
Code:
while (IsOperatorControl())
{
HSLImage* image = camera.GetImage();
if (image)
{
if (image->GetHeight() && image->GetWidth())
{
// Now go forward with using image->Threshold operations
}
else
printf("image has zero width or zero height. Hmm\n");
delete image;
}
else
printf("NULL Image returned. Hmm.\n");
}
bob