Skip to content

Commit 0739015

Browse files
authored
Fix Camera Example (#3202)
* Update app_httpd.cpp * Stop LWIP from using PSRAM and enable OV7725
1 parent bab3a70 commit 0739015

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+14
-7
lines changed

libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ static esp_err_t capture_handler(httpd_req_t *req){
229229

230230
httpd_resp_set_type(req, "image/jpeg");
231231
httpd_resp_set_hdr(req, "Content-Disposition", "inline; filename=capture.jpg");
232+
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
232233

233234
size_t out_len, out_width, out_height;
234235
uint8_t * out_buf;
@@ -282,6 +283,7 @@ static esp_err_t capture_handler(httpd_req_t *req){
282283
face_id = run_face_recognition(image_matrix, net_boxes);
283284
}
284285
draw_face_boxes(image_matrix, net_boxes, face_id);
286+
free(net_boxes->score);
285287
free(net_boxes->box);
286288
free(net_boxes->landmark);
287289
free(net_boxes);
@@ -325,6 +327,8 @@ static esp_err_t stream_handler(httpd_req_t *req){
325327
return res;
326328
}
327329

330+
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
331+
328332
while(true){
329333
detected = false;
330334
face_id = 0;
@@ -378,6 +382,7 @@ static esp_err_t stream_handler(httpd_req_t *req){
378382
}
379383
fr_recognize = esp_timer_get_time();
380384
draw_face_boxes(image_matrix, net_boxes, face_id);
385+
free(net_boxes->score);
381386
free(net_boxes->box);
382387
free(net_boxes->landmark);
383388
free(net_boxes);
@@ -624,15 +629,18 @@ void startCameraServer(){
624629

625630
ra_filter_init(&ra_filter, 20);
626631

632+
mtmn_config.type = FAST;
627633
mtmn_config.min_face = 80;
628-
mtmn_config.pyramid = 0.7;
634+
mtmn_config.pyramid = 0.707;
635+
mtmn_config.pyramid_times = 4;
629636
mtmn_config.p_threshold.score = 0.6;
630637
mtmn_config.p_threshold.nms = 0.7;
638+
mtmn_config.p_threshold.candidate_number = 20;
631639
mtmn_config.r_threshold.score = 0.7;
632640
mtmn_config.r_threshold.nms = 0.7;
633-
mtmn_config.r_threshold.candidate_number = 4;
641+
mtmn_config.r_threshold.candidate_number = 10;
634642
mtmn_config.o_threshold.score = 0.7;
635-
mtmn_config.o_threshold.nms = 0.4;
643+
mtmn_config.o_threshold.nms = 0.7;
636644
mtmn_config.o_threshold.candidate_number = 1;
637645

638646
face_id_init(&id_list, FACE_ID_SAVE_NUMBER, ENROLL_CONFIRM_TIMES);

tools/sdk/bin/bootloader_dio_80m.bin

-1.5 KB
Binary file not shown.

tools/sdk/bin/bootloader_qio_40m.bin

-1.5 KB
Binary file not shown.

tools/sdk/bin/bootloader_qout_40m.bin

0 Bytes
Binary file not shown.

tools/sdk/include/config/sdkconfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
#define CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO 1
131131
#define CONFIG_LWIP_DHCPS_LEASE_UNIT 60
132132
#define CONFIG_SPIFFS_USE_MAGIC 1
133+
#define CONFIG_OV7725_SUPPORT 1
133134
#define CONFIG_TCPIP_TASK_STACK_SIZE 2560
134135
#define CONFIG_BLUEDROID_PINNED_TO_CORE_0 1
135136
#define CONFIG_FATFS_CODEPAGE_850 1
@@ -291,7 +292,6 @@
291292
#define CONFIG_ESP32_DEBUG_STUBS_ENABLE 1
292293
#define CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT 30
293294
#define CONFIG_TCPIP_LWIP 1
294-
#define CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST 1
295295
#define CONFIG_REDUCE_PHY_TX_POWER 1
296296
#define CONFIG_BOOTLOADER_WDT_TIME_MS 9000
297297
#define CONFIG_FREERTOS_CORETIMER_0 1

tools/sdk/lib/libapp_trace.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libapp_update.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libasio.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libbootloader_support.a

4 Bytes
Binary file not shown.

tools/sdk/lib/libbt.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libcoap.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libcoexist.a

592 Bytes
Binary file not shown.

tools/sdk/lib/libconsole.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libcore.a

-8 Bytes
Binary file not shown.

tools/sdk/lib/libcxx.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libdriver.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libesp-tls.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libesp32-camera.a

276 Bytes
Binary file not shown.

tools/sdk/lib/libesp32.a

-368 Bytes
Binary file not shown.

tools/sdk/lib/libesp_adc_cal.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libesp_event.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libesp_http_client.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libesp_http_server.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libesp_https_ota.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libesp_ringbuf.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libespnow.a

-8 Bytes
Binary file not shown.

tools/sdk/lib/libethernet.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libexpat.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libface_detection.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libface_recognition.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libfatfs.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libfb_gfx.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libfreemodbus.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libfreertos.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libheap.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libimage_util.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libjsmn.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libjson.a

0 Bytes
Binary file not shown.

tools/sdk/lib/liblibsodium.a

0 Bytes
Binary file not shown.

tools/sdk/lib/liblog.a

0 Bytes
Binary file not shown.

tools/sdk/lib/liblwip.a

-296 Bytes
Binary file not shown.

tools/sdk/lib/libmbedtls.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libmdns.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libmesh.a

-8 Bytes
Binary file not shown.

tools/sdk/lib/libmicro-ecc.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libmqtt.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libnet80211.a

-212 Bytes
Binary file not shown.

tools/sdk/lib/libnewlib.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libnghttp.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libnvs_flash.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libopenssl.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libpp.a

-8 Bytes
Binary file not shown.

tools/sdk/lib/libprotobuf-c.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libprotocomm.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libpthread.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libsdmmc.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libsmartconfig.a

-4 Bytes
Binary file not shown.

tools/sdk/lib/libsmartconfig_ack.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libsoc.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libspi_flash.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libspiffs.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libtcp_transport.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libtcpip_adapter.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libulp.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libvfs.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libwear_levelling.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libwifi_provisioning.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libwpa.a

-8 Bytes
Binary file not shown.

tools/sdk/lib/libwpa2.a

-8 Bytes
Binary file not shown.

tools/sdk/lib/libwpa_supplicant.a

0 Bytes
Binary file not shown.

tools/sdk/lib/libwps.a

-8 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

tools/sdk/sdkconfig

+2-3
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ CONFIG_SPIRAM_SPEED_40M=y
293293
CONFIG_SPIRAM_CACHE_WORKAROUND=y
294294
CONFIG_SPIRAM_BANKSWITCH_ENABLE=y
295295
CONFIG_SPIRAM_BANKSWITCH_RESERVE=8
296-
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST=y
296+
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST=
297297
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=
298298

299299
#
@@ -430,7 +430,7 @@ CONFIG_PM_ENABLE=
430430
# Camera configuration
431431
#
432432
CONFIG_OV2640_SUPPORT=y
433-
CONFIG_OV7725_SUPPORT=
433+
CONFIG_OV7725_SUPPORT=y
434434
CONFIG_OV3660_SUPPORT=y
435435
CONFIG_SCCB_HARDWARE_I2C=y
436436
CONFIG_CAMERA_CORE0=
@@ -630,7 +630,6 @@ CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES=
630630
CONFIG_TCP_OVERSIZE_MSS=y
631631
CONFIG_TCP_OVERSIZE_QUARTER_MSS=
632632
CONFIG_TCP_OVERSIZE_DISABLE=
633-
CONFIG_LWIP_WND_SCALE=
634633

635634
#
636635
# UDP

0 commit comments

Comments
 (0)