Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Saving Photo to Computer from Camera (http://www.chiefdelphi.com/forums/showthread.php?t=101625)

itbmac 31-01-2012 14:29

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

Doc543 31-01-2012 16:14

Re: Saving Photo to Computer from Camera
 
1 Attachment(s)
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

Doc543 31-01-2012 17:58

Re: Saving Photo to Computer from Camera
 
1 Attachment(s)
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.

itbmac 06-02-2012 15:58

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

Tommy F. 06-02-2012 16:19

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?

AndyB871 07-02-2012 09:34

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

Greg McKaskle 07-02-2012 09:44

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

AndyB871 07-02-2012 09:51

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....)

Joe Ross 07-02-2012 12:18

Re: Saving Photo to Computer from Camera
 
The dashboard saves a picture every second, and saves 60 seconds worth of pictures automatically.

androb4 18-03-2012 01:50

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.

Greg McKaskle 18-03-2012 10:48

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

Steve Warner 18-03-2012 12:15

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?

androb4 18-03-2012 19:31

Re: Saving Photo to Computer from Camera
 
Quote:

Originally Posted by Steve Warner (Post 1145581)
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"


All times are GMT -5. The time now is 23:32.

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