Go to Post No! I will not be an enabler for this madness. Go outside. See a movie. Read a book. LIVE!!!! - Herodotus [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-01-2012, 14:51
Bryscus's Avatar
Bryscus Bryscus is offline
EE, CpE
AKA: Bryce B.
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 1999
Location: Jupiter, FL
Posts: 173
Bryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud of
Re: Saving Image from Axis Camera to cRIO

Quote:
Originally Posted by malachias View Post
Your current directory is "/" in the cRIO file system so your filename is relative to the root directory for relative paths. I have only successfully written to the root directory. Not all write operations generate files. Some generate errors that are visible on the Diagnostic screen of the the Driver Station. I am not certain that the first images retrieved from the camera are usable, but then I am still fumbling around.

I open a DOS window and use FTP to retrieve files from the cRIO. I just FTP to the ip address of the robot. "ls" returns a list of files. "get [filename]" retrieves a file to you current home directory. "delete [filename]" removes files. It appears to be a standard FTP implementation so you find documentation on the web.

I put a ".jpg" extension on the file when I write it out ("snapshot.jpg"). I can specify explicitly how to format the file using a specific imaqWrite*File method, so it may not matter except to indicate to Windows the format of the file. I do not know what format file the ImageBase::Write method generates (extension may be significant here).
Malachias,

Thanks for the response. Yeah, I figured it would probably put everything in the root directory. It's good to hear some clarification.

An easier way to FTP to the robot is to type ftp://10.xx.yy.2 into an explorer window in windows (i.e., open up My Computer and enter the address in the address bar - it may have to be added).

With respect to file names, from what I can you if you use imaqWriteFile the extension is significant. It looks like the function parses the extension and then writes the type is parsed. I'll have to try the imaqWrite*File functions as well since they have a few more options.

Again, thanks for your help.

- Bryce
__________________
The opulence of the front office decor varies inversely with the fundamental solvency of the firm.
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2012, 15:25
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Saving Image from Axis Camera to cRIO

We have been using ColorImage::Write.

Something along these lines
Code:
ColorImage img;
camera.getImage(&img);

if(savingInAComplicatedWay)
{
  static int cImages = 0;
  char szSavePoint[200];
  sprintf(szSavePoint, "image%d.jpg",cImages++);
  img.Write(szSavePoint);
}
else
{
  img.write("img.jpg");
}
It ends up as a JPG in the root of the cRio. Then we just use windows explorer and go to ftp://10.te.am.2 to access the saved images and copy them to our PC for more analysis.

My standard disclaimer of "This code is from memory and probably won't compile" applies.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:21.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi