Stitching together 2 cameras
Alan Hewat from France  [4 posts]
15 year
Every few months I come back to this, since I feel that stitching together multiple images would be a great way to increase field of view, resolution or efficiency using small inexpensive CCD cameras. I found that ImageJ has a powerful stitching plugin, but is complicated to use with cheap webcams.

RoboRealm can do it with a Display-Image of the 1st camera followed by a translation allowing the image size to increase as required, then a Display_Image of the 2nd camera (stitch2.robo enclosed). Unfortunately I had to add a Shift as well, because Translate doesn't seem to quite work in 2D under these conditions, and gets confused unless the cameras are in the "right" order (a minor bug?). And I had to correct for the different camera intensities.

Then RR uses 75% of the CPU to display the two overlapping images (not really stitched) and just hangs if I try to Snap/Save this enlarged image. I tried reducing the frame rate to 5 Hz, but that didn't help. If I reduced the image size of the cameras from 640x480 to the minimum 160x120 the CPU use decreased to ~50% and I could save the overlapped image, but such a small image defeats my original purpose. I can't see that any of these display, translate or intensity operations should use much CPU, so I guess/hope it might be a bug ?

I know that this is not really the intended use of RR, but it is such a nice application (in its simplest form) that I keep coming back to it, knowing that I really don't understand all of its possibilities, and hoping that I'll finally work it out :-)

Anonymous 15 year

We tried your included robofile and don't see the slowdown that you are mentioning. can you check on your computer what timing shows in the pipeline? Its those gray numbers on the right side of the pipline display. They should tell you which module is causing the slowdown.

Also note that it might be the camera image acquisition speed too as two images mean a lot more info than one. Can you try disabling one or more of the modules to see which one is causing the issue?

Anonymous 15 year
Thanks STeven. Perhaps I just need a new computer.  (I am using an Athlon-64 3000+ 2.01GHz with 1GB RAM, getting a bit old now, like me).

As soon as I use two cameras, CPU usage goes to ~75% but I can now snap and save the stitched image even with both cameras at 640x480 if I am patient (enclosed, without care to set up the Philips SPC900NC/00 webcams precisely). CPU usage decreases a little if I reduce the size of the images, but doesn't change (?) if I reduce the frame rates from 25 to 5 Hz (As you suggest, camera acquisition speed might be expected to be important).

Pipeline timing shows 00.001, 00.007, 00.002, 00.002, 00.001, 0.010 for Display_Image 1, Intensity, Translate, Shift Down, Display_Image 2, Intensity respectively.

Attempting to change the video format while both cameras are active can cause RR to hang, and perhaps that was why I couldn't save the snapshot at my previous attempt.

So, it does work. Perhaps my problems were due to a slow computer and my difficulty in understanding how to set it up.


Anonymous 15 year

Yes, it sounds like you probably have a bus speed issue as none of those pipeline times seem long. Most likely it is a data transfer speed issue. A newer machine would probably solve those problems.

Also try adding the Color_Balance module (with Intensity adjustment on) to each image before stitching together as that will merge the colors better between the two images.

Alan Hewat from France  [4 posts] 15 year
Thanks again STeven. Yes I do need a new computer :-)

But I wonder if RR is not always processing at 30 Hz even when the frame rate is set to the minimum 5 ? I didn't see any CPU usage change when I lowered the frame-rate. (Actually 1 Hz processing would be enough for my application).
Anonymous 15 year

Ensure that you pressed 'OK' on the options page as it does not take into effect immediately like the modules do. I just tested this on another very taxing module and it does reduce the CPU when the processing speed is lowered. It doesn't if you just change the preview speed so check that the second one is around 5 fps.

It may also be that RR is not the cause of the slowdown ... again, it might be your CPU curring on getting the image. Have you updated to the latest DirectX version (its a huge download so watch out!)?


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index