openCV not working with Mac iSight camera

Hi all,

So finally got MRL working on my Mac and the services installing correctly (where do they install exaclty on the local drive?)

I am using build 1695 as the more recent builds error out on the Mac

But now openCV does not seem to be working with my Mac's built in camera (iSight). I set it up so that its Camera=0 and input=OpenCV but when I click capture, the webcam light goes on for a second but then goes off, and nothing loads. All I see is the MRL robot logo in the view area. 

The commandline output just says:

Cleaned up camera.

Has anyone else had success in getting MRL and openCV to work with Mac iSight camera?


GroG's picture

The most mac experienced

The most mac experienced person here I think is kmcgerald: ..  you might want to ask him.  1695 is dead to us...  we don't even acknowledge its presence ...  Gael does but but he's very nostolgic.  I think as soon as we get kinect working, he'll drop it like a hot brick.

What to do ?

Ask kmc about if he got the isight to work. Hopefully, he'll see this post.

Also, be patient and wait for a new mrl zip ...  I got to bundle correctly, and put it somewhere..

kmcgerald's picture

Need a bit more info.

Can you tell me what version of OS X you are running?  You mention built in iSight camera so I'm guessing that you have a MacBook and are trying to use the camera in the screen.

I have tried to use OpenCV (inside and outside) on both 10.7 (Lion) and 10.8 (Mt. Lion).  On 10.7 I had problems with using actual cameras attached to the machine with the same kind of behavior you're describing. The light goes on for a second and then goes off.  When I was testing the command line OpenCV tools on 10.7 I got an error but I forget what it said.  I have successfully run OpenCV in MRL on my MacBook running 10.8 with both the built in iSight HD (it's actually on the USB bus) and with two different MS Lifecam USB cameras. 

If you are on 10.7, you can use OpenCV but you'll only be able to process a recorded video file (not much fun) or a stream from an IP Camera like a Foscam.  Something is broken in OpenCV on 10.7 when it comes to capturing from a USB camera and it has nothing to do with MRL. I compiled OpenCV on a 10.7 machine and it still didn't work.

If you are running 10.9 (Mavericks) I can't help much since I haven't upgraded either of my Macs to that.

You're other question about where things get installed is simple. MRL is self contained and does not put things out on the system.  Everything stays withing the folder you unzipped MRL into. Some of the files are in a hidden folder ( .myrobotlab ) inside the main one but the jars for the various services get put in the libraries folder tree.  Grog knows the most about where MRL puts things.

kommi10's picture

Hey Kmcgerald,Yeap, running

Hey Kmcgerald,

Yeap, running 10.9 Mavericks, and trying to use the built in iSight camera. Also tried a USB MS lifecam, but I could not even get that to function properly with macam on Mavericks

I am able to use the iSight camera and capture input when coding with the openCV library directly. This code below works and captures what the iSight sees.


import org.opencv.core.*;

import org.opencv.highgui.Highgui;        

import org.opencv.highgui.VideoCapture;        


public class VideoCap {

    public static void main (String args[]){



    VideoCapture camera = new VideoCapture(0);





    else {

    Mat frame = new Mat();


        if ({

        System.out.println("Frame Obtained");

        System.out.println("Captured Frame Width "

        frame.width() + " Height " + frame.height());

        Highgui.imwrite("camera.jpg", frame);










kmcgerald's picture

command line tools

The command line tools I was talking about were the examples that compiled with OpenCV.  I have a copy of 2.4.7 on my 10.7.5 box and it has a bunch of examples in the bin directory, one which we like to use as a test is cpp-example-lkdemo.


I can get 2.4.7 to work with the lifecam on my 10.7.5 Mac but I couldn't get MRL OpenCV to work which is  MRL uses JavaCV as a wrapper for OpenCV so the two have to be upgraded together. Grog was using the OpenCV binaries that JavaCV provides in order to avoid the pain of compiling for so many platforms.  I think I tried getting OpenCV to work on my 10.7 box and didn't have any luck.

kommi10's picture

Hey Kmcgerald thanks for the

Hey Kmcgerald thanks for the reply. I think I am a the same point with not being able to get javaCV and openCV2.4.6 to work on my Mac. 

I have an update in another thread with GroG, if you dont mind taking a look.



GroG's picture

Gah .. mebbe it's time to

Gah .. mebbe it's time to move to OpenCV 2.4.7 :P  NEED MORE ELVES !