Ask Your Question

CMU1394 from cv2 python binding?

asked 2013-02-17 04:30:50 -0500

otterb gravatar image

updated 2013-02-21 07:54:10 -0500

Hi there,

I have a firewire camera that works fine with the CMU1394 demo software on Windows and want to use it from python cv2.CaptureVideo. I guess the release versions till 2.4.3 do not support CMU1394. I get CaptureVideo(0).isOpened() -> False.

My question is if I build with proper CMake options and/or _highgui.h setting, would I be able to use CMU from python? If so, how exactly should I go about?

I've read: C/C+ example for frame acquision with CMU and _highgui.h modification to enable CMU. But, I cannot even find _highgui.h in git head version. Does it still exist?

I also found this in the latest CMakeLists.txt: OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (UNIX AND NOT ANDROID AND NOT IOS AND NOT CARMA) ) Does this mean IEEE1394 is supported only in Linux now?

PS I could somehow compile the opencv source on Windows but this did not give me what i wanted.

PS Thanks to motmot project, I could use libcamiface and its python binding and get the frame as numpy array, plug that into cv2 for displaying and saving as avi.

But, I am still interested to know if there is CMU or DirectShow option with cv2 python binding.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-02-22 04:34:25 -0500

berak gravatar image

updated 2013-02-22 04:41:42 -0500

apart from the question if cmu support was builtin with your current libraries, it's probably only a matter of supplying the right constant to the VideoCapture constructor, or the open method of that.

in c++, it works like this:

VideoCapture cap(0); // takes 1st cam. on win, that would be using vfw, the default

VideoCapture cap(CV_CAP_DSHOW + 0); // takes 1st cam but tries to use the directshow path
VideoCapture cap(CV_CAP_OPENNI_ASUS + 1); // get the 2nd asus depth sensor, for a change ;)

// lacking hardware, i can't test, but i bet cmu goes like this: 
VideoCapture cap(CV_CAP_CMU1394 + 0); // CV_CAP_FIREWARE, CV_CAP_IEEE1394 should work, too, boils down to the same enum.

those consts are in highgui_c.h, l 279 and down. i'm unsure how to access them from python, maybe its, but no idea here

edit flag offensive delete link more


Thanks a lot for your suggestion. I checked all the constants under cv2 and but no luck. It seems none of these are exposed to python. I will see if manually putting the constants in highgui_c.h work or not.

otterb gravatar imageotterb ( 2013-02-22 12:30:48 -0500 )edit

scanned the constant range from 0 to 10000 by [n for n in range(10000) if cv2.VideoCapture(n).isOpened()] and got no luck. Tested with ver 2.4.2.

otterb gravatar imageotterb ( 2013-02-23 09:30:11 -0500 )edit

CV_CAP_CMU1394 is 300, next entry is 400, so 100 would have been enough :)

2.4.2 , and on win here, too. restarted cmake-gui, to see if it shows anything, but no option for cmu there.

cerr << cv::getBuildInformation() << endl; showed that i had ximea disabled, but again nothing about cmu

your first thought might have been right, 2.4.2 only supports it for linux

so, wait a few days, until 2.4.4 gets stable, and update ?

good luck!

berak gravatar imageberak ( 2013-02-23 09:48:24 -0500 )edit

@berak thank for the pointer to cv::getBuildInformation(). In python, I did cv2.getBuildInformation() with 2.4.4beta and 2.4.3, and they have nothing about CMU but DirectShow: YES. I guess I should check if the camera manufacture provided a DirectShow driver or filter. In fact, their SDK mentions about a filter and I did install the registry entries for them by following the installation guide. But, so far no luck.

otterb gravatar imageotterb ( 2013-02-24 04:40:21 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-02-17 04:30:50 -0500

Seen: 977 times

Last updated: Feb 22 '13