I would like to get the datasheet of OV2311 MIPI Camera for RPI.
There’s a question I would like to ask too: would it be possible to set a longer exposure time? Right now the exposure time is around 1 second when the value is set to 65535. I would like to expose for around 5 seconds. Would it be possible?
If yes, Could you provide a pointer as to how I could do that?
Meanwhile, may I know which mode produces 10-bit images? I saw “raw10” in mode 10 but I couldn’t perform any video recording nor still capture when this mode’s set on.
The theoretical value of OV2311 exposure time can reach 5s.
The exposure time setting registers are shown below.
The setting value of exposure time value indicates the number of lines for the exposure time. The duration of one line is decided by number of Logic Clock per line and designated by line_length pck register. It can be converted into time (sec) by Formula.
Tline = hts/ pixclk.
Please refer to page 34 of the datasheet for the calculation method of pixclk.
The range of hts and vts is referenced as follows:
exposure time = Tline * (the data of EXPO register)
Mode10 is used for external trigger mode, only the input of external trigger signal will output the image. Mode6 is 2lane raw10 output, you can try it.
I tried using the arducam_capture function in c / cpp. All modes outputted 8-bit images. I have tried all the codecs listed in arducam_mipicamera.h with no avail.
An example using mode 6 and BMP codec:
int capture(int exposure, int gain, int width, int height, int mode) {
CAMERA_INSTANCE camera_instance;
LOG("Open camera...");
int res = arducam_init_camera(&camera_instance);
if (res) {
LOG("init camera status = %d", res);
return -1;
}
res = arducam_set_mode(camera_instance, mode);
if (res = arducam_set_mode(camera_instance, mode)) {
LOG("failed to set camera mode. status = %d", res);
arducam_close_camera(camera_instance);
return -1;
}
IMAGE_FORMAT fmt = {.encoding = IMAGE_ENCODING_BMP, .quality = 100};
long long int capture_start = 0;
if (get_time_l(&capture_start) != 0) {
LOG("Failed to get capture start time");
arducam_close_camera(camera_instance);
return -1;
}
BUFFER *buf = arducam_capture(camera_instance, &fmt, 150000);
long long int captured_time = 0;
if (get_time_l(&captured_time) != 0) {
LOG("Failed to get time");
arducam_close_camera(camera_instance);
if (buf != NULL) {
arducam_release_buffer(buf);
}
return -1;
}
if (buf != NULL) {
LOG("It took %ld nanoseconds to capture the image.", captured_time - capture_start);
int FNAME_LEN = 30;
char file_name[FNAME_LEN];
bzero(file_name, FNAME_LEN);
snprintf(file_name, FNAME_LEN, "mode_%d.bmp", mode);
FILE *file = fopen(file_name, "wb");
fwrite(buf->data, buf->length, 1, file);
fclose(file);
arducam_release_buffer(buf);
} else {
LOG("Didn't get anything. Timed out.");
}
arducam_close_camera(camera_instance);
return 0;
}
# Using imagemagick's identify command to view image info
identify mode_6.bmp
## Output:
## mode_6.bmp BMP3 1600x1300 1600x1300+0+0 8-bit sRGB 5.95098MiB 0.000u 0:00.000
Hello, The 10 bit we said is raw format. the rpi’s component will input the raw10 image and out put image with YUV420 format. Then we send the image to RPI image component, it will encode
the image to jpeg or BMP or PNG. So you get the image is not 10 bit. for the color image it should be RGB565 with BMP format. For the grey image, it should be 8 bit. The ov2311 should a grey sensor. Which is depend on the RPI image component.
Would you point out which function and arguments I should use in the provided arducam_mipicamera.h library header? I’m using C++, not the command line.
I have checked the configuration and it does 8bit. I have modified the code and add raw10 configuration for you just now. The raw bayer image is raw 10 packed. the rawcam component will receive the raw10 image date and send it the ISP component and output YUV420 formats
Please download our new library and try it again. I have add ‘1600x1300 RAW 10 mode’ please run list_format to check it and let me know if you need more help.
Hello, lately we have temporarily moved on despite the image being 8-bit. With 10-bit image output on a definite timeline now, we checked out the latest update (commit 0f2ad8c1c5bdd2df7553d425c413d2dae276dc0e) for a try.
We:
installed libarducam_mipicamera.so by make install
modified capture_raw.c to use mode 6 - a single character change from 0 to 6 on line 44
compiled capture_raw with make capture_raw
ran ./capture_raw
The program still gave us a raw image of 1740800 bytes (1600 * 1088?). A 10-bit raw image would be at least 1600 * 1080 * 10 / 8 = 2160000 bytes.
Could you check if it’s really changed? Thank you.