View Single Post
  #9   Spotlight this post!  
Unread 30-01-2012, 14:14
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: How to capture image from Axis 206 and save to cRIO?

I would suggest that you verify a few things. The write-error could be caused by something going wrong prior (upline)...

Are you able to do printf() or use the driver station LCD or SmartDashboard in order to get printouts? If so, then you need to verify a few things

Code:
AxisCamera* pCamera = AxisCamera::GetInstance();
if (pCamera)
{
  ColorImage* pImage = pCamera->GetImage();
  if (pImage)
  {
    if (pImage->GetHeight() == 0 || pImage->GetWidth()==0)
      printf("Error with image size - height/width is zero.\n");
    else
    {
      pImage->Write("Image.jpg");
      printf("Wrote file out to Image.jpg...should be a success.\n");
    }

    delete pImage;
  }
  else
    printf("Image returned by GetImage was NULL. Big error.\n");
}
else
  printf("Never got the camera instance. Big error.\n");
If this runs and says "Wrote file out...." then goto your browser when the robot is in DISABLED mode via ftp://10.te.am.2 and click (hopefully) on Image.jpg and see it.

Let me know where you encounter errors in this process and we'll go from there.

bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote