Part 1
요약·해설
MT9M114·OV5640 구성, format capability와 frame timestamp를 설명합니다.
Camera · Pattern generator
LCD display
RGBP · YUYV
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
0986A7FAB541F4CE9DEEF4D93EA4CAA8C3C5FE7A2F22BF9036891BA329F1200C
.. zephyr:code-sample:: video-capture
:name: Video capture
:relevant-api: video_interface
Use the video API to retrieve video frames from a capture device.
Description
***********
This sample application uses the :ref:`video_api` to capture frames from a video capture
device then uses the :ref:`display_api` to display them onto an LCD screen (if any).
Requirements
************
This sample needs a video capture device (e.g. a camera) but it is not mandatory.
Supported camera modules on some i.MX RT boards can be found below.
- `Camera iMXRT`_
- :ref:`mimxrt1064_evk`
- `MT9M114 camera module`_
- :ref:`mimxrt1170_evk`
- `OV5640 camera module`_
Wiring
******
On :ref:`mimxrt1064_evk`, the MT9M114 camera module should be plugged in the
J35 camera connector. A USB cable should be connected from a host to the micro
USB debug connector (J41) in order to get console output via the freelink interface.
On :ref:`mimxrt1170_evk`, the OV5640 camera module should be plugged into the
J2 camera connector. A USB cable should be connected from a host to the micro
USB debug connector (J11) in order to get console output via the daplink interface.
Building and Running
********************
For :ref:`mimxrt1064_evk`, build this sample application with the following commands:
.. zephyr-app-commands::
:zephyr-app: samples/subsys/video/capture
:board: mimxrt1064_evk
:shield: dvp_fpc24_mt9m114,rk043fn66hs_ctg
:goals: build
:compact:
For :ref:`mimxrt1170_evk`, build this sample application with the following commands:
.. zephyr-app-commands::
:zephyr-app: samples/subsys/video/capture
:board: mimxrt1170_evk/mimxrt1176/cm7
:shield: nxp_btb44_ov5640,rk055hdmipi4ma0
:goals: build
:compact:
For testing purpose without the need of any real video capture and/or display hardwares,
a video software pattern generator is supported by the above build commands without
specifying the shields.
Sample Output
=============
.. code-block:: console
Video device: csi@402bc000
- Capabilities:
RGBP width [480; 480; 0] height [272; 272; 0]
YUYV width [480; 480; 0] height [272; 272; 0]
RGBP width [640; 640; 0] height [480; 480; 0]
YUYV width [640; 640; 0] height [480; 480; 0]
RGBP width [1280; 1280; 0] height [720; 720; 0]
YUYV width [1280; 1280; 0] height [720; 720; 0]
- Default format: RGBP 480x272
Display device: display-controller@402b8000
- Capabilities:
x_resolution = 480, y_resolution = 272, supported_pixel_formats = 40
current_pixel_format = 32, current_orientation = 0
Capture started
Got frame 0! size: 261120; timestamp 249 ms
Got frame 1! size: 261120; timestamp 282 ms
Got frame 2! size: 261120; timestamp 316 ms
Got frame 3! size: 261120; timestamp 350 ms
Got frame 4! size: 261120; timestamp 384 ms
Got frame 5! size: 261120; timestamp 418 ms
Got frame 6! size: 261120; timestamp 451 ms
<repeats endlessly>
References
**********
.. _Camera iMXRT: https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/Connecting-camera-and-LCD-to-i-MX-RT-EVKs/ta-p/1122183
.. _MT9M114 camera module: https://www.onsemi.com/PowerSolutions/product.do?id=MT9M114
.. _OV5640 camera module: https://cdn.sparkfun.com/datasheets/Sensors/LightImaging/OV5640_datasheet.pdf
Part 3
한국어 전문 번역
설명
Video API로 video capture device에서 frame을 가져온 뒤, LCD screen이 있으면 Display API를 사용해 화면에 표시하는 sample application입니다.
요구 사항
Camera 같은 video capture device가 필요하지만 필수는 아닙니다. 일부 i.MX RT board에서 지원되는 camera module은 다음과 같습니다.
mimxrt1064_evk: MT9M114 camera modulemimxrt1170_evk: OV5640 camera module
i.MX RT EVK의 camera와 LCD 연결 배경은 Camera iMXRT 안내를 참고합니다.
배선
mimxrt1064_evk에서는 MT9M114 camera module을 J35 camera connector에 꽂습니다. Freelink interface로 console output을 받으려면 host의 USB cable을 micro USB debug connector J41에 연결합니다.
mimxrt1170_evk에서는 OV5640 camera module을 J2 camera connector에 꽂습니다. Daplink interface로 console output을 받으려면 host의 USB cable을 micro USB debug connector J11에 연결합니다.
빌드 및 실행
mimxrt1064_evk에서는 MT9M114 camera와 RK043FN66HS display shield를 지정해 다음 command로 build합니다.
west build -b mimxrt1064_evk --shield dvp_fpc24_mt9m114 --shield rk043fn66hs_ctg samples/subsys/video/capture
mimxrt1170_evk/mimxrt1176/cm7에서는 OV5640 camera와 RK055HDMIPI4MA0 display shield를 지정해 build합니다.
west build -b mimxrt1170_evk/mimxrt1176/cm7 --shield nxp_btb44_ov5640 --shield rk055hdmipi4ma0 samples/subsys/video/capture
실제 video capture 또는 display hardware 없이 시험하려면 위 build command에서 shield를 지정하지 않습니다. 그러면 video software pattern generator를 사용할 수 있습니다.
샘플 출력
Console에는 capture device의 RGBP·YUYV resolution capability와 default format, display resolution과 pixel format이 표시됩니다. Capture가 시작되면 frame 번호, 261120-byte size와 timestamp가 계속 출력됩니다.
Video device: csi@402bc000
- Capabilities:
RGBP width [480; 480; 0] height [272; 272; 0]
YUYV width [480; 480; 0] height [272; 272; 0]
RGBP width [640; 640; 0] height [480; 480; 0]
YUYV width [640; 640; 0] height [480; 480; 0]
RGBP width [1280; 1280; 0] height [720; 720; 0]
YUYV width [1280; 1280; 0] height [720; 720; 0]
- Default format: RGBP 480x272
Display device: display-controller@402b8000
- Capabilities:
x_resolution = 480, y_resolution = 272, supported_pixel_formats = 40
current_pixel_format = 32, current_orientation = 0
Capture started
Got frame 0! size: 261120; timestamp 249 ms
Got frame 1! size: 261120; timestamp 282 ms
Got frame 2! size: 261120; timestamp 316 ms
Got frame 3! size: 261120; timestamp 350 ms
Got frame 4! size: 261120; timestamp 384 ms
Got frame 5! size: 261120; timestamp 418 ms
Got frame 6! size: 261120; timestamp 451 ms
<repeats endlessly>
참고 자료
Camera wiring은 위 Camera iMXRT 안내를, sensor 세부 정보는 MT9M114 product page와 OV5640 datasheet를 참고합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.