|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#7
|
|||
|
|||
|
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 |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|