Skip to content

Commit

Permalink
Fix Camera Example (#3202)
Browse files Browse the repository at this point in the history
* Update app_httpd.cpp

* Stop LWIP from using PSRAM and enable OV7725
  • Loading branch information
me-no-dev authored Sep 12, 2019
1 parent bab3a70 commit 0739015
Show file tree
Hide file tree
Showing 73 changed files with 14 additions and 7 deletions.
14 changes: 11 additions & 3 deletions libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ static esp_err_t capture_handler(httpd_req_t *req){

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

size_t out_len, out_width, out_height;
uint8_t * out_buf;
Expand Down Expand Up @@ -282,6 +283,7 @@ static esp_err_t capture_handler(httpd_req_t *req){
face_id = run_face_recognition(image_matrix, net_boxes);
}
draw_face_boxes(image_matrix, net_boxes, face_id);
free(net_boxes->score);
free(net_boxes->box);
free(net_boxes->landmark);
free(net_boxes);
Expand Down Expand Up @@ -325,6 +327,8 @@ static esp_err_t stream_handler(httpd_req_t *req){
return res;
}

httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");

while(true){
detected = false;
face_id = 0;
Expand Down Expand Up @@ -378,6 +382,7 @@ static esp_err_t stream_handler(httpd_req_t *req){
}
fr_recognize = esp_timer_get_time();
draw_face_boxes(image_matrix, net_boxes, face_id);
free(net_boxes->score);
free(net_boxes->box);
free(net_boxes->landmark);
free(net_boxes);
Expand Down Expand Up @@ -624,15 +629,18 @@ void startCameraServer(){

ra_filter_init(&ra_filter, 20);

mtmn_config.type = FAST;
mtmn_config.min_face = 80;
mtmn_config.pyramid = 0.7;
mtmn_config.pyramid = 0.707;
mtmn_config.pyramid_times = 4;
mtmn_config.p_threshold.score = 0.6;
mtmn_config.p_threshold.nms = 0.7;
mtmn_config.p_threshold.candidate_number = 20;
mtmn_config.r_threshold.score = 0.7;
mtmn_config.r_threshold.nms = 0.7;
mtmn_config.r_threshold.candidate_number = 4;
mtmn_config.r_threshold.candidate_number = 10;
mtmn_config.o_threshold.score = 0.7;
mtmn_config.o_threshold.nms = 0.4;
mtmn_config.o_threshold.nms = 0.7;
mtmn_config.o_threshold.candidate_number = 1;

face_id_init(&id_list, FACE_ID_SAVE_NUMBER, ENROLL_CONFIRM_TIMES);
Expand Down
Binary file modified tools/sdk/bin/bootloader_dio_80m.bin
Binary file not shown.
Binary file modified tools/sdk/bin/bootloader_qio_40m.bin
Binary file not shown.
Binary file modified tools/sdk/bin/bootloader_qout_40m.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion tools/sdk/include/config/sdkconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
#define CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO 1
#define CONFIG_LWIP_DHCPS_LEASE_UNIT 60
#define CONFIG_SPIFFS_USE_MAGIC 1
#define CONFIG_OV7725_SUPPORT 1
#define CONFIG_TCPIP_TASK_STACK_SIZE 2560
#define CONFIG_BLUEDROID_PINNED_TO_CORE_0 1
#define CONFIG_FATFS_CODEPAGE_850 1
Expand Down Expand Up @@ -291,7 +292,6 @@
#define CONFIG_ESP32_DEBUG_STUBS_ENABLE 1
#define CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT 30
#define CONFIG_TCPIP_LWIP 1
#define CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST 1
#define CONFIG_REDUCE_PHY_TX_POWER 1
#define CONFIG_BOOTLOADER_WDT_TIME_MS 9000
#define CONFIG_FREERTOS_CORETIMER_0 1
Expand Down
Binary file modified tools/sdk/lib/libapp_trace.a
Binary file not shown.
Binary file modified tools/sdk/lib/libapp_update.a
Binary file not shown.
Binary file modified tools/sdk/lib/libasio.a
Binary file not shown.
Binary file modified tools/sdk/lib/libbootloader_support.a
Binary file not shown.
Binary file modified tools/sdk/lib/libbt.a
Binary file not shown.
Binary file modified tools/sdk/lib/libcoap.a
Binary file not shown.
Binary file modified tools/sdk/lib/libcoexist.a
Binary file not shown.
Binary file modified tools/sdk/lib/libconsole.a
Binary file not shown.
Binary file modified tools/sdk/lib/libcore.a
Binary file not shown.
Binary file modified tools/sdk/lib/libcxx.a
Binary file not shown.
Binary file modified tools/sdk/lib/libdriver.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp-tls.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp32-camera.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp32.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_adc_cal.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_event.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_http_client.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_http_server.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_https_ota.a
Binary file not shown.
Binary file modified tools/sdk/lib/libesp_ringbuf.a
Binary file not shown.
Binary file modified tools/sdk/lib/libespnow.a
Binary file not shown.
Binary file modified tools/sdk/lib/libethernet.a
Binary file not shown.
Binary file modified tools/sdk/lib/libexpat.a
Binary file not shown.
Binary file modified tools/sdk/lib/libface_detection.a
Binary file not shown.
Binary file modified tools/sdk/lib/libface_recognition.a
Binary file not shown.
Binary file modified tools/sdk/lib/libfatfs.a
Binary file not shown.
Binary file modified tools/sdk/lib/libfb_gfx.a
Binary file not shown.
Binary file modified tools/sdk/lib/libfreemodbus.a
Binary file not shown.
Binary file modified tools/sdk/lib/libfreertos.a
Binary file not shown.
Binary file modified tools/sdk/lib/libheap.a
Binary file not shown.
Binary file modified tools/sdk/lib/libimage_util.a
Binary file not shown.
Binary file modified tools/sdk/lib/libjsmn.a
Binary file not shown.
Binary file modified tools/sdk/lib/libjson.a
Binary file not shown.
Binary file modified tools/sdk/lib/liblibsodium.a
Binary file not shown.
Binary file modified tools/sdk/lib/liblog.a
Binary file not shown.
Binary file modified tools/sdk/lib/liblwip.a
Binary file not shown.
Binary file modified tools/sdk/lib/libmbedtls.a
Binary file not shown.
Binary file modified tools/sdk/lib/libmdns.a
Binary file not shown.
Binary file modified tools/sdk/lib/libmesh.a
Binary file not shown.
Binary file modified tools/sdk/lib/libmicro-ecc.a
Binary file not shown.
Binary file modified tools/sdk/lib/libmqtt.a
Binary file not shown.
Binary file modified tools/sdk/lib/libnet80211.a
Binary file not shown.
Binary file modified tools/sdk/lib/libnewlib.a
Binary file not shown.
Binary file modified tools/sdk/lib/libnghttp.a
Binary file not shown.
Binary file modified tools/sdk/lib/libnvs_flash.a
Binary file not shown.
Binary file modified tools/sdk/lib/libopenssl.a
Binary file not shown.
Binary file modified tools/sdk/lib/libpp.a
Binary file not shown.
Binary file modified tools/sdk/lib/libprotobuf-c.a
Binary file not shown.
Binary file modified tools/sdk/lib/libprotocomm.a
Binary file not shown.
Binary file modified tools/sdk/lib/libpthread.a
Binary file not shown.
Binary file modified tools/sdk/lib/libsdmmc.a
Binary file not shown.
Binary file modified tools/sdk/lib/libsmartconfig.a
Binary file not shown.
Binary file modified tools/sdk/lib/libsmartconfig_ack.a
Binary file not shown.
Binary file modified tools/sdk/lib/libsoc.a
Binary file not shown.
Binary file modified tools/sdk/lib/libspi_flash.a
Binary file not shown.
Binary file modified tools/sdk/lib/libspiffs.a
Binary file not shown.
Binary file modified tools/sdk/lib/libtcp_transport.a
Binary file not shown.
Binary file modified tools/sdk/lib/libtcpip_adapter.a
Binary file not shown.
Binary file modified tools/sdk/lib/libulp.a
Binary file not shown.
Binary file modified tools/sdk/lib/libvfs.a
Binary file not shown.
Binary file modified tools/sdk/lib/libwear_levelling.a
Binary file not shown.
Binary file modified tools/sdk/lib/libwifi_provisioning.a
Binary file not shown.
Binary file modified tools/sdk/lib/libwpa.a
Binary file not shown.
Binary file modified tools/sdk/lib/libwpa2.a
Binary file not shown.
Binary file modified tools/sdk/lib/libwpa_supplicant.a
Binary file not shown.
Binary file modified tools/sdk/lib/libwps.a
Binary file not shown.
Binary file modified tools/sdk/lib/libxtensa-debug-module.a
Binary file not shown.
5 changes: 2 additions & 3 deletions tools/sdk/sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ CONFIG_SPIRAM_SPEED_40M=y
CONFIG_SPIRAM_CACHE_WORKAROUND=y
CONFIG_SPIRAM_BANKSWITCH_ENABLE=y
CONFIG_SPIRAM_BANKSWITCH_RESERVE=8
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST=y
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST=
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=

#
Expand Down Expand Up @@ -430,7 +430,7 @@ CONFIG_PM_ENABLE=
# Camera configuration
#
CONFIG_OV2640_SUPPORT=y
CONFIG_OV7725_SUPPORT=
CONFIG_OV7725_SUPPORT=y
CONFIG_OV3660_SUPPORT=y
CONFIG_SCCB_HARDWARE_I2C=y
CONFIG_CAMERA_CORE0=
Expand Down Expand Up @@ -630,7 +630,6 @@ CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES=
CONFIG_TCP_OVERSIZE_MSS=y
CONFIG_TCP_OVERSIZE_QUARTER_MSS=
CONFIG_TCP_OVERSIZE_DISABLE=
CONFIG_LWIP_WND_SCALE=

#
# UDP
Expand Down

0 comments on commit 0739015

Please sign in to comment.