Feature #438
Multi-Camera Support (Updated for CCV) extra information
| Status: | New | Start: | 09/18/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | - | Spent time: | - | |
| Target version: | Version 1.3 (Windows - Stable) | |||
Description
People have shown interest in getting this working in windows, so I wrote some info in the forums I thought I'd post here too
There are a bunch of define statements like:
#ifdef TARGET_WIN32
All of the code in these needs to be modified to make sure it plays nicely with multiple camera feeds.
Here are the variables that were added/changed:
addwidth - added, this is the final width of the feeds stuck together (width1 + width2 - overlap)
addheight - added, this is the final height of the feeds stuck together (height1 + height2 - overlap)
numSources - added
bVertical - added, this is the boolean value for whether the 2 feeds are positioned vertically or horizontally with respect to each other
bFlip[] - added, mirror the corresponding sourceImg
MAX_CAMERAS - added, the maximum amount of sources (for initializing the arrays)
sourceImg -> sourceImg[MAX_CAMERAS]
vidGrabber -> vidGrabber[MAX_CAMERAS]
vidPlayer -> vidPlayer[MAX_CAMERAS]
videoFileName -> videoFileName[MAX_CAMERAS]
deviceID -> deviceID[MAX_CAMERAS]
in gui.h I added variable "activeInput" - this stops the app from doing everything when changing sources and changing the size of the processed image. It freezes otherwise.
I hope this helps.
-Dave
I adapted my code as a patch for the new version of CCV. This patch makes it so CCV will work with 2 cameras.
I only got around to testing on my setup which is 2 ps3 eye cameras on OSX. I think this will need to be further developed to run on anything but OSX. I also didn't add support for cameras like the firefly. Firefly or firewire cameras would be better than USB as I am only getting about 25 fps due to the USB bus.
I basically changed all the variables that relate to the camera into arrays, so although right now it's only for 2 cameras, it could be easily adapted to handle more. I changed the config.xml to be set up for this in the future (there's a "NUM_SOURCES" entry etc.)
I also added buttons to the UI to allow for different arrangements and spacings of the cameras.
I'm really new to all this, so to help any other newbs, this is how I applied the patch:
place the patch in the "ccv-read-only" folder
open the terminal and navigate to the directory of the source, for me it's this:
$ cd /Users/dvondle/Desktop/CCV/ccv-read-only
then apply the patch:
$ patch -p0 -i 2camera.patch
History
Updated by Christian Moore over 3 years ago
Really interesting I'll check how hard this will be to get working in Windows (I'll get AlexP to help)
Thanks 10x for this patch looking forward to seeing more progress.
Updated by Christian Moore over 3 years ago
- Target version changed from Version 1.2 (Cross Platform - Stable) to Version 1.3 (Windows - Stable)
