Go to Post What is this sleep you all speak of...if it wasn't in the KOP than it is not allowed to be used :D - Wayne Doenges [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-02-2016, 09:33
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,748
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: Help with two USB Cameras on the Dashboard.

Thanks for asking. Here is what I meant.

The attached image shows the part of the Vision Processing block diagram that calls the Background block -- actually it is called the WPI_CameraBackground Loop.vi.
That VI does two background tasks:
1.) For Axis cameras, it reads images as soon as they are available and keeps the last one so that the user code will always be reading the most recent image.
2.) For USB cameras, it serves the images to the dashboard on TCP port 1180.

You have your own image server, and you don't care about the Axis stuff, so you can delete or comment out the Background block and wire up the one you are using that serves two cameras.

The code shown in your attached images looks pretty good, but the compression is basically off. I'll explain more in a sec. With two cameras at 5fps, that is the same as one camera at 10fps with very little compression. From the image, I can't tell what the image size is, so I think the first thing to do is add compression and shrink the image size and test it again.

The server you are using has a T wired to the OpenAndSetMode. This means that the camera itself is doing the compression, and that we have no control on how much to compress. If you set the image size smaller and maybe the fps a to four, I think this will work.

Another approach is to change from camera compressed images to roboRIO compressed images. This involves two edits. The T constant that is wired to the Set Video Mode VI needs to be changed to a false. Next, drop the attached snippet of code somewhere on the edge of your VI. Surround it with the comment block to make it a comment. Notice that one frame of the snippet case structure, the -1 case, looks just like the code you have in your server. It gets the Raw Image Data from the camera and sends it to the dashboard. The other case, the Default one, gets the image and sends that image to the "Flatten Image to String" function telling it to make a JPEG with a compression number that ranges from 0 to 1000.

The default camera server supports both camera compressed and roboRIO compressed, and it uses a compression number of -1 to select camera compressed, and all other numbers mean roboRIO compressed. So if you want to, you can swap out the code in your server with the stuff from the commented snippet. Post the result if you want a review of it.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	From Clipboard.png
Views:	53
Size:	37.5 KB
ID:	20134  Click image for larger version

Name:	Image Server Image.png
Views:	66
Size:	14.7 KB
ID:	20135  
Reply With Quote
Reply


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 20:50.

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