Recently I bought a LI-LBCM3M1 camera from Leopard Imaging, a module specially designed to work with BeagleBoard.
The module main features are :
- CMOS Sensor MT9T111 from Aptina
- 2048 x 1536 (3M) pixels resolution
- Output Data Format: YUV ( YCbCr)
- Focal Length: f=3.78+ /-0.1 mm, F2.8+ /-5%
- Vertical View Angle : 61.40
- Focus Distance : 120cm +/-2cm
- Focus Range : 60cm to Infinity
Here are some pictures:
The advantage of using this kind of cameras compared to a USB Web-cam is the speed:
The Camera module from LI is directly connected to the Camera Image Signal Processing (ISP) interface on DM3730 (Beagle Board CPU) and thus, data from camera module can be processed much faster than an USB camera.
The other good news is that this camera is supported in the Angstrom Linux Kernel, however only in the 2.6.32 version. The camera patches can be found here.
To enable the camera support you need an U-Boot that contains I2C lines initialisation pull-ups (I’m using u-boot version 2011.09-r4) and include the camera name in the U-Boot environment variables (uEnv.txt) :
camera=lbcm3m1 dvimode="hd720 omapfb.vram=0:8M,1:4M,2:4M" vram=16M console="ttyS2,115200n8"
For the kernel (omap-psp-2.6.32) make sure that the mt9t112 driver module is enabled :
Device Drivers ->
Mutimedia support ->
Video capture adapters ->
Encoders/decoders and other helper chips ->
<M> mt9t112 support
If everything went ok you should see something like that in your kernel traces (dmesg):
mt9t112 2-003c: mt9t111 chip ID 2680
and the /dev/video0 node should also be available.
To get some infos about the camera I’m using :
root@beagleboard:~# v4l2-ctl --all Driver Info: Driver name : omap3 Card type : omap3/mt9t112// Bus info : Driver version: 0 Capabilities : 0x04000001 Video Capture Streaming Format Video Capture: Width/Height : 640/480 Pixel Format : 'YUYV' Field : None Bytes per Line: 1280 Size Image : 614400 Colorspace : JPEG (JFIF/ITU601) Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 640, Height 480 Default : Left 0, Top 0, Width 640, Height 480 Pixel Aspect: 1/1 Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 640, Height 480 Default : Left 0, Top 0, Width 640, Height 480 Pixel Aspect: 1/1 Crop: Left 0, Top 0, Width 640, Height 480 Video input : 0 (camera: ok) Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0
To take the first pictures, I used MPlayer:
mplayer -vf screenshot -fps 15 tv:// -tv driver=v4l2:device=/dev/video0 (and press 'S' to take a snapshot)
To record a video using Mencoder:
mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -nosound -ovc lavc -o video.avi (and press 'CTRL-C' to stop recording)
Hi
Liked your article and I am trying to implement the same configuration that you described using the Leopard board LI-LBCM2M1 and the BeableBoard combination for a hobby project. However I am not able to get the correct kernel patches install to get the camera working. Could you please point me in a direction or give me more details on where you downloaded that patches and how you built the kernel.
Any assistance will be greatly appreciated.
Sincerely,
Hi,
If you’re using Angstrom Linux make sure that your Kernel is from omap git tree :
The omap kernel include support for LI cameras and you’ll not need to patch anything.
I hope it helps.
I want to write some code to take single images under programmatic control. These images then get analysed by an algorithm afterwards. How do I control the camera to capture images without using mplayer?
Hello Pete,
to grab images from the camera you can use the video 4 Linux API (V4L2) just google it you’ll find some examples how to use it.
Hi Zaki,
thank you for nice post. I would like to use LI-M024DUAL from Leopard with BeagleBoard. Do you think that it is possible connect? I foudle, the camera interfaces are more or less same. Is there a source code as well?
i write mplayer command but can not unable to open /dev/video0 . Do you have an idea ?
i cant find the patch ! please tell me correct patch link
Hello, I really like the post… I have a small question.. DO u have any idea of any Leopold imaging camera (that can be used both day and night) which is used in License Plate Recognition, I want to start a new hobby project where I want to create a small setup with Beagleboard and Leopold Imaging Camera for the parking lot in my house.. I just want to create a embeddded ALPR and send a mail to with the car number, time, date…. JUSt for FUn… Hope you got an idea.. DO you guys have any idea about this
So basically you can use any camera that has a Software/Driver support for the BB.
After then you can use any Image processing Software to achieve waht you want like using OpenCV for expl.
Ok Thank you so much…. Ayoub, a small question.. DO you have any camera in mind that can be used both in daylight and night through Leopold Camera interface which can take a picture of a speeding car of about 50kmph..
50kmph will be hard to catch even in daylight ! for that you need for that some high speed professional camera.
I don’t have one in mind.
Hi. I’m trying to interface this camera with my BeagleBoard. I am running Angstrom 2.6.32 so do I need to download the patches you mentioned? Thank you.
Ok so I was able to configure the camera and I got it to start taking pictures. When I put in the command to write videos however it tells me the driver v4lt doesn’t exist. But I am using that driver in the code to take screenshots and it works fine. Do you know what the problem might be? Thanks again.
Hi Ayoub,
Thanks for the post. Just what I was looking for my (yet another) project. Just curious, do the Leopard Imaging daughter boards support beagle headers directly, or did you do a custom work on them? I don’t see any reference to Beagle boards in the company’s website, and so am wondering if there is a simpler way to do (just use the camera and a simple interface module to hook up to the beagle board (I have an older version … rev c)).
do you know if this setup is compaible with deaglebone black or otherwise?
unfortunately the AM335x (BeagleBone / Bone Black) has no Camera IF so this camera is not supported.
isnt there any supported mode?
excellent submit, very informative. I wonder why the opposite experts of this sector do not realize this.
You should continue your writing. I’m sure, you’ve a huge readers’ base already!