Interestingly, I am trying to figure out what happened to GetHeight() and GetWidth if the camera is not ready. According to the source code:
Code:
/**
* Gets the height of an image.
* @return The height of the image in pixels.
*/
int ImageBase::GetHeight()
{
int height;
imaqGetImageSize(m_imaqImage, NULL, &height);
return height;
}
/**
* Gets the width of an image.
* @return The width of the image in pixels.
*/
int ImageBase::GetWidth()
{
int width;
imaqGetImageSize(m_imaqImage, &width, NULL);
return width;
}
Both height and width are uninitialized local variables and imaqGetImageSize could have failed. Since there is no source code to the nivision module so I can't tell if width and height will be zero initialized and both the GetHeight and GetWidth function do not check the return code of imaqGetImageSize.