View Single Post
  #6   Spotlight this post!  
Unread 03-02-2012, 14:18
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: ImaqThreshold error

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.
__________________
Reply With Quote