Go to Post Don't be too arrogant as to think that just because you didn't invent it, it is not useful. - ptan [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2012, 14:29
itbmac itbmac is offline
itbmac
AKA: MacKenzie Bates
FRC #4142 (Shorebots)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Avon Lake
Posts: 6
itbmac is an unknown quantity at this point
Exclamation Saving Photo to Computer from Camera

We are trying to save a photograph from the camera while it is connected to the robot. We want this image so that we can add image masks and ultimately detect the Retro-Reflective tape.

Here is 2 different ways we have tried coding it but neither work.

https://3487422552756459162-a-180274...tr edirects=0

https://3487422552756459162-a-180274...attredirects=0
  #2   Spotlight this post!  
Unread 31-01-2012, 16:14
Doc543's Avatar
Doc543 Doc543 is offline
Electrical, Pneumatics, Driver
AKA: Eric
FRC #1891 (BullBots)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Meridian Idaho
Posts: 63
Doc543 is an unknown quantity at this point
Re: Saving Photo to Computer from Camera

I got out dashbord to save images, and video! I'll upload the later code so you guys can take things form it. Here is a picture for now
Attached Images
File Type: bmp derp.bmp (654.8 KB, 107 views)
__________________

"Its just a prototype."
2011 Chairman's Award Utah Regional
2010 Gracious Perfectionism Utah Regional
2009 Gracious Perfectionism Portland Regional
  #3   Spotlight this post!  
Unread 31-01-2012, 17:58
Doc543's Avatar
Doc543 Doc543 is offline
Electrical, Pneumatics, Driver
AKA: Eric
FRC #1891 (BullBots)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Meridian Idaho
Posts: 63
Doc543 is an unknown quantity at this point
Re: Saving Photo to Computer from Camera

OK here it is! There is a Library for USB cameras you can get. Its is really good for testing camera code, that is what i used to make this.
Attached Files
File Type: vi TakePicRecVideo.vi (61.4 KB, 36 views)
__________________

"Its just a prototype."
2011 Chairman's Award Utah Regional
2010 Gracious Perfectionism Utah Regional
2009 Gracious Perfectionism Portland Regional
  #4   Spotlight this post!  
Unread 06-02-2012, 15:58
itbmac itbmac is offline
itbmac
AKA: MacKenzie Bates
FRC #4142 (Shorebots)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Avon Lake
Posts: 6
itbmac is an unknown quantity at this point
When I run it this error comes up:

IMAQ AVI Write Frame loaded with errors on the target and was closed.ct function name.
Deployment complete with errors.

And the picture doesn't save

Sent from my SGH-i917 using Board Express
  #5   Spotlight this post!  
Unread 06-02-2012, 16:19
Tommy F.'s Avatar
Tommy F. Tommy F. is offline
Yeah! Collages!
AKA: 7h0m45
FRC #1985 (Robohawks)
Team Role: Alumni
 
Join Date: Mar 2011
Rookie Year: 2010
Location: St. Louis, MO
Posts: 188
Tommy F. is just really niceTommy F. is just really niceTommy F. is just really niceTommy F. is just really nice
Re: Saving Photo to Computer from Camera

Can't you save an image while the camera footage is on the driver station by right clicking over the feed?
__________________

FTC 289, 290 & 291 :: FRC 1985

2013 St. Louis Regional Semi-Finalist (with 3411 and 4330), Industrial Design Award
2013 Queen City Regional Winner (with 379 and 447)

  #6   Spotlight this post!  
Unread 07-02-2012, 09:34
AndyB871 AndyB871 is offline
Registered User
FRC #0871
 
Join Date: Jan 2012
Location: East Islip
Posts: 37
AndyB871 has a spectacular aura aboutAndyB871 has a spectacular aura aboutAndyB871 has a spectacular aura about
Re: Saving Photo to Computer from Camera

I'm making some basic assumptions here:
1) You're using the Axis camera
2) you're using the 8 port cRIO
3) You want to get the image from the axis to the PC to do your processing.

When we first started we were having major issues with getting images from the camera, through the cRIO to the PC. It turned out that in vision_processing.vi there is a little brick that kicks off "Mjpeg loop". That VI is responsible for retrieving and queuing images from the camera locally on the cRIO. That's all well and good, but since the cRIO is in between the camera and the PC you need to actively transmit the camera data to the PC. In the WPI library somewhere ( I'm at work, and i cant remember the path in the little icon book thingie) There's a loop called "Send2PC" You need to kick that loop off in parallel with Mjpeg loop in order to have the robot send the images to the PC.

Now, If any of my assumptions are wrong, then I feel rather silly for explaining so much lol. I Hope this is helpful.

-Andy
  #7   Spotlight this post!  
Unread 07-02-2012, 09:44
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Saving Photo to Computer from Camera

Andy, your explanation of how to send to PC is spot on assuming the camera is connected to the 2nd port of the 8 slot cRIO. The other way of doing this, which will improve performance of the vision and lower CPU usage on the cRIO is to connect the camera to the drink switch. At that point, the IPs change, no Send2PC is needed, and the dashboard and other computer programs ( even Vision Assistant and the web browser) can see the camera.

Greg McKaskle
  #8   Spotlight this post!  
Unread 07-02-2012, 09:51
AndyB871 AndyB871 is offline
Registered User
FRC #0871
 
Join Date: Jan 2012
Location: East Islip
Posts: 37
AndyB871 has a spectacular aura aboutAndyB871 has a spectacular aura aboutAndyB871 has a spectacular aura about
Re: Saving Photo to Computer from Camera

Greg,
Im guessing Drink -> dlink. And yeah, I kind of figured that that was the better way to do it. I just kept it that way to make a nice challenge for my programming team. In the end, though, like you said, we'll probably end up with the camera connected to the dlink.

As a side note, we only measured ~3-5% drop in CPU usage on the cRIO when we turned off the camera acquisition stuff, and with a short delay to stop the teleop loop from eating all of the free CPU time our CPU hangs around 80-90% which leaves plenty of time for other stuff to happen (except onboard video processing which we discovered the hard way via a psychotic runaway robot. Yeah..... safety....)
  #9   Spotlight this post!  
Unread 07-02-2012, 12:18
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,586
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Saving Photo to Computer from Camera

The dashboard saves a picture every second, and saves 60 seconds worth of pictures automatically.
  #10   Spotlight this post!  
Unread 18-03-2012, 01:50
androb4's Avatar
androb4 androb4 is offline
..is trying to take this year off.
AKA: Andrew A.
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2003
Location: Houston, TX
Posts: 220
androb4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to behold
Re: Saving Photo to Computer from Camera

It plays back at 2x speed because you added a constant of 15 frames a second of Playback speed, and the default is 30.
__________________
FRC 441 Mentor 2012-2015
FRC 441 Alumni 2009-2012
FTC 4673 Alumni 2011-2012
FRC 1484 Alumni 2006-2008

  #11   Spotlight this post!  
Unread 18-03-2012, 10:48
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Saving Photo to Computer from Camera

By the way, I recently used the AVI VIs to save off a movie related to robotics, and it is pretty straightforward. One oddity is that the file must have an avi extension and it only works for 8 bit and RGB image types. If your DS computer isn't fully loaded, you may find it intersting to save off videos of the camera with ringlight. I'd be interested in different ones to learn how much the shooter motors vibrate the camera, how close other field elements appear, etc. I have some photos I took of WPI that I'll post showing how lights and other elements look a bit like the goals.

The AVI api can also be used to playback the video through your processing code to learn when it missed a target or saw a false target. Again, if you aren't going to do this with your robot movies, I'd like to.

Greg McKaskle
  #12   Spotlight this post!  
Unread 18-03-2012, 12:15
Steve Warner Steve Warner is offline
Controls / Programming
FRC #0234 (Cyber Blue)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Indiana
Posts: 43
Steve Warner is an unknown quantity at this point
Re: Saving Photo to Computer from Camera

Joe, this weekend we looked on the classmate for the images saved by the dashboard but could not find them. Do you know where they are stored? Are they saved by the default dashboard?
  #13   Spotlight this post!  
Unread 18-03-2012, 19:31
androb4's Avatar
androb4 androb4 is offline
..is trying to take this year off.
AKA: Andrew A.
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2003
Location: Houston, TX
Posts: 220
androb4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to behold
Re: Saving Photo to Computer from Camera

Quote:
Originally Posted by Steve Warner View Post
Joe, this weekend we looked on the classmate for the images saved by the dashboard but could not find them. Do you know where they are stored? Are they saved by the default dashboard?
They are saved in "..\My Documents\LabVIEW Data"
__________________
FRC 441 Mentor 2012-2015
FRC 441 Alumni 2009-2012
FTC 4673 Alumni 2011-2012
FRC 1484 Alumni 2006-2008

Closed Thread


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 18:55.

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