|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
|||
|
|||
|
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
|
||||
|
||||
|
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?
|
|
#6
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||||
|
||||||
|
Re: Saving Photo to Computer from Camera
The dashboard saves a picture every second, and saves 60 seconds worth of pictures automatically.
|
|
#10
|
||||
|
||||
|
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.
|
|
#11
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: Saving Photo to Computer from Camera
They are saved in "..\My Documents\LabVIEW Data"
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|