Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
黑眼圈子
arduino-esp32
提交
12045d33
A
arduino-esp32
项目概览
黑眼圈子
/
arduino-esp32
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
arduino-esp32
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
12045d33
编写于
4月 21, 2022
作者:
M
Me No Dev
提交者:
GitHub
4月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update camera example to support face detection and recognition (#6603)
Fixes: #6508
上级
45b7fa05
变更
7
展开全部
显示空白变更内容
内联
并排
Showing
7 changed file
with
408 addition
and
210 deletion
+408
-210
libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino
...ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino
+48
-15
libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp
...aries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp
+257
-194
libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h
...aries/ESP32/examples/Camera/CameraWebServer/camera_pins.h
+98
-0
libraries/ESP32/examples/Camera/CameraWebServer/partitions.csv
...ries/ESP32/examples/Camera/CameraWebServer/partitions.csv
+5
-0
tools/sdk/esp32/lib/libesp_wifi.a
tools/sdk/esp32/lib/libesp_wifi.a
+0
-0
tools/sdk/esp32/lib/liblwip.a
tools/sdk/esp32/lib/liblwip.a
+0
-0
tools/sdk/esp32/qspi_qspi/include/sdkconfig.h
tools/sdk/esp32/qspi_qspi/include/sdkconfig.h
+0
-1
未找到文件。
libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino
浏览文件 @
12045d33
...
...
@@ -6,22 +6,35 @@
// Ensure ESP32 Wrover Module or other board with PSRAM is selected
// Partial images will be transmitted if image exceeds buffer size
//
// You must select partition scheme from the board menu that has at least 3MB APP space.
// Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15
// seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well
// ===================
// Select camera model
#define CAMERA_MODEL_WROVER_KIT // Has PSRAM
// ===================
//#define CAMERA_MODEL_WROVER_KIT // Has PSRAM
//#define CAMERA_MODEL_ESP_EYE // Has PSRAM
//#define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM
//#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM
//#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM
//#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM
//#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM
//#define CAMERA_MODEL_M5STACK_UNITCAM // No PSRAM
//
#define CAMERA_MODEL_AI_THINKER // Has PSRAM
#define CAMERA_MODEL_AI_THINKER // Has PSRAM
//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM
// ** Espressif Internal Boards **
//#define CAMERA_MODEL_ESP32_CAM_BOARD
//#define CAMERA_MODEL_ESP32S2_CAM_BOARD
//#define CAMERA_MODEL_ESP32S3_CAM_LCD
#include "camera_pins.h"
const
char
*
ssid
=
"*********"
;
const
char
*
password
=
"*********"
;
// ===========================
// Enter your WiFi credentials
// ===========================
const
char
*
ssid
=
"**********"
;
const
char
*
password
=
"**********"
;
void
startCameraServer
();
...
...
@@ -50,20 +63,33 @@ void setup() {
config
.
pin_pwdn
=
PWDN_GPIO_NUM
;
config
.
pin_reset
=
RESET_GPIO_NUM
;
config
.
xclk_freq_hz
=
20000000
;
config
.
pixel_format
=
PIXFORMAT_JPEG
;
config
.
frame_size
=
FRAMESIZE_UXGA
;
config
.
pixel_format
=
PIXFORMAT_JPEG
;
// for streaming
//config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition
config
.
grab_mode
=
CAMERA_GRAB_WHEN_EMPTY
;
config
.
fb_location
=
CAMERA_FB_IN_PSRAM
;
config
.
jpeg_quality
=
12
;
config
.
fb_count
=
1
;
// if PSRAM IC present, init with UXGA resolution and higher JPEG quality
// for larger pre-allocated frame buffer.
if
(
config
.
pixel_format
==
PIXFORMAT_JPEG
){
if
(
psramFound
()){
config
.
frame_size
=
FRAMESIZE_UXGA
;
config
.
jpeg_quality
=
10
;
config
.
fb_count
=
2
;
config
.
grab_mode
=
CAMERA_GRAB_LATEST
;
}
else
{
// Limit the frame size when PSRAM is not available
config
.
frame_size
=
FRAMESIZE_SVGA
;
config
.
jpeg_quality
=
12
;
config
.
fb_count
=
1
;
config
.
fb_location
=
CAMERA_FB_IN_DRAM
;
}
}
else
{
// Best option for face detection/recognition
config
.
frame_size
=
FRAMESIZE_240X240
;
#if CONFIG_IDF_TARGET_ESP32S3
config
.
fb_count
=
2
;
#endif
}
#if defined(CAMERA_MODEL_ESP_EYE)
pinMode
(
13
,
INPUT_PULLUP
);
...
...
@@ -85,14 +111,21 @@ void setup() {
s
->
set_saturation
(
s
,
-
2
);
// lower the saturation
}
// drop down frame size for higher initial frame rate
if
(
config
.
pixel_format
==
PIXFORMAT_JPEG
){
s
->
set_framesize
(
s
,
FRAMESIZE_QVGA
);
}
#if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)
s
->
set_vflip
(
s
,
1
);
s
->
set_hmirror
(
s
,
1
);
#endif
#if defined(CAMERA_MODEL_ESP32S3_EYE)
s
->
set_vflip
(
s
,
1
);
#endif
WiFi
.
begin
(
ssid
,
password
);
WiFi
.
setSleep
(
false
);
while
(
WiFi
.
status
()
!=
WL_CONNECTED
)
{
delay
(
500
);
...
...
@@ -109,6 +142,6 @@ void setup() {
}
void
loop
()
{
//
put your main code here, to run repeatedly:
//
Do nothing. Everything is done in another task by the web server
delay
(
10000
);
}
libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp
浏览文件 @
12045d33
此差异已折叠。
点击以展开。
libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h
浏览文件 @
12045d33
...
...
@@ -170,6 +170,104 @@
#define HREF_GPIO_NUM 26
#define PCLK_GPIO_NUM 21
#elif defined(CAMERA_MODEL_ESP32_CAM_BOARD)
// The 18 pin header on the board has Y5 and Y3 swapped
#define USE_BOARD_HEADER 0
#define PWDN_GPIO_NUM 32
#define RESET_GPIO_NUM 33
#define XCLK_GPIO_NUM 4
#define SIOD_GPIO_NUM 18
#define SIOC_GPIO_NUM 23
#define Y9_GPIO_NUM 36
#define Y8_GPIO_NUM 19
#define Y7_GPIO_NUM 21
#define Y6_GPIO_NUM 39
#if USE_BOARD_HEADER
#define Y5_GPIO_NUM 13
#else
#define Y5_GPIO_NUM 35
#endif
#define Y4_GPIO_NUM 14
#if USE_BOARD_HEADER
#define Y3_GPIO_NUM 35
#else
#define Y3_GPIO_NUM 13
#endif
#define Y2_GPIO_NUM 34
#define VSYNC_GPIO_NUM 5
#define HREF_GPIO_NUM 27
#define PCLK_GPIO_NUM 25
#elif defined(CAMERA_MODEL_ESP32S3_CAM_LCD)
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 40
#define SIOD_GPIO_NUM 17
#define SIOC_GPIO_NUM 18
#define Y9_GPIO_NUM 39
#define Y8_GPIO_NUM 41
#define Y7_GPIO_NUM 42
#define Y6_GPIO_NUM 12
#define Y5_GPIO_NUM 3
#define Y4_GPIO_NUM 14
#define Y3_GPIO_NUM 47
#define Y2_GPIO_NUM 13
#define VSYNC_GPIO_NUM 21
#define HREF_GPIO_NUM 38
#define PCLK_GPIO_NUM 11
#elif defined(CAMERA_MODEL_ESP32S2_CAM_BOARD)
// The 18 pin header on the board has Y5 and Y3 swapped
#define USE_BOARD_HEADER 0
#define PWDN_GPIO_NUM 1
#define RESET_GPIO_NUM 2
#define XCLK_GPIO_NUM 42
#define SIOD_GPIO_NUM 41
#define SIOC_GPIO_NUM 18
#define Y9_GPIO_NUM 16
#define Y8_GPIO_NUM 39
#define Y7_GPIO_NUM 40
#define Y6_GPIO_NUM 15
#if USE_BOARD_HEADER
#define Y5_GPIO_NUM 12
#else
#define Y5_GPIO_NUM 13
#endif
#define Y4_GPIO_NUM 5
#if USE_BOARD_HEADER
#define Y3_GPIO_NUM 13
#else
#define Y3_GPIO_NUM 12
#endif
#define Y2_GPIO_NUM 14
#define VSYNC_GPIO_NUM 38
#define HREF_GPIO_NUM 4
#define PCLK_GPIO_NUM 3
#elif defined(CAMERA_MODEL_ESP32S3_EYE)
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 15
#define SIOD_GPIO_NUM 4
#define SIOC_GPIO_NUM 5
#define Y2_GPIO_NUM 11
#define Y3_GPIO_NUM 9
#define Y4_GPIO_NUM 8
#define Y5_GPIO_NUM 10
#define Y6_GPIO_NUM 12
#define Y7_GPIO_NUM 18
#define Y8_GPIO_NUM 17
#define Y9_GPIO_NUM 16
#define VSYNC_GPIO_NUM 6
#define HREF_GPIO_NUM 7
#define PCLK_GPIO_NUM 13
#else
#error "Camera model not selected"
#endif
libraries/ESP32/examples/Camera/CameraWebServer/partitions.csv
0 → 100644
浏览文件 @
12045d33
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x3d0000,
fr, data, , 0x3e0000, 0x20000,
tools/sdk/esp32/lib/libesp_wifi.a
浏览文件 @
12045d33
无法预览此类型文件
tools/sdk/esp32/lib/liblwip.a
浏览文件 @
12045d33
无法预览此类型文件
tools/sdk/esp32/qspi_qspi/include/sdkconfig.h
浏览文件 @
12045d33
...
...
@@ -167,7 +167,6 @@
#define CONFIG_SPIRAM 1
#define CONFIG_SPIRAM_USE_MALLOC 1
#define CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL 4096
#define CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP 1
#define CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL 0
#define CONFIG_SPIRAM_CACHE_WORKAROUND 1
#define CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW 1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录