camera-杂项

MEDIA_BUS_FMT

CIS sensor类型Sensor输出format
Bayer RAWMEDIA_BUS_FMT_SBGGR10_1X10 MEDIA_BUS_FMT_SRGGB10_1X10 MEDIA_BUS_FMT_SGBRG10_1X10 MEDIA_BUS_FMT_SGRBG10_1X10 MEDIA_BUS_FMT_SRGGB12_1X12 MEDIA_BUS_FMT_SBGGR12_1X12 MEDIA_BUS_FMT_SGBRG12_1X12 MEDIA_BUS_FMT_SGRBG12_1X12 MEDIA_BUS_FMT_SRGGB8_1X8 MEDIA_BUS_FMT_SBGGR8_1X8 MEDIA_BUS_FMT_SGBRG8_1X8 MEDIA_BUS_FMT_SGRBG8_1X8
YUVMEDIA_BUS_FMT_YUYV8_2X8 MEDIA_BUS_FMT_YVYU8_2X8 MEDIA_BUS_FMT_UYVY8_2X8 MEDIA_BUS_FMT_VYUY8_2X8 MEDIA_BUS_FMT_YUYV10_2X10 MEDIA_BUS_FMT_YVYU10_2X10 MEDIA_BUS_FMT_UYVY10_2X10 MEDIA_BUS_FMT_VYUY10_2X10 MEDIA_BUS_FMT_YUYV12_2X12 MEDIA_BUS_FMT_YVYU12_2X12 MEDIA_BUS_FMT_UYVY12_2X12 MEDIA_BUS_FMT_VYUY12_2X12;
Only Y(黑白)即raw bw sensorMEDIA_BUS_FMT_Y8_1X8 MEDIA_BUS_FMT_Y10_1X10 MEDIA_BUS_FMT_Y12_1X12

V4L2-controls列表

CID描述
V4L2_CID_VBLANKVertical blanking. The idle period after every frame during which no image data is produced. The unit of vertical blanking is a line. Every line has length of the image width plus horizontal blanking at the pixel rate defined by V4L2_CID_PIXEL_RATE control in the same sub-device.
V4L2_CID_HBLANKHorizontal blanking. The idle period after every line of image data during which no image data is produced. The unit of horizontal blanking is pixels.
V4L2_CID_EXPOSUREDetermines the exposure time of the camera sensor. The exposure time is limited by the frame interval.
V4L2_CID_ANALOGUE_GAINAnalogue gain is gain affecting all colour components in the pixel matrix. The gain operation is performed in the analogue domain before A/D conversion.
V4L2_CID_PIXEL_RATEPixel rate in the source pads of the subdev. This control is read-only and its unit is pixels / second. Ex mipi bus: pixel_rate = link_freq * 2 * nr_of_lanes / bits_per_sample
V4L2_CID_LINK_FREQData bus frequency. Together with the media bus pixel code, bus type (clock cycles per sample), the data bus frequency defines the pixel rate (V4L2_CID_PIXEL_RATE) in the pixel array (or possibly elsewhere, if the device is not an image sensor). The frame rate can be calculated from the pixel clock, image width and height and horizontal and vertical blanking. While the pixel rate control may be defined elsewhere than in the subdev containing the pixel array, the frame rate cannot be obtained from that information. This is because only on the pixel array it can be assumed that the vertical and horizontal blanking information is exact: no other blanking is allowed in the pixel array. The selection of frame rate is performed by selecting the desired horizontal and vertical blanking. The unit of this control is Hz.

曝光时间计算

PClk = Mipi速率*Lane数目 / BitWidth  =  link_freq * 2 * nr_of_lanes / bits_per_sample|
1行时间 = 行长({0x320c,0x320d})/PClk
曝光时间 = 曝光寄存器({3e01,3e02})x1行时间/16

1行时间的有两种方法:
1. 1000000/fps/vts //1000000us = 1s
2. hts/pclk

  • 0
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
这是一个用于显示碰撞箱的函数。下面逐句解释: 1. `void ShowCollisionbox(Camera* camera, int x1, int y1, int x2, int y2) {` 这一行声明了函数名为 `ShowCollisionbox`,它需要传递5个参数:指向 `Camera` 结构体的指针类型的 `camera`、4个整数型变量 `x1`、`y1`、`x2`、`y2`。函数返回值为 `void`,即不返回任何值。 2. `return;` 这一行表示函数直接返回,后面的代码不会被执行。 3. `setlinecolor(RGB(0, 0, 255));` 这一行设置当前画笔颜色为蓝色。 4. `setlinestyle(PS_SOLID,2);` 这一行设置当前画笔线型为实线,宽度为2个像素。 5. `line(300 - camera->x + x1, y1, 300 - camera->x + x2, y1);` 这一行画一条线段,起点为 `(300 - camera->x + x1, y1)`,终点为 `(300 - camera->x + x2, y1)`。 6. `line(300 - camera->x + x2, y1, 300 - camera->x + x2, y2);` 这一行画一条线段,起点为 `(300 - camera->x + x2, y1)`,终点为 `(300 - camera->x + x2, y2)`。 7. `line(300 - camera->x + x2, y2, 300 - camera->x + x1, y2);` 这一行画一条线段,起点为 `(300 - camera->x + x2, y2)`,终点为 `(300 - camera->x + x1, y2)`。 8. `line(300 - camera->x + x1, y1, 300 - camera->x + x1, y2);` 这一行画一条线段,起点为 `(300 - camera->x + x1, y1)`,终点为 `(300 - camera->x + x1, y2)`。 9. `setfillcolor(RGB(255, 0, 0));` 这一行设置当前画刷颜色为红色。 10. `setlinecolor(RGB(255, 0, 0));` 这一行设置当前画笔颜色为红色。 11. `fillcircle(300 - camera->x + x1, y1, 3);` 这一行在 `(300 - camera->x + x1, y1)` 处画一个半径为3个像素的实心圆。 12. `fillcircle(300 - camera->x + x2, y1, 3);` 这一行在 `(300 - camera->x + x2, y1)` 处画一个半径为3个像素的实心圆。 13. `fillcircle(300 - camera->x + x2, y2, 3);` 这一行在 `(300 - camera->x + x2, y2)` 处画一个半径为3个像素的实心圆。 14. `fillcircle(300 - camera->x + x1, y2, 3);` 这一行在 `(300 - camera->x + x1, y2)` 处画一个半径为3个像素的实心圆。 总的来说,这个函数的作用是在屏幕上显示一个矩形的四个顶点和四条边,以及每个顶点处的一个小红点。其中,`(x1, y1)` 和 `(x2, y2)` 分别是矩形的左上角和右下角的坐标,`camera` 是一个指向 `Camera` 结构体的指针,表示当前视角的位置。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值