# ESP32 Camera Driver
[![Build examples](https://github.com/espressif/esp32-camera/actions/workflows/build.yml/badge.svg)](https://github.com/espressif/esp32-camera/actions/workflows/build.yml) [![Component Registry](https://components.espressif.com/components/espressif/esp32-camera/badge.svg)](https://components.espressif.com/components/espressif/esp32-camera)
## General Information
This repository hosts ESP32 series Soc compatible driver for image sensors. Additionally it provides a few tools, which allow converting the captured frame data to the more common BMP and JPEG formats.
### Supported Soc
- ESP32
- ESP32-S2
- ESP32-S3
### Supported Sensor
| model | max resolution | color type | output format | Len Size |
| ------- | -------------- | ---------- | ------------------------------------------------------------ | -------- |
| OV2640 | 1600 x 1200 | color | YUV(422/420)/YCbCr422<br>RGB565/555<br>8-bit compressed data<br>8/10-bit Raw RGB data | 1/4" |
| OV3660 | 2048 x 1536 | color | raw RGB data<br/>RGB565/555/444<br/>CCIR656<br/>YCbCr422<br/>compression | 1/5" |
| OV5640 | 2592 x 1944 | color | RAW RGB<br/>RGB565/555/444<br/>CCIR656<br/>YUV422/420<br/>YCbCr422<br/>compression | 1/4" |
| OV7670 | 640 x 480 | color | Raw Bayer RGB<br/>Processed Bayer RGB<br>YUV/YCbCr422<br>GRB422<br>RGB565/555 | 1/6" |
| OV7725 | 640 x 480 | color | Raw RGB<br/>GRB 422<br/>RGB565/555/444<br/>YCbCr 422 | 1/4" |
| NT99141 | 1280 x 720 | color | YCbCr 422<br/>RGB565/555/444<br/>Raw<br/>CCIR656<br/>JPEG compression | 1/4" |
| GC032A | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/10" |
| GC0308 | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/6.5" |
| GC2145 | 1600 x 1200 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/5" |
| BF3005 | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/4" |
| BF20A6 | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer | 1/10" |
| SC101IOT| 1280 x 720 | color | YUV/YCbCr422<br/>Raw RGB | 1/4.2" |
| SC030IOT| 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer | 1/6.5" |
| SC031GS | 640 x 480 | monochrome | RAW MONO<br/>Grayscale | 1/6" |
## Important to Remember
- Except when using CIF or lower resolution with JPEG, the driver requires PSRAM to be installed and activated.
- Using YUV or RGB puts a lot of strain on the chip because writing to PSRAM is not particularly fast. The result is that image data might be missing. This is particularly true if WiFi is enabled. If you need RGB data, it is recommended that JPEG is captured and then turned into RGB using `fmt2rgb888` or `fmt2bmp`/`frame2bmp`.
- When 1 frame buffer is used, the driver will wait for the current frame to finish (VSYNC) and start I2S DMA. After the frame is acquired, I2S will be stopped and the frame buffer returned to the application. This approach gives more control over the system, but results in longer time to get the frame.
- When 2 or more frame bufers are used, I2S is running in continuous mode and each frame is pushed to a queue that the application can access. This approach puts more strain on the CPU/Memory, but allows for double the frame rate. Please use only with JPEG.
## Installation Instructions
### Using esp-idf
- Clone or download and extract the repository to the components folder of your ESP-IDF project
- Enable PSRAM in `menuconfig` (also set Flash and PSRAM frequiencies to 80MHz)
- Include `esp_camera.h` in your code
### Using PlatformIO
The easy way -- on the `env` section of `platformio.ini`, add the following:
```ini
[env]
lib_deps =
esp32-camera
```
Now the `esp_camera.h` is available to be included:
```c
#include "esp_camera.h"
```
Enable PSRAM on `menuconfig` or type it direclty on `sdkconfig`. Check the [official doc](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-esp32-spiram-support) for more info.
```
CONFIG_ESP32_SPIRAM_SUPPORT=y
```
***Arduino*** The easy-way (content above) only seems to work if you're using `framework=arduino` which seems to take a bunch of the guesswork out (thanks Arduino!) but also suck up a lot more memory and flash, almost crippling the performance. If you plan to use the `framework=espidf` then read the sections below carefully!!
## Platform.io lib/submodule (for framework=espidf)
It's probably easier to just skip the platform.io library registry version and link the git repo as a submodule. (i.e. using code outside the platform.io library management). In this example we will install this as a submodule inside the platform.io $project/lib folder:
```
cd $project\lib
git submodule add -b master https://github.com/espressif/esp32-camera.git
```
Then in `platformio.ini` file
```
build_flags =
-I../lib/esp32-camera
```
After that `#include "esp_camera.h"` statement will be available. Now the module is included, and you're hopefully back to the same place as the easy-Arduino way.
**Warning about platform.io/espidf and fresh (not initialized) git repos**
There is a sharp-edge on you'll discover in the platform.io build process (in espidf v3.3 & 4.0.1) where a project which has only had `git init` but nothing committed will crash platform.io build process with highly non-useful output. The cause is due to lack of a version (making you think you did something wrong, when you didn't at all) - the output is horribly non-descript. Solution: the devs want you to create a file called version.txt with a number in it, or simply commit any file to the projects git repo and use git. This happens because platform.io build process tries to be too clever and determine the build version number from the git repo - it's a sharp edge you'll only encounter if you're experimenting on a new project with no commits .. like wtf is my camera not working let's try a 'clean project'?! </rant>
## Platform.io Kconfig
Kconfig is used by the platform.io menuconfig (accessed by running: `pio run -t menuconfig`) to interactively manage the various #ifdef statements throughout the espidf and supporting libraries (i.e. this repo: esp32-camera and arduino-esp32.git). The menuconfig process generates the `sdkconfig` file which is ultimately used behind the scenes by espidf compile+build process.
**Make sure to append or symlink** [this `Kconfig`](./Kconfig) content into the `Kconfig` of your project.
You symlink (or copy) the included Kconfig into your platform.io projects src directory. The file should be named `Kconfig.projbuild` in your projects src\ directory or you could also add the library path to a CMakefile.txt and hope the `Kconfig` (or `Kconfig.projbuild`) gets discovered by the menuconfig process, though this unpredictable for me.
The unpredictable wonky behavior in platform.io build process around Kconfig naming (Kconfig vs. Kconfig.projbuild) occurs between espidf versions 3.3 and 4.0 - but if you don't see "Camera configuration" in your `pio run -t menuconfig` then there is no point trying to test camera code (it may compile, but it probably won't work!) and it seems the platform.io devs (when they built their wrapper around the espidf menuconfig) didn't implement it properly. You've probably already figured out you can't use the espidf build tools since the files are in totally different locations and also different versions with sometimes different syntax. This is one of those times you might consider changing the `platformio.ini` from `platform=espressif32` to `platform=https://github.com/platformio/platform-espressif32.git#develop` to get a
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
当检测到物体在运动时,屏幕上图像左上角有蓝色块闪烁。 1、嵌入式物联网ESP32项目实战开发。例程经过精心编写,简单好用。 2、代码使用Visual Studio Code + ESP-IDF开发,C语言编程。例程在ESP32-S3上运行。若在其他型号上运行,请自行调整。 3、如果接入其他传感器,请查看发布的其他资料。 4、ESP32与模块的接线,在代码当中均有定义,请自行对照。 5、若硬件差异,请根据自身情况适当调整代码,程序仅供参考。 6、代码有注释说明,请耐心阅读。 7、技术v:349014857; 8、更多相关开发例程,点击左侧头像查看。
资源推荐
资源详情
资源评论
收起资源包目录
物联网嵌入式ESP32开发例程06-AI智能识别OV2640和OV5640摄像头图像进行物体运动识别.rar (393个子文件)
libmfn.a 20.58MB
libmfn.a 20.48MB
libmfn.a 20.39MB
libmfn.a 18.81MB
libdl.a 14.44MB
libdl.a 14.32MB
libdl.a 14.02MB
libdl.a 13.84MB
libhuman_face_detect.a 4.73MB
libhuman_face_detect.a 4.73MB
libhuman_face_detect.a 4.72MB
libhuman_face_detect.a 4.34MB
libcolor_detect.a 2.32MB
libcolor_detect.a 2.23MB
libcolor_detect.a 2.23MB
libcolor_detect.a 2.23MB
libcat_face_detect.a 2.07MB
libcat_face_detect.a 2.07MB
libcat_face_detect.a 2.07MB
libcat_face_detect.a 1.85MB
libesp-code-scanner.a 1.05MB
libesp-code-scanner.a 1.05MB
libesp-code-scanner.a 1.04MB
libnewlib_iconv.a 822KB
tjpgd.c 34KB
ov5640.c 34KB
ov3660.c 30KB
nt99141.c 26KB
lcd.c 22KB
ll_cam.c 19KB
cam_hal.c 19KB
ll_cam.c 17KB
ov2640.c 17KB
test_camera.c 16KB
ov7725.c 16KB
gc2145.c 15KB
gc0308.c 14KB
bf3005.c 14KB
ll_cam.c 13KB
esp_camera.c 13KB
ov7670.c 13KB
yuv.c 12KB
gc032a.c 11KB
to_bmp.c 11KB
bf20a6.c 11KB
sc031gs.c 10KB
sc101iot.c 10KB
sc030iot.c 9KB
sccb.c 9KB
xl9555.c 6KB
fb_gfx.c 5KB
iic.c 5KB
take_picture.c 4KB
main.c 4KB
esp_jpg_decode.c 4KB
camera.c 4KB
spi.c 4KB
sensor.c 3KB
xclk.c 2KB
led.c 1KB
mnist_coefficient.cpp 858KB
mnist_coefficient.cpp 195KB
jpge.cpp 29KB
app_main.cpp 26KB
to_jpg.cpp 6KB
app_main.cpp 6KB
app_main.cpp 6KB
who_ai_utils.cpp 5KB
esp_motion_detection.cpp 4KB
app_main.cpp 4KB
app_main.cpp 2KB
app_main.cpp 798B
partitions-16MiB.csv 384B
partitions.csv 287B
partitions.csv 287B
partitions.csv 244B
simple_mnist_model_cp-10.ckpt.data-00000-of-00001 1.25MB
sdkconfig.defaults 421B
sdkconfig.defaults 250B
sdkconfig.defaults 215B
sdkconfig.defaults 215B
sdkconfig.defaults 161B
sdkconfig.defaults 161B
sdkconfig.defaults 127B
sdkconfig.defaults.esp32 65B
sdkconfig.defaults.esp32 65B
sdkconfig.defaults.esp32 65B
sdkconfig.defaults.esp32 65B
sdkconfig.defaults.esp32 65B
sdkconfig.defaults.esp32 65B
sdkconfig.defaults.esp32s2 140B
sdkconfig.defaults.esp32s2 140B
sdkconfig.defaults.esp32s2 140B
sdkconfig.defaults.esp32s2 140B
sdkconfig.defaults.esp32s2 133B
sdkconfig.defaults.esp32s2 133B
sdkconfig.defaults.esp32s3 278B
sdkconfig.defaults.esp32s3 174B
sdkconfig.defaults.esp32s3 174B
sdkconfig.defaults.esp32s3 174B
共 393 条
- 1
- 2
- 3
- 4
资源评论
边缘计算网关定制开发
- 粉丝: 3307
- 资源: 1240
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 华盈恒信—金德精密—金德实业心理特征测评量表答题卡.doc
- 华盈恒信—金德精密—金德实业管理人员心理特征分析报告(发布版).ppt
- 华盈恒信—西洋肥业心理特征测评量表答题卡(1).doc
- 华盈恒信—金德精密—金德实业心理特征测评评价标准(1).doc
- 基于FPGA设计的数字时钟课程设计源码+文档说明(高分项目)
- 机械设计四轴定位装置sw18可编辑全套设计资料100%好用.zip
- 交流能力测评.doc
- 03.阿里巴巴20XX校招软件笔试题经典(含答案).doc
- 04.百度校招笔试题.doc
- 11.外企面试问题大全.doc
- 08.面谈构成表.doc
- 14.校园招聘面试小组讨论题目.doc.doc
- Java项目:校园周边美食探索(java+SpringBoot+Mybaits+Vue+elementui+mysql)
- 关于市场部拓展员面试的十大问题.doc
- 市场部经理面试技巧大全.docx
- 市场营销人员结构化面试题目.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功