Use multiple cameras

Use multiple cameras

Hi, all

maybe this topic is not fresh, but it still bothers me recently. i'm trying to use two cameras(RGB+Depth) together.

I modified the sample code camera_uvmap and Example 92 (Streaming Data from Multiple Cameras) from SDK documentation

// streams is an array of PXCCapture::VideoStream instances from different cameras

PXCSmartArray<PXCImage> images(2);

PXCSmartSPArray sp(2);

 

// initialization

for (i=0;i<2;i++)

   streams[i]->ReadStreamAsync(&images[i],&sp[i]);

 

while (!stop) {

   // which stream is ready?

   sp.SynchronizeEx(&i);

 

   // Check all data-ready streams.

   for (;i<2;i++) {

       if (sp[i]->Synchronize(0)<PXC_STATUS_NO_ERROR) continue;

 

       // images[i] is ready. Do something here.

 

       // read another sample

       streams[i]->ReadStreamAsync(images.ReleaseRef(i),sp.ReleaseRef(i));

   }

}

// wait for any remaining reads

sp.SynchronizeEx();

 

Yet there is a confusing norm i, which doesn't been defined in the while loop. Therefore, i'm still working on it. Is there anyone can give some suggestions? thanks!

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

hi, i have an another problem. when i tried to use the sample application "capture viewer". it couldn't open more than two streams!

For example, i can open one Senz3D camera( RGB+ Depth) or two RGB (from different camera) or two Depth( from two different camera).

However, i can't open two Senz3D camera(2 RGB+2 Depth)... Is that normal? thx...

It was caused by the USB bandwidth issue. Try to connect 2 cameras with different USB port and see if you still have such issue. I can reproduce this issue only IF I connected those two cameras with same USB hub. It will go away if I connected them with different USB port. Thanks!

thanks! the capture viewer works! it seems that even i connect 2 cameras with different USB port on front side mother board, it will still have the USB bandwidth issue. After i change one camera to back side usb port, 2 cameras(2RGB+2depth) finally works together. 

 

Glad to know it works for you. The capture_viewer is a good sample to look at. 

Leave a Comment

Please sign in to add a comment. Not a member? Join today