Last year, people had some issues with images that were valid pointers (I think), but had 0 width, and would crash (due to an exception). I used this guard code after getting the image, but before converting to a binaryImage.
Code:
Code:
if ((colorImage == (void *) 0) || (colorImage->GetWidth() == 0) || (colorImage->GetHeight() == 0))
{
return returnVal;
}
Similarly, you should check the binary image after it is created.
My full code is here:
https://github.com/TeamExcel/Project.../Robot2012.cpp
Line 795 has the camera code.
Edit/Delete Message