Capture from CMOS camera

Thanapat
Dear All

I try to use CAM130 to capture image, but I've some problem.

My room is very low-light so I must use long-exposure time.

Please introduce me how to program for control exposure time.

And how maximum long exposure time?

Than you/Regards

Thanapat

Paul
Hi Thanapat,
Depends if you're using linux or windows.

I've been working on the camera in linux and you need to do some things:

You need to make the s3c2440camera.ko driver in your linux kernel a module
rather than built in.
 To do this, you need to download the kernel from this website, and in a
terminal (with a PATH pointing to the arm compiler) type
 ./configure
 make menuconfig

This will allow you to reconfigure the kernel. Go to
Device Drivers->Multimedia Support

Change the [*] next to OV9650 on the S3C2440 driver to an [M]
This way we can change the driver and not have to recompile the kernel.

Now make the kernel
 make

Wait for a while, then move the kernel to your mini2440. I won't explain
how here.

Now, you need to work on the driver to change the camera settings.
The easiest way is to use the kernel makefile to build it.

Go to the folder where you untarred the kernel and go to:
 <kernel>/linux-2.6.32.2/drivers/media/video

The files that make up the driver are:
 s3c2440_ov9650.c
 s3c2440camif.c
 s3c2440camif.h
 sccb.c
 sccb.h

Read the OV9650 datasheet (I think its on this site)
and you can change whatever you want.

When you're done changing, GO BACK TO THE FOLDER WHERE YOU COMPILED YOUR
KERNEL and type
 make

Then look for the file 
 <kernel>/linux-2.6.32.2/drivers/media/video/s3c2440camera.ko

Copy it to your fs (say to /), switch on the mini2440, and load the driver
with
insmod /s3c2440camera.ko

And you're rolling!! Enjoy :)
 file in

Thanapat
Dear Paul

Thank you so much for your support (I'm sorry to reply late).

Your information is very helpful to me.

But I've some question, please answer to me.

In data sheet I found Maximum exposure time = 1024*t_row.

What is it mean??

Thank you/Regards

Thanapat

Vladimir Fonov
Hello,

As far as I understand it means that maximum exposure time for the frame is
1024 x time it takes to transfer one line. The time it takes to expose one
line depends on the current resolution and the current pixel clock. 

By the way, in my vesion of s3c2440camera driver you can control this
parameter using v4l API : http://code.google.com/p/s3c2440camera/ 

Unfortunately I didn't make the code to change the pixel clock according to
desired exposure time yet.

Thanapat
Dear,

Thank you for your information :)

In your answering it means I cann't control exposure time(Speed shutter)?

I want to control speed shutter to 30 sec, 1 min and 3 min. 

Can I do that ?

Thank you/Regards

Thanapat

Vladimir Fonov
According to OV9650 application note (found online) the maximum exposure
time this chip can achieve in SXGA mode (1024x768) is 1048*Tline where
Tline - is time it takes to transfer one row. For this mode Tline=1520*Tclk
, where Tclk=1/Fclk is pixel clock. Fclk may be 24Mhz devided by a factor
from 1 to 64. So, the longest possible exposure time would be 
1048*1520*64/24'000'000 which is 4 sec, and it is going to be very noisy, I
think.

Thanapat
Dear Vladimir

Thank you for answer :)

But it a bad news for me :( My object is very low-light.

I can't see anything with 4 sec. exposure time (I test 

with CANON camera, I must use more than 3 min.)

So I must try to use other method.

If you have any idea, please introduce me.

Thank you

Thanapat

Vladimir Fonov
Hello,

technically exposure time depends on the aperture you set on your lens and
gain of the matrix (i.e ISO grading).

A general thought , though, is that the simplest solution would be to
remotely control your Canon camera through USB, something like this:
http://www.linux.com/archive/feature/137104 

If you absolutely need to use CAM130, then you might try to set gain to
high value so, that, you get something from 4sec exposure and then average
through a hundreds of frames.

Thanapat
Hi 

Thank you very much 

Your answer is helpful for me.

Regards

Thanapat

nanas
Dear all,

I've used the CAM130 in my mini2440 project for 1 year. But I still use the
default picture format, that is RGB 565. Can I change the picture format to
other type, for example YUV?

thanks

gonzalop
Thanapat: you could also use infrared lighting to light up the room, which
is (probably) visible to the camera, but the human eye can't see it. But
it's maybe not so nice if your'e going to be in the room yourself, it's
maybe not so good to constantly look into the IR light. You can try with a
normal remote controller and see if the cam sees it.

Vladimir Fonov
>nanas 

Hello,

you can if you use my custom driver for CAM130:
http://code.google.com/p/s3c2440camera/ it captures frames in YUV422p. 

But you would need to compile a kernel without standard CAM130 driver or
get one from  here: http://code.google.com/p/s3c2440camera/downloads/list

Thanapat
>>gonzalop

Thank ;)

Frank
Hi,

as far as I can see you driver is made for kernal 2.6.29.4.
I'm using a 2.6.32.2 here, and I would like to keep it. 
Do you see any chance to release your driver sources, or could you compile
it for a 2.6.32.2 kernel? 

Thank's 

Frank

Chetan
Hello,

I want to interface CAM130 with FPGA.

Where can I get the details about the configuration registers for it?

Regards,

Chetan

Marcio Lima
Hi

Does anybody know about a wide angle lens for the CAM130 ? Did anybody
tried to adpapt another lens on top of the one already installed ?

user
infrared on this camera module is not supported.
the maximum for the OV9650 is about 650nm and IR leds start at 850nm.
i've done that test and it does not work.

more info can be found in the datasheet:
http://www.techtoys.com.hk/Components/OV9650_MOD/OV9650_brief.pdf

best regards.

Pushkar Vaidya
Hello All
I am new to this. As a project i want to access Cmos Camera in Wince using
MS Visual Studio C#. Right now i am stuck with IODeviceControl.dll...
Please Help me....:)

Pushkar Vaidya
Hello All
I am new in this. As a final Year Project I want to interface CMOS Camera
in Wince using Microsoft Visual Studio - C#.net. Now i am stuck with
iodevicecontrol.dll.... I have no idea about camera drivers in wince

Please Help...
It's high time for me