![]() |
[Snippet] Using 2+ Cameras with minimal bandwidth usage
After messing around with cameras today, I was able to figure out how to use multiple cameras while only using the bandwidth of one. To do such, you simply switch between which feed you are sending back to the driver station with the touch of a button. See the code down below to see how to do this.
Variables needed: Code:
int currSession;Code:
frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);Code:
if(/*button pressing code*/){Code:
NIVision.IMAQdxGrab(currSession, frame, 1); |
Re: [Snippet] Using 2+ Cameras with minimal bandwidth usage
When I put this in my code and deployed it to the robot several errors showed up and the dashboard indicated there was no code.
Where did you put all of these pieces of code in your project? |
Re: [Snippet] Using 2+ Cameras with minimal bandwidth usage
kmodos: thank you very much. works perfectly for us.
has anyone figured out how to open both cameras at once? we would like to open both camera, grab a frame from each, lay them down side by side in a double size frame, and send *that* to the DS. The problem is that IMAQdxConfigureGrab throws an exception if you already have called it with*out* an intervening MAQdxStopAcquisition. |
Re: [Snippet] Using 2+ Cameras with minimal bandwidth usage
Quote:
Quote:
I might look into doing something like this. I have to talk with our drivers to see if this would be something that they want. If I get it working I will post it publicly. |
Re: [Snippet] Using 2+ Cameras with minimal bandwidth usage
Worked like a charm, thanks! For anyone who's having trouble, make sure that all other camera code is removed. We accidentally left some in at first, and the code didn't work correctly.
|
Re: [Snippet] Using 2+ Cameras with minimal bandwidth usage
Quote:
How you mash the two images together I don't know as I have basically zero experience with the NIVision libs. But, roll your own CameraServer, solve the issue of mashing images together into a single JPEG and there you go. |
Re: [Snippet] Using 2+ Cameras with minimal bandwidth usage
Awesome code, this snippet will surely be helpful in the future. Thanks for sharing.
|
Re: [Snippet] Using 2+ Cameras with minimal bandwidth usage
When I use this code my cameras seem to lag, does anyone have complete code that I can use as reference?
|
Re: [Snippet] Using 2+ Cameras with minimal bandwidth usage
Quote:
|
| All times are GMT -5. The time now is 08:06 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi