Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Toggle Between Two Cameras in Vision Processing (http://www.chiefdelphi.com/forums/showthread.php?t=133771)

RoboBucs 31-01-2015 13:48

Toggle Between Two Cameras in Vision Processing
 
Hello, I am trying to make it to where I can toggle between two cameras in vision processing, and I tried to toggle between the cameras with a button on the joystick, but it did not work. How would I fix this?



adciv 31-01-2015 21:50

Re: Toggle Between Two Cameras in Vision Processing
 
Are you using Axis cameras or USB cameras?

Greg McKaskle 01-02-2015 10:25

Re: Toggle Between Two Cameras in Vision Processing
 
I'm not saying that this is going to fix everything, but the code is only reading the joystick once, outside the loop.

So move the Get Value inside each loop and at least at that point, you can probe and see that the buttons are working.

Greg McKaskle

RoboBucs 02-02-2015 16:38

Re: Toggle Between Two Cameras in Vision Processing
 
Ok, I am using USB Cameras, and I will try to place the get values into the loop. Thanks you all!

adciv 02-02-2015 16:44

Re: Toggle Between Two Cameras in Vision Processing
 
I'm planning to do this on our robot with USB cameras. My goal is to get the code done by tomorrow evening. If I can get it done, I'll post it.

RoboBucs 02-02-2015 17:11

Re: Toggle Between Two Cameras in Vision Processing
 
Quote:

Originally Posted by adciv (Post 1437400)
I'm planning to do this on our robot with USB cameras. My goal is to get the code done by tomorrow evening. If I can get it done, I'll post it.


That would be great! I'm still actually getting no connection between both cameras at the same time. I also tried to put the values into the loops, and there was still no change. But thank you for your idea. This is what it looks like right now:


Greg McKaskle 02-02-2015 21:24

Re: Toggle Between Two Cameras in Vision Processing
 
As I said, it may not fix all of the issues, but I guarantee that if you do not put the Joystick Get Values inside of each loop, you are only reading them once at the beginning. That is, I assume a part of the bug you are reporting.

Greg McKaskle

RoboBucs 02-02-2015 22:02

Re: Toggle Between Two Cameras in Vision Processing
 
Quote:

Originally Posted by Greg McKaskle (Post 1437483)
As I said, it may not fix all of the issues, but I guarantee that if you do not put the Joystick Get Values inside of each loop, you are only reading them once at the beginning. That is, I assume a part of the bug you are reporting.

Greg McKaskle

Do you know anything else we could do to try to fix that? We tried it with the joystick inside with no results.

Mark McLeod 02-02-2015 22:09

Re: Toggle Between Two Cameras in Vision Processing
 
When toggling, are you by chance expecting the camera image on the Dashboard to change?
It won't, since the Dashboard forwarding is handled in the Camera IP & Dash vi.

Since you aren't doing anything in the Vision Processing loop, you won't see any effect of your joystick button, even if it weren't stuck at the first and only read.

Greg McKaskle 03-02-2015 07:01

Re: Toggle Between Two Cameras in Vision Processing
 
I had a bit more time to look at this.

As Mark mentioned, the actual code for sending USB camera images to the DB is inside of the IP & Dash VI.

What type of cameras do you have? The current WPI VIs are setup to handle one USB camera forwarded to the DB. They don't have a ready mechanism to swap cameras, but it wouldn't be hard to add it.

If one of the cameras were IP, it would be even simpler.

So, what types of cameras do you have?

Greg McKaskle

GrantCrowder 03-02-2015 08:34

Re: Toggle Between Two Cameras in Vision Processing
 
Greg, I'm assuming that this is a boolean function, so I will do some testing today with it. I'm also going to work with the dash vi today, so I will start working with it. Thanks

RoboBucs 03-02-2015 14:13

Re: Toggle Between Two Cameras in Vision Processing
 
Quote:

Originally Posted by Greg McKaskle (Post 1437580)
I had a bit more time to look at this.

As Mark mentioned, the actual code for sending USB camera images to the DB is inside of the IP & Dash VI.

What type of cameras do you have? The current WPI VIs are setup to handle one USB camera forwarded to the DB. They don't have a ready mechanism to swap cameras, but it wouldn't be hard to add it.

If one of the cameras were IP, it would be even simpler.

So, what types of cameras do you have?

Greg McKaskle

They are both usb cameras, I won't know model numbers until I get to the shop today.

RoboBucs 03-02-2015 16:21

Re: Toggle Between Two Cameras in Vision Processing
 
Quote:

Originally Posted by Greg McKaskle (Post 1437580)
I had a bit more time to look at this.

As Mark mentioned, the actual code for sending USB camera images to the DB is inside of the IP & Dash VI.

What type of cameras do you have? The current WPI VIs are setup to handle one USB camera forwarded to the DB. They don't have a ready mechanism to swap cameras, but it wouldn't be hard to add it.

If one of the cameras were IP, it would be even simpler.

So, what types of cameras do you have?

Greg McKaskle

The webcams are Microsoft livecam hd 3000

adciv 03-02-2015 19:11

Re: Toggle Between Two Cameras in Vision Processing
 
1 Attachment(s)
Ok, I hacked this together in about 90 minutes and verified it works with two of our HD-3000 cams. Everything is located in the "Vision Processing.vi". It uses the "DB/Button 1" switch on the dashboard. True will give you one camera, false the other. It only runs in "HW Mode". There is a small switching delay.

*Edit* now with file.

RoboBucs 03-02-2015 20:05

Re: Toggle Between Two Cameras in Vision Processing
 
Quote:

Originally Posted by adciv (Post 1437894)
Ok, I hacked this together in about 90 minutes and verified it works with two of our HD-3000 cams. Everything is located in the "Vision Processing.vi". It uses the "DB/Button 1" switch on the dashboard. True will give you one camera, false the other. It only runs in "HW Mode". There is a small switching delay.

*Edit* now with file.

Thank you so very much!!!


All times are GMT -5. The time now is 03:42.

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