{"id":11777,"date":"2023-06-24T04:51:29","date_gmt":"2023-06-24T04:51:29","guid":{"rendered":"https:\/\/dgzx.hk?p=11777"},"modified":"2023-06-24T04:58:55","modified_gmt":"2023-06-24T04:58:55","slug":"how-to-use-esp32-cam-to-build-a-face-recognition-system","status":"publish","type":"post","link":"https:\/\/dgzx.hk\/vi\/cach-su-dung-esp32-cam-de-xay-dung-he-thong-nhan-dang-khuon-mat\/","title":{"rendered":"C\u00e1ch s\u1eed d\u1ee5ng ESP32-CAM \u0111\u1ec3 x\u00e2y d\u1ef1ng h\u1ec7 th\u1ed1ng nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t"},"content":{"rendered":"<p style=\"text-indent: 2em;\">C\u00f3 nhi\u1ec1u h\u1ec7 th\u1ed1ng nh\u1eadn d\u1ea1ng ng\u01b0\u1eddi s\u1eed d\u1ee5ng ch\u1eef k\u00fd, d\u1ea5u v\u00e2n tay, gi\u1ecdng n\u00f3i, h\u00ecnh d\u1ea1ng b\u00e0n tay, nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t, v.v. \u0111\u1ec3 nh\u1eadn d\u1ea1ng m\u1ecdi ng\u01b0\u1eddi, nh\u01b0ng kh\u00f4ng c\u00f3 h\u1ec7 th\u1ed1ng nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t.<\/p>\n<p style=\"text-indent: 2em;\">H\u1ec7 th\u1ed1ng nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t kh\u00f4ng ch\u1ec9 c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng cho m\u1ee5c \u0111\u00edch an ninh \u0111\u1ec3 nh\u1eadn d\u1ea1ng m\u1ecdi ng\u01b0\u1eddi \u1edf n\u01a1i c\u00f4ng c\u1ed9ng m\u00e0 c\u00f2n cho m\u1ee5c \u0111\u00edch ch\u1ea5m c\u00f4ng t\u1ea1i v\u0103n ph\u00f2ng v\u00e0 tr\u01b0\u1eddng h\u1ecdc.<\/p>\n<p style=\"text-indent: 2em;\">Trong d\u1ef1 \u00e1n n\u00e0y, ch\u00fang t\u00f4i s\u1ebd x\u00e2y d\u1ef1ng m\u1ed9t h\u1ec7 th\u1ed1ng nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t s\u1eed d\u1ee5ng ESP32-CAM, c\u0169ng c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng nh\u01b0 m\u1ed9t h\u1ec7 th\u1ed1ng an ninh ESP32-CAM b\u1eb1ng c\u00e1ch nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t c\u1ee7a m\u1ed9t ng\u01b0\u1eddi kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p. ESP32-CAM l\u00e0 m\u1ed9t m\u00f4-\u0111un camera r\u1ea5t nh\u1ecf s\u1eed d\u1ee5ng chip ESP32-S. S\u1eed d\u1ee5ng m\u00f4-\u0111un ESP32-CAM, ch\u00fang t\u00f4i c\u00f3 th\u1ec3 x\u00e2y d\u1ef1ng m\u1ed9t h\u1ec7 th\u1ed1ng nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t m\u00e0 kh\u00f4ng c\u1ea7n s\u1eed d\u1ee5ng b\u1ea5t k\u1ef3 ch\u01b0\u01a1ng tr\u00ecnh ph\u1ee9c t\u1ea1p n\u00e0o v\u00e0 b\u1ea5t k\u1ef3 th\u00e0nh ph\u1ea7n b\u1ed5 sung n\u00e0o.<\/p>\n<p style=\"text-indent: 2em;\"><\/p>\n<p style=\"text-align: center; text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><img decoding=\"async\" src=\"https:\/\/file.elecfans.com\/web2\/M00\/64\/18\/pYYBAGMDP4SACJowAANX-QufGyo030.png\" alt=\"pYYBAGMDP4SACJowAANX-QufGyo030.png\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe1\" \/><\/p>\n<p style=\"text-indent: 2em;\">M\u00f4-\u0111un AI-Thinker ESP32-CAM c\u00f3 chip ESP32-S, camera OV2640 si\u00eau nh\u1ecf v\u00e0 khe c\u1eafm th\u1ebb nh\u1edb micro SD. Khe c\u1eafm th\u1ebb nh\u1edb Micro SD c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 l\u01b0u tr\u1eef h\u00ecnh \u1ea3nh ch\u1ee5p t\u1eeb camera ho\u1eb7c l\u01b0u tr\u1eef t\u1ec7p. M\u00f4-\u0111un ESP32-CAM c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong nhi\u1ec1u \u1ee9ng d\u1ee5ng iot. N\u00f3 c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng nh\u01b0 m\u1ed9t h\u1ec7 th\u1ed1ng ph\u00e1t hi\u1ec7n khu\u00f4n m\u1eb7t trong v\u0103n ph\u00f2ng, tr\u01b0\u1eddng h\u1ecdc v\u00e0 c\u00e1c khu v\u1ef1c ri\u00eang t\u01b0 kh\u00e1c, c\u0169ng nh\u01b0 \u0111\u1ec3 gi\u00e1m s\u00e1t kh\u00f4ng d\u00e2y, nh\u1eadn d\u1ea1ng kh\u00f4ng d\u00e2y m\u00e3 QR v\u00e0 nhi\u1ec1u \u1ee9ng d\u1ee5ng iot kh\u00e1c.<\/p>\n<p style=\"text-indent: 2em;\">C\u00e1c m\u00f4-\u0111un ESP32-CAM c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c l\u1eadp tr\u00ecnh b\u1eb1ng ESP-IDF ho\u1eb7c Arduino IDE. M\u00f4-\u0111un ESP32-CAM c\u0169ng c\u00f3 m\u1ed9t s\u1ed1 ch\u00e2n GPIO \u0111\u1ec3 k\u1ebft n\u1ed1i v\u1edbi ph\u1ea7n c\u1ee9ng b\u00ean ngo\u00e0i. ESP32-CAM kh\u00f4ng c\u00f3 \u0111\u1ea7u n\u1ed1i USB, v\u00ec v\u1eady \u0111\u1ec3 l\u1eadp tr\u00ecnh m\u00f4-\u0111un, b\u1ea1n c\u1ea7n m\u1ed9t bo m\u1ea1ch FTDI.<\/p>\n<p style=\"text-align: center; text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><img decoding=\"async\" src=\"https:\/\/file.elecfans.com\/web2\/M00\/64\/18\/pYYBAGMDP4CAGwZRAAHq1FlljFk414.png\" alt=\"pYYBAGMDP4CAGwZRAAHq1FlljFk414.png\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe2\" \/><\/p>\n<p style=\"text-indent: 2em;\">\u0110\u1eb7c tr\u01b0ng:<\/p>\n<p style=\"text-indent: 2em;\">M\u00f4-\u0111un SoC BT Wi-Fi 802.11b\/g\/n nh\u1ecf nh\u1ea5t<\/p>\n<p style=\"text-indent: 2em;\">CPU 32-bit c\u00f4ng su\u1ea5t th\u1ea5p c\u0169ng c\u00f3 th\u1ec3 ph\u1ee5c v\u1ee5 b\u1ed9 x\u1eed l\u00fd \u1ee9ng d\u1ee5ng<\/p>\n<p style=\"text-indent: 2em;\">T\u1ed1c \u0111\u1ed9 xung nh\u1ecbp l\u00ean \u0111\u1ebfn 160MHz, c\u00f4ng su\u1ea5t t\u00ednh to\u00e1n t\u00edch h\u1ee3p l\u00ean \u0111\u1ebfn 600 DMIPS<\/p>\n<p style=\"text-indent: 2em;\">T\u00edch h\u1ee3p 520 KB SRAM, b\u00ean ngo\u00e0i 4MPSRAM<\/p>\n<p style=\"text-indent: 2em;\">H\u1ed7 tr\u1ee3 UART\/SPI\/I2C\/PWM\/ADC\/DAC<\/p>\n<p style=\"text-indent: 2em;\">H\u1ed7 tr\u1ee3 camera OV2640 v\u00e0 OV7670 c\u00f3 \u0111\u00e8n flash t\u00edch h\u1ee3p<\/p>\n<p style=\"text-indent: 2em;\">H\u1ed7 tr\u1ee3 t\u1ea3i h\u00ecnh \u1ea3nh qua Wi-Fi<\/p>\n<p style=\"text-indent: 2em;\">H\u1ed7 tr\u1ee3 th\u1ebb TF<\/p>\n<p style=\"text-indent: 2em;\">H\u1ed7 tr\u1ee3 nhi\u1ec1u ch\u1ebf \u0111\u1ed9 ng\u1ee7<\/p>\n<p style=\"text-indent: 2em;\">Lwip nh\u00fang v\u00e0 FreeRTOS<\/p>\n<p style=\"text-indent: 2em;\">H\u1ed7 tr\u1ee3 ch\u1ebf \u0111\u1ed9 ho\u1ea1t \u0111\u1ed9ng STA\/AP\/STA+AP<\/p>\n<p style=\"text-indent: 2em;\">C\u00f4ng ngh\u1ec7 Smart Config\/AirKiss \u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3<\/p>\n<p style=\"text-indent: 2em;\">H\u1ed7 tr\u1ee3 n\u00e2ng c\u1ea5p ch\u01b0\u01a1ng tr\u00ecnh c\u01a1 s\u1edf c\u1ee5c b\u1ed9 v\u00e0 t\u1eeb xa qua c\u1ed5ng n\u1ed1i ti\u1ebfp (FOTA)<\/p>\n<p style=\"text-indent: 2em;\">Th\u00f4ng s\u1ed1 k\u1ef9 thu\u1eadt:<\/p>\n<p style=\"text-indent: 2em;\">SPI flash: M\u1eb7c \u0111\u1ecbnh l\u00e0 32Mbit<\/p>\n<p style=\"text-indent: 2em;\">B\u1ed9 nh\u1edb: 520KB SRAM+4M PSRAM<\/p>\n<p style=\"text-indent: 2em;\">H\u1ed7 tr\u1ee3 th\u1ebb TF: T\u1ed1i \u0111a 4G<\/p>\n<p style=\"text-indent: 2em;\">Giao di\u1ec7n \u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3: UART, SPI, I2C, PWM<\/p>\n<p style=\"text-indent: 2em;\">\u0110\u1ecbnh d\u1ea1ng \u0111\u1ea7u ra h\u00ecnh \u1ea3nh: JPEG, BMP, thang \u0111\u1ed9 x\u00e1m<\/p>\n<p style=\"text-indent: 2em;\">C\u1ed5ng IO: 9<\/p>\n<p style=\"text-indent: 2em;\">Ph\u1ea1m vi cung c\u1ea5p \u0111i\u1ec7n: 5V<\/p>\n<p style=\"text-indent: 2em;\">Th\u00e0nh ph\u1ea7n b\u1eaft bu\u1ed9c<\/p>\n<p style=\"text-indent: 2em;\">ESP32-CAM<\/p>\n<p style=\"text-indent: 2em;\">L\u1eadp tr\u00ecnh vi\u00ean FTDI<\/p>\n<p style=\"text-indent: 2em;\">S\u01a1 \u0111\u1ed3 m\u1ea1ch \u0111i\u1ec7n<\/p>\n<p style=\"text-indent: 2em;\">\u0110\u1ec3 ch\u1ebf t\u1ea1o camera an ninh ESP32 CAM, ch\u00fang ta ch\u1ec9 c\u1ea7n m\u00f4-\u0111un camera ESP32 v\u00e0 b\u1ed9 l\u1eadp tr\u00ecnh FTDI \u0111\u1ec3 l\u1eadp tr\u00ecnh.<\/p>\n<p style=\"text-align: center; text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><img decoding=\"async\" src=\"https:\/\/file.elecfans.com\/web2\/M00\/64\/18\/pYYBAGMDP3qAVkq9AAITZhIELB0303.png\" alt=\"pYYBAGMDP3qAVkq9AAITZhIELB0303.png\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe3\" \/><\/p>\n<p style=\"text-indent: 2em;\">ESP32-CAM kh\u00f4ng c\u00f3 \u0111\u1ea7u n\u1ed1i USB, v\u00ec v\u1eady b\u1ea1n c\u1ea7n m\u1ed9t tr\u00ecnh l\u1eadp tr\u00ecnh FTDI \u0111\u1ec3 t\u1ea3i m\u00e3 l\u00ean ESP32-CAM, nh\u01b0 th\u1ec3 hi\u1ec7n trong h\u00ecnh tr\u00ean. C\u00e1c ch\u00e2n Vcc v\u00e0 GND c\u1ee7a ESP32 \u0111\u01b0\u1ee3c k\u1ebft n\u1ed1i v\u1edbi c\u00e1c ch\u00e2n Vcc v\u00e0 GND c\u1ee7a bo m\u1ea1ch FTDI. Tx v\u00e0 Rx c\u1ee7a ESP32 \u0111\u01b0\u1ee3c k\u1ebft n\u1ed1i v\u1edbi Rx v\u00e0 Tx c\u1ee7a bo m\u1ea1ch FTDI.<\/p>\n<p style=\"text-indent: 2em;\">L\u01b0u \u00fd: Ground IO0 tr\u01b0\u1edbc khi t\u1ea3i m\u00e3. IO0 x\u00e1c \u0111\u1ecbnh ESP32 c\u00f3 \u1edf ch\u1ebf \u0111\u1ed9 nh\u1ea5p nh\u00e1y hay kh\u00f4ng. Khi GPIO 0 \u0111\u01b0\u1ee3c k\u1ebft n\u1ed1i v\u1edbi GND, ESP32 \u1edf ch\u1ebf \u0111\u1ed9 nh\u1ea5p nh\u00e1y.<\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">Sau khi l\u1eadp tr\u00ecnh ESP32, t\u00f4i \u0111\u00e3 th\u00e1o bo m\u1ea1ch FTDI v\u00e0 k\u1ebft n\u1ed1i m\u00f4-\u0111un v\u1edbi ngu\u1ed3n \u0111i\u1ec7n 3,3V b\u1eb1ng b\u1ed9 \u0111i\u1ec1u ch\u1ec9nh 7805. C\u00e0i \u0111\u1eb7t cho lu\u1ed3ng video cam ESP32 nh\u01b0 sau:<img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/uploads\/image\/20230624\/1687582168633952.png\" title=\"1687582168633952.png\" alt=\"h\u00ecnh \u1ea3nh.png\"\/><\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">C\u00e0i \u0111\u1eb7t bo m\u1ea1ch ESP32 tr\u00ean Arduino IDE<\/p>\n<p style=\"text-indent: 2em;\">\u1ede \u0111\u00e2y ESP32-CAM \u0111\u01b0\u1ee3c l\u1eadp tr\u00ecnh b\u1eb1ng Arduino IDE. \u0110\u1ec3 l\u00e0m \u0111\u01b0\u1ee3c \u0111i\u1ec1u n\u00e0y, ch\u00fang ta ph\u1ea3i c\u00e0i \u0111\u1eb7t plug-in ESP32 tr\u00ean Arduino IDE.<\/p>\n<p style=\"text-indent: 2em;\">\u0110\u1ec3 c\u00e0i \u0111\u1eb7t bo m\u1ea1ch ESP32 v\u00e0o Arduino IDE c\u1ee7a b\u1ea1n, h\u00e3y v\u00e0o T\u00f9y ch\u1ecdn t\u1ec7p<\/p>\n<p style=\"text-align: center; text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/uploads\/image\/20230624\/1687582197248016.png\" title=\"1687582197248016.png\" alt=\"h\u00ecnh \u1ea3nh.png\"\/><\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">B\u00e2y gi\u1edd h\u00e3y sao ch\u00e9p li\u00ean k\u1ebft sau v\u00e0 d\u00e1n v\u00e0o tr\u01b0\u1eddng &quot;Additional Board Manager URLs&quot; nh\u01b0 hi\u1ec3n th\u1ecb b\u00ean d\u01b0\u1edbi. Sau \u0111\u00f3, nh\u1ea5p v\u00e0o n\u00fat OK:<\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">B\u00e2y gi\u1edd \u0111\u1ebfn H\u1ed9i \u0111\u1ed3ng qu\u1ea3n tr\u1ecb c\u00f4ng c\u1ee5, Gi\u00e1m \u0111\u1ed1c H\u1ed9i \u0111\u1ed3ng qu\u1ea3n tr\u1ecb<\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">T\u00ecm ki\u1ebfm ESP32 trong Board Manager v\u00e0 c\u00e0i \u0111\u1eb7t &quot;ESP32 c\u1ee7a Espressif Systems&quot;.<\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">M\u00e3 m\u00e1y ch\u1ee7 web camera ESP32<\/p>\n<p style=\"text-indent: 2em;\">Ch\u00fang t\u00f4i \u0111\u00e3 c\u00f3 m\u1ed9t m\u00e3 m\u1eabu t\u1eeb ESP32 cam video streaming v\u00e0 nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t. M\u1edf v\u00ed d\u1ee5 ESP32 b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng &quot;File&quot; Examples &quot;ESP32&quot; Camera, sau \u0111\u00f3 m\u1edf v\u00ed d\u1ee5 CameraWebServer.<\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">Tr\u01b0\u1edbc khi t\u1ea3i m\u00e3 l\u00ean, b\u1ea1n s\u1ebd c\u1ea7n nh\u1eadp t\u00ean Wi-Fi v\u00e0 m\u1eadt kh\u1ea9u.<\/p>\n<p style=\"text-indent: 2em;\">const char* ssid = &quot;T\u00ean WiFi&quot;;<\/p>\n<p style=\"text-indent: 2em;\">const char* Password = &quot;M\u1eadt kh\u1ea9u&quot;;<\/p>\n<p style=\"text-indent: 2em;\">Sau \u0111\u00f3 \u0111\u1ecbnh ngh\u0129a m\u00f4-\u0111un camera ESP. Trong m\u00e3, h\u1ecd \u0111\u1ecbnh ngh\u0129a 5 m\u00f4-\u0111un camera, v\u00ec v\u1eady h\u00e3y b\u1ecf ch\u00fa th\u00edch &quot;CAMERA_MODEL_AI_THINKER&quot; v\u00e0 ch\u00fa th\u00edch c\u00e1c m\u00f4-\u0111un c\u00f2n l\u1ea1i.<\/p>\n<p style=\"text-indent: 2em;\">B\u00e2y gi\u1edd m\u00e3 \u0111\u00e3 s\u1eb5n s\u00e0ng \u0111\u1ec3 t\u1ea3i l\u00ean.<\/p>\n<p style=\"text-indent: 2em;\">\u0110\u1ec3 t\u1ea3i m\u00e3 l\u00ean, h\u00e3y k\u1ebft n\u1ed1i bo m\u1ea1ch FDTI v\u1edbi m\u00e1y t\u00ednh x\u00e1ch tay c\u1ee7a b\u1ea1n v\u00e0 ch\u1ecdn &quot;ESP32 Wrover Module&quot; l\u00e0m bo m\u1ea1ch c\u1ee7a b\u1ea1n. Ngo\u00e0i ra, h\u00e3y thay \u0111\u1ed5i c\u00e1c C\u00e0i \u0111\u1eb7t kh\u00e1c d\u1ef1a tr\u00ean h\u00ecnh \u1ea3nh n\u00e0y:<\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">Tr\u01b0\u1edbc khi t\u1ea3i m\u00e3 l\u00ean, h\u00e3y nh\u1ea5n n\u00fat \u0111\u1eb7t l\u1ea1i ESP32 r\u1ed3i nh\u1ea5p v\u00e0o n\u00fat T\u1ea3i l\u00ean.<\/p>\n<p style=\"text-indent: 2em;\">L\u01b0u \u00fd: N\u1ebfu b\u1ea1n g\u1eb7p l\u1ed7i khi t\u1ea3i m\u00e3 l\u00ean, h\u00e3y ki\u1ec3m tra xem IO0 \u0111\u00e3 \u0111\u01b0\u1ee3c k\u1ebft n\u1ed1i v\u1edbi GND ch\u01b0a v\u00e0 b\u1ea1n \u0111\u00e3 ch\u1ecdn \u0111\u00fang c\u00e0i \u0111\u1eb7t trong menu C\u00f4ng c\u1ee5 ch\u01b0a.<\/p>\n<p style=\"text-indent: 2em;\">Ng\u1eaft k\u1ebft n\u1ed1i ch\u00e2n IO0 v\u00e0 GND sau khi t\u1ea3i m\u00e3. Sau \u0111\u00f3 m\u1edf m\u00e0n h\u00ecnh n\u1ed1i ti\u1ebfp v\u00e0 thay \u0111\u1ed5i t\u1ed1c \u0111\u1ed9 baud th\u00e0nh 115200. Sau \u0111\u00f3 nh\u1ea5n n\u00fat reset ESP32 v\u00e0 n\u00f3 s\u1ebd in \u0111\u1ecba ch\u1ec9 IP ESP v\u00e0 s\u1ed1 c\u1ed5ng tr\u00ean m\u00e0n h\u00ecnh n\u1ed1i ti\u1ebfp nh\u01b0 h\u00ecnh d\u01b0\u1edbi \u0111\u00e2y.<\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">B\u00e2y gi\u1edd \u0111\u1ec3 truy c\u1eadp lu\u1ed3ng camera, h\u00e3y \u0111i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn tr\u00ecnh duy\u1ec7t c\u1ee7a b\u1ea1n v\u00e0 nh\u1eadp \u0111\u1ecba ch\u1ec9 IP ESP c\u1ee7a b\u1ea1n. N\u00f3 s\u1ebd \u0111\u01b0a b\u1ea1n \u0111\u1ebfn trang ph\u01b0\u01a1ng ti\u1ec7n truy\u1ec1n ph\u00e1t. \u0110\u1ec3 b\u1eaft \u0111\u1ea7u lu\u1ed3ng video camera ESP32, h\u00e3y nh\u1ea5p v\u00e0o n\u00fat &quot;B\u1eaft \u0111\u1ea7u truy\u1ec1n ph\u00e1t&quot; \u1edf cu\u1ed1i trang<\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">B\u1ea1n c\u00f3 th\u1ec3 thay \u0111\u1ed5i ch\u1ea5t l\u01b0\u1ee3ng ph\u00e1t tr\u1ef1c tuy\u1ebfn b\u1eb1ng c\u00e1ch thay \u0111\u1ed5i &quot;\u0111\u1ed9 ph\u00e2n gi\u1ea3i&quot; tr\u00ean trang ph\u00e1t tr\u1ef1c tuy\u1ebfn. B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 nh\u1ea5p v\u00e0o h\u00ecnh \u1ea3nh b\u1eb1ng c\u00e1ch nh\u1ea5p v\u00e0o n\u00fat &quot;Get Still&quot;, nh\u01b0ng m\u00e3 n\u00e0y kh\u00f4ng c\u00f3 t\u00f9y ch\u1ecdn l\u01b0u h\u00ecnh \u1ea3nh.<\/p>\n<p style=\"text-indent: 2em;\">Sau khi ki\u1ec3m tra lu\u1ed3ng video, b\u00e2y gi\u1edd ch\u00fang ta s\u1ebd ki\u1ec3m tra ch\u1ee9c n\u0103ng ph\u00e1t hi\u1ec7n v\u00e0 nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t c\u1ee7a camera ESP32. B\u1eadt ch\u1ee9c n\u0103ng nh\u1eadn d\u1ea1ng v\u00e0 ph\u00e1t hi\u1ec7n khu\u00f4n m\u1eb7t t\u1eeb C\u00e0i \u0111\u1eb7t:<\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\"><img decoding=\"async\" src=\"https:\/\/dgzx.hkwp-content\/plugins\/UEditor-KityFormulaueditor\/ueditor\/themes\/default\/images\/spacer.gif\" title=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" alt=\"How to use ESP32-CAM to build a face recognition system\u63d2\u56fe\" \/><\/p>\n<p style=\"text-indent: 2em;\">\u0110\u1ec3 th\u1ef1c hi\u1ec7n nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t, tr\u01b0\u1edbc ti\u00ean b\u1ea1n c\u1ea7n \u0111\u0103ng k\u00fd khu\u00f4n m\u1eb7t c\u1ee7a m\u00ecnh. B\u1ea1n c\u00f3 th\u1ec3 \u0111\u0103ng k\u00fd khu\u00f4n m\u1eb7t m\u1edbi b\u1eb1ng c\u00e1ch nh\u1ea5p v\u00e0o t\u00f9y ch\u1ecdn &quot;\u0110\u0103ng k\u00fd khu\u00f4n m\u1eb7t&quot;. Ph\u1ea3i m\u1ea5t nhi\u1ec1u l\u1ea7n th\u1eed \u0111\u1ec3 l\u01b0u khu\u00f4n m\u1eb7t. Sau khi l\u01b0u khu\u00f4n m\u1eb7t, n\u00f3 s\u1ebd ph\u00e1t hi\u1ec7n khu\u00f4n m\u1eb7t l\u00e0 ch\u1ee7 th\u1ec3 0, gi\u1edd \u0111\u00e2y c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng l\u00e0m h\u1ec7 th\u1ed1ng an ninh b\u1eb1ng c\u00e1ch nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t.<\/p>\n<p style=\"text-indent: 2em;\">\u0110\u00e2y l\u00e0 c\u00e1ch m\u00f4-\u0111un camera ESP c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh d\u1ec5 d\u00e0ng \u0111\u1ec3 ph\u00e1t tr\u1ef1c tuy\u1ebfn video v\u00e0 nh\u1eadn d\u1ea1ng khu\u00f4n m\u1eb7t.<\/p>\n<p style=\"text-indent: 2em;\">#bao g\u1ed3m \u201cesp_camera.h\u201d<\/p>\n<p style=\"text-indent: 2em;\">#bao g\u1ed3m<\/p>\n<p style=\"text-indent: 2em;\">\/\/ C\u1ea3nh b\u00e1o!! H\u00e3y \u0111\u1ea3m b\u1ea3o b\u1ea1n ch\u1ecdn m\u00f4-\u0111un ESP32 Wrover,<\/p>\n<p style=\"text-indent: 2em;\">\/\/ ho\u1eb7c m\u1ed9t bo m\u1ea1ch kh\u00e1c c\u00f3 PSRAM \u0111\u01b0\u1ee3c k\u00edch ho\u1ea1t<\/p>\n<p style=\"text-indent: 2em;\">\/\/ Ch\u1ecdn m\u1ed9t m\u1eabu m\u00e1y \u1ea3nh<\/p>\n<p style=\"text-indent: 2em;\">\/\/# x\u00e1c \u0111\u1ecbnh CAMERA_MODEL_WROVER_KIT<\/p>\n<p style=\"text-indent: 2em;\">\/\/# x\u00e1c \u0111\u1ecbnh CAMERA_MODEL_ESP_EYE<\/p>\n<p style=\"text-indent: 2em;\">\/\/# x\u00e1c \u0111\u1ecbnh CAMERA_MODEL_M5STACK_PSRAM<\/p>\n<p style=\"text-indent: 2em;\">\/\/# x\u00e1c \u0111\u1ecbnh CAMERA_MODEL_M5STACK_WIDE<\/p>\n<p style=\"text-indent: 2em;\"># x\u00e1c \u0111\u1ecbnh CAMERA_MODEL_AI_THINKER<\/p>\n<p style=\"text-indent: 2em;\">#bao g\u1ed3m \u201ccamera_pins.h\u201d<\/p>\n<p style=\"text-indent: 2em;\">const char* ssid = &quot;Galaxy-M20 &quot;;<\/p>\n<p style=\"text-indent: 2em;\">const char* M\u1eadt kh\u1ea9u = &quot;ac312124&quot;;<\/p>\n<p style=\"text-indent: 2em;\">startCameraServer() kh\u00f4ng h\u1ee3p l\u1ec7;<\/p>\n<p style=\"text-indent: 2em;\">C\u00e0i \u0111\u1eb7t kh\u00f4ng h\u1ee3p l\u1ec7 () {<\/p>\n<p style=\"text-indent: 2em;\">S\u1ed1 s\u00ea-ri. B\u1eaft \u0111\u1ea7u (115200);<\/p>\n<p style=\"text-indent: 2em;\">Serial.setDebugOutput(\u0111\u00fang);<\/p>\n<p style=\"text-indent: 2em;\">S\u1ed1 s\u00ea-ri.println ();<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh camera_config_t;<\/p>\n<p style=\"text-indent: 2em;\">config. ledc_channel = LEDC_CHANNEL_0;<\/p>\n<p style=\"text-indent: 2em;\">config.ledc_timer = LEDC_TIMER_0;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pin_d0 = Y2_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pin_d1 = Y3_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pin_d2 = Y4_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pin_d3 = Y5_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pin_d4 = Y6_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pin_d5 = Y7_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pin_d6 = Y8_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pin_d7 = Y9_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">config.pin_xclk = XCLK_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pin_pclk = PCLK_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">config.pin_vsync = VSYNC_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">pin_href = HREF_GPIO_NUM; c\u1ea5u h\u00ecnh.pin_href = href_gPIo_num;<\/p>\n<p style=\"text-indent: 2em;\">pin_sscb_sda = SIOD_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">pin_sscb_scl = SIOC_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pin_pwdn = PWDN_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">pin_reset = \u0110\u1eb6T L\u1ea0I_GPIO_NUM;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.xclk_freq_hz = 20000000;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.pixel_format = PIXFORMAT_JPEG;<\/p>\n<p style=\"text-indent: 2em;\">\/\/ Kh\u1edfi t\u1ea1o v\u1edbi th\u00f4ng s\u1ed1 k\u1ef9 thu\u1eadt cao \u0111\u1ec3 ph\u00e2n b\u1ed5 tr\u01b0\u1edbc c\u00e1c b\u1ed9 \u0111\u1ec7m l\u1edbn h\u01a1n<\/p>\n<p style=\"text-indent: 2em;\">N\u1ebfu (psramFound ()) {<\/p>\n<p style=\"text-indent: 2em;\">config.frame_size = K\u00cdCH TH\u01af\u1edaC KHUNG_UXGA;<\/p>\n<p style=\"text-indent: 2em;\">config.jpeg_quality = 10;<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea5u h\u00ecnh.fb_count = 2;<\/p>\n<p style=\"text-indent: 2em;\">} kh\u00e1c {<\/p>\n<p style=\"text-indent: 2em;\">config.frame_size = K\u00cdCH TH\u01af\u1edaC KHUNG_SVGA;<\/p>\n<p style=\"text-indent: 2em;\">config.jpeg_quality = 12;<\/p>\n<p style=\"text-indent: 2em;\">config.fb_count = 1;<\/p>\n<p style=\"text-indent: 2em;\">}<\/p>\n<p style=\"text-indent: 2em;\"># N\u1ebfu \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh (CAMERA_MODEL_ESP_EYE)<\/p>\n<p style=\"text-indent: 2em;\">pinMode (13, INPUT_PULLUP);<\/p>\n<p style=\"text-indent: 2em;\">pinMode(14, \u0110\u1ea6U V\u00c0O_K\u00c9O);<\/p>\n<p style=\"text-indent: 2em;\"># trong tr\u01b0\u1eddng h\u1ee3p<\/p>\n<p style=\"text-indent: 2em;\">\/\/ Kh\u1edfi t\u1ea1o camera<\/p>\n<p style=\"text-indent: 2em;\">esp_err_t l\u1ed7i = esp_camera_init(&amp;config);<\/p>\n<p style=\"text-indent: 2em;\">N\u1ebfu (sai! = ESP_OK) {<\/p>\n<p style=\"text-indent: 2em;\">Serial.printf(&quot;Kh\u1edfi t\u1ea1o camera kh\u00f4ng th\u00e0nh c\u00f4ng, l\u1ed7i 0x%x&quot;, err);<\/p>\n<p style=\"text-indent: 2em;\">M\u1eb7t sau;<\/p>\n<p style=\"text-indent: 2em;\">}<\/p>\n<p style=\"text-indent: 2em;\">c\u1ea3m bi\u1ebfn_t * s = esp_camera_sensor_get();<\/p>\n<p style=\"text-indent: 2em;\">\/\/ C\u1ea3m bi\u1ebfn ban \u0111\u1ea7u \u0111\u01b0\u1ee3c l\u1eadt theo chi\u1ec1u d\u1ecdc v\u00e0 m\u00e0u s\u1eafc h\u01a1i b\u00e3o h\u00f2a<\/p>\n<p style=\"text-indent: 2em;\">n\u1ebfu (s-&gt;id.PID == OV3660_PID) {<\/p>\n<p style=\"text-indent: 2em;\">s-&gt;set_vflip(s, 1); \/\/ L\u1eadt ng\u01b0\u1ee3c l\u1ea1i<\/p>\n<p style=\"text-indent: 2em;\">s-&gt;set_brightness(s, 1); \/\/ T\u0103ng nh\u1eb9 \u0111\u1ed9 s\u00e1ng<\/p>\n<p style=\"text-indent: 2em;\">s-&gt;set_saturation(s, -2); \/\/ Gi\u1ea3m \u0111\u1ed9 b\u00e3o h\u00f2a<\/p>\n<p style=\"text-indent: 2em;\">}<\/p>\n<p style=\"text-indent: 2em;\">\/\/ Gi\u1ea3m k\u00edch th\u01b0\u1edbc khung h\u00ecnh \u0111\u1ec3 c\u00f3 t\u1ed1c \u0111\u1ed9 khung h\u00ecnh ban \u0111\u1ea7u cao h\u01a1n<\/p>\n<p style=\"text-indent: 2em;\">s-&gt;set_framesize(s, K\u00cdCH TH\u01af\u1edaC KHUNG H\u00ccNH_QVGA);<\/p>\n<p style=\"text-indent: 2em;\"># N\u1ebfu \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh (CAMERA_MODEL_M5STACK_WIDE)<\/p>\n<p style=\"text-indent: 2em;\">s-&gt;set_vflip(s, 1);<\/p>\n<p style=\"text-indent: 2em;\">s-&gt;set_hmirror(s, 1);<\/p>\n<p style=\"text-indent: 2em;\"># trong tr\u01b0\u1eddng h\u1ee3p<\/p>\n<p style=\"text-indent: 2em;\">WiFi.begin(ssid, m\u1eadt kh\u1ea9u);<\/p>\n<p style=\"text-indent: 2em;\">V\u00e0 (WiFi.status ()! = WL_CONNECTED) {<\/p>\n<p style=\"text-indent: 2em;\">Tr\u00ec ho\u00e3n (500);<\/p>\n<p style=\"text-indent: 2em;\">Serial.print(&quot;.&quot;);<\/p>\n<p style=\"text-indent: 2em;\">}<\/p>\n<p style=\"text-indent: 2em;\">S\u1ed1 s\u00ea-ri.println (&quot;&quot;);<\/p>\n<p style=\"text-indent: 2em;\">Serial.println(&quot;K\u1ebft n\u1ed1i WiFi &quot;);<\/p>\n<p style=\"text-indent: 2em;\">startCameraServer();<\/p>\n<p style=\"text-indent: 2em;\">Serial.print(&quot;M\u00e1y \u1ea3nh \u0111\u00e3 s\u1eb5n s\u00e0ng! S\u1eed d\u1ee5ng &#039;http:\/\/&quot;);<\/p>\n<p style=\"text-indent: 2em;\">Serial.print(WiFi.localIP());<\/p>\n<p style=\"text-indent: 2em;\">Serial.println(&quot;&#039; \u0111\u1ec3 k\u1ebft n\u1ed1i &quot;);<\/p>\n<p style=\"text-indent: 2em;\">}<\/p>\n<p style=\"text-indent: 2em;\">V\u00f2ng l\u1eb7p kh\u00f4ng h\u1ee3p l\u1ec7 () {<\/p>\n<p style=\"text-indent: 2em;\">\/\/ \u0110\u1eb7t m\u00e3 ch\u00ednh c\u1ee7a b\u1ea1n \u1edf \u0111\u00e2y v\u00e0 l\u1eb7p l\u1ea1i:<\/p>\n<p style=\"text-indent: 2em;\">Tr\u00ec ho\u00e3n (10000);<\/p>\n<p><\/p>\n<p style=\"text-indent: 2em;\"><\/p>","protected":false},"excerpt":{"rendered":"<p>There are many person recognition systems that use signatures, fingerprints, voice, hand geometry, face recognition, etc., to identify people, but there are no face recognition systems. Face recognition systems can be used not only for security purposes to identify people in public places, but also for attendance purposes in offices and schools. In this project, we will build a face recognition system using ESP32-CAM, which can also be used as an ESP32-CAM security system by recognizing the face of an unauthorized person. The ESP32-CAM is a very small camera module that uses the ESP32-S chip. Using the ESP32-CAM module, we can build a face recognition system without using any complex programming and any additional components. The AI-Thinker ESP32-CAM module features an ESP32-S chip, an ultra-small OV2640 camera and a micro SD card slot. The Micro SD card slot can be used to store images taken from the camera or to store files. The ESP32-CAM module can be used in a wide range of iot applications. It can be used as a face detection system in offices, schools, and other private areas, as well as for wireless surveillance, QR code wireless recognition, and many other iot applications. ESP32-CAM modules can be programmed using ESP-IDF or the Arduino IDE. The ESP32-CAM module also has several GPIO pins for connecting to external hardware. The ESP32-CAM does not have a USB connector, so to program the module, you need an FTDI board. Features: The smallest 802.11b\/g\/n Wi-Fi BT SoC module Low power 32-bit CPU that can also serve application processors Up to 160MHz clock speed, integrated computing power up to 600 DMIPS Built-in 520 KB SRAM, external 4MPSRAM Support UART\/SPI\/I2C\/PWM\/ADC\/DAC Supports OV2640 and OV7670 cameras with built-in flash Support image Wi-Fi upload TF card support Supports multiple sleep modes Embedded Lwip and FreeRTOS Support STA\/AP\/STA+AP operation mode Smart Config\/AirKiss technology is supported Support for local and remote firmware upgrades over serial ports (FOTA) Specifications: SPI flash: The default is 32Mbit Memory: 520KB SRAM+4M PSRAM TF card support: Max. 4G Supported interfaces: UART, SPI, I2C, PWM Image output format: JPEG, BMP, gray scale IO port: 9 Power supply range: 5V Required component ESP32-CAM FTDI Programmer Circuit schematic diagram To build the ESP32 CAM security camera, we only need the ESP32 camera module and FTDI programmer to program it. The ESP32-CAM does not have a USB connector, so you need an FTDI programmer to upload code to the ESP32-CAM, as shown in the image above. The Vcc and GND pins of the ESP32 are connected to the Vcc and GND pins of the FTDI board. The Tx and Rx of the ESP32 are connected to the Rx and Tx of the FTDI board. Note: Ground IO0 before uploading the code. IO0 determines whether the ESP32 is in blinking mode. When GPIO 0 is connected to GND, the ESP32 is in blinking mode. After programming the ESP32, I removed the FTDI board and connected the module to a 3.3V power supply using the 7805 regulator. The Settings for the ESP32 cam video stream are as follows: Install the ESP32 Board on the Arduino IDE Here the ESP32-CAM is programmed using the Arduino IDE. To do this, we have to install the ESP32 plug-in on the Arduino IDE. To install the ESP32 board in your Arduino IDE, go to File Preferences Now copy the following link and paste it into the &quot;Additional Board Manager URLs&quot; field, as shown below. Then, click the OK button: Now to the Board of Tools, the Board Manager Search for ESP32 in Board Manager and install &quot;ESP32 by Espressif Systems&quot;. ESP32 camera web server code We already have a sample code from ESP32 cam video streaming and face recognition. Open the ESP32 example using the &quot;File&quot; Examples &quot;ESP32&quot; Camera, then open the CameraWebServer example. Before uploading the code, you will need to enter your Wi-Fi name and password. const char* ssid = &quot;WiFi name&quot;; const char* Password = &quot;Password&quot;; Then define the ESP camera module. In the code, they define 5 camera modules, so uncomment &quot;CAMERA_MODEL_AI_THINKER&quot; and comment the remaining modules. Now the code is ready to upload. To upload the code, connect the FDTI board to your laptop and select &quot;ESP32 Wrover Module&quot; as your board. Also, change other Settings based on this image: Before uploading the code, press the ESP32 reset button and then click the Upload button. Note: If you encounter an error while uploading the code, check that IO0 is connected to GND and that you have selected the correct setting in the Tools menu. Disconnect the IO0 and GND pins after uploading the code. Then open the serial monitor and change the baud rate to 115200. Then press the ESP32 reset button and it will print the ESP IP address and port number on the serial monitor as shown below. Now to access the camera stream, navigate to your browser and enter your ESP IP address. It will take you to the streaming media page. To start an ESP32 cam video stream, click the &quot;Start Streaming&quot; button at the bottom of the page You can change the streaming quality by changing the &quot;resolution&quot; on the streaming page. You can also click the picture by clicking the &quot;Get Still&quot; button, but this code does not have the option to save the picture. After testing the video stream, now we will test the ESP32 cam face detection and recognition function. Turn on face recognition and detection from Settings: To do face recognition first, you need to register your face. You can register new faces by clicking on the &quot;Register Faces&quot; option. It takes several attempts to save face. After saving the face, it will detect the face as subject 0, which can now be used as a security system by recognizing the face. So this is how the ESP camera module can be easily configured for video streaming and facial recognition. #include \u201cesp_camera.h\u201d #include \/\/ Warning!! Make sure you select the ESP32 Wrover module, \/\/ or another board with<\/p>","protected":false},"author":5,"featured_media":11778,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[381],"tags":[389,388,382,376],"class_list":["post-11777","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledge","tag-esp32-cam","tag-ov2640","tag-camera","tag-camera-module"],"_links":{"self":[{"href":"https:\/\/dgzx.hk\/vi\/wp-json\/wp\/v2\/posts\/11777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dgzx.hk\/vi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dgzx.hk\/vi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dgzx.hk\/vi\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/dgzx.hk\/vi\/wp-json\/wp\/v2\/comments?post=11777"}],"version-history":[{"count":0,"href":"https:\/\/dgzx.hk\/vi\/wp-json\/wp\/v2\/posts\/11777\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dgzx.hk\/vi\/wp-json\/wp\/v2\/media\/11778"}],"wp:attachment":[{"href":"https:\/\/dgzx.hk\/vi\/wp-json\/wp\/v2\/media?parent=11777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dgzx.hk\/vi\/wp-json\/wp\/v2\/categories?post=11777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dgzx.hk\/vi\/wp-json\/wp\/v2\/tags?post=11777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}