Skip to content

Commit

Permalink
* update camera doc
Browse files Browse the repository at this point in the history
  • Loading branch information
lxowalle committed Jul 18, 2024
1 parent 0f82307 commit 6b79b89
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
16 changes: 9 additions & 7 deletions docs/doc/en/vision/camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,30 @@ You can also get greyscale images

## Setting the frame rate of the camera

Currently the camera supports `2560x1440 30FPS` and `1280x720 60FPS` configurations, the corresponding configurations are loaded by the `width`, `height`, and `fps` parameters passed when creating the `Camera` object.
Currently the camera supports `30fps` and `60fps` configurations, the frame rate is selected by the `width`, `height`, `fps` parameters passed when creating the `Camera` object, currently the maximum supported resolution is `1280x720` under `60fps`, and the maximum supported resolution is `2560x1440` under `30fps`.

### Setting the frame rate to 30 fps

``` Python
```python
from maix import camera
cam = camera.Camera(640, 480) # Default frame rate is 30fps.
cam = camera.Camera(640, 480, fps=30) # set the frame rate to 30 fps
# or
cam = camera.Camera(1920, 1280) # Frame rate is set to 30 fps when resolution is higher than 1280x720
```

### Set the frame rate to 60 fps

```python
from maix import camera
cam = camera.Camera(640, 480, fps=60) # set frame rate to 60 fps
cam = camera.Camera(640, 480, fps=60) # Set frame rate to 60 fps
# or
cam = camera.Camera(640, 480) # Set frame rate to 60fps if resolution is less than or equal to 1280x720
```

Notes:

1. if `Camera` is passed in a size larger than `1280x720`, for example written as `camera.Camera(1920, 1080, fps=60)`, then the `fps` parameter will be invalidated, and the frame rate will remain at `30fps`.
2. In `1080x720 60FPS` configuration the frame will be centred and cropped, so the field of view is smaller compared to `2560x1440 30FPS`.

TODO: Support `1920x1080 60FPS` configuration to increase the viewing angle at high resolution!
2. A `60fps` frame will be offset by a few pixels compared to a `30fps` frame, and the offset will need to be corrected if the viewing angle is critical.

## Skipping Initial Frames

Expand Down
14 changes: 8 additions & 6 deletions docs/doc/zh/vision/camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,30 @@ cam = camera.Camera(640, 480, image.Format.FMT_YVU420SP) # 设置输出NV21图

## 设置摄像头的帧率

目前摄像头支持`2560x1440 30FPS``1280x720 60FPS`两种配置,目前摄像头支持`2560x1440 30FPS``1280x720 60FPS`两种配置,由创建`Camera`对象时传入的`width``height``fps`参数来加载对应的配置
目前摄像头支持`30fps``60fps`两种配置,由创建`Camera`对象时传入的`width``height``fps`参数来选择帧率,目前`60fps`下最大支持分辨率`1280x720``30fps`下最大支持分辨率`2560x1440`

### 设置帧率为30帧

```python
from maix import camera
cam = camera.Camera(640, 480) # 默认帧率为30fps
cam = camera.Camera(640, 480, fps=30) # 设置帧率为30帧
# or
cam = camera.Camera(1920, 1280) # 分辨率高于1280x720时帧率会设置为30帧
```

### 设置帧率为60帧

```python
from maix import camera
cam = camera.Camera(640, 480, fps=60) # 设置帧率为60帧
cam = camera.Camera(640, 480, fps=60) # 设置帧率为60帧
# or
cam = camera.Camera(640, 480) # 分辨率低于或等于1280x720时帧率会设置为60fps
```

注意:

1. 如果`Camera`传入的尺寸大于`1280x720`,例如写成`camera.Camera(1920, 1080, fps=60)`,此时`fps`参数将会失效,帧率将保持在`30fps`
2.`1080x720 60FPS`配置下画面会居中裁剪,因此相对于`2560x1440 30FPS`的视角更小。

TODO:支持`1920x1080 60FPS`配置以增加在高分辨率下的视角
2. `60fps``30fps`的画面相比会有几个像素的偏移,在对视角有严格要求的应用下需要注意修正偏移。

## 跳过 开头的帧

Expand Down

0 comments on commit 6b79b89

Please sign in to comment.