Skip to content

Commit 3957ca7

Browse files
committed
Merge branch 'develop'
2 parents a23f3dd + be87e97 commit 3957ca7

9 files changed

+2053
-890
lines changed

README.en.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22

33
[日本語](README.md)
44

5-
<img src="https://user-images.githubusercontent.com/26270227/239725404-c5dd33c4-c511-4d05-a192-3d184ef4de8b.png" width="480">
5+
<img src="https://user-images.githubusercontent.com/26270227/239725404-c5dd33c4-c511-4d05-a192-3d184ef4de8b.png" width="320"><img src="https://github.com/GOB52/M5StackCoreS3_CameraWebServer/assets/26270227/fb2e7edb-c2fe-4caf-b585-b2f6728df559" width="320">
6+
67

78
## Overview
89
Porting of [espressif/arduino-esp32](https://github.com/espressif/arduino-esp32) example [CameraWebServer](https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/Camera/CameraWebServer) to M5Stack CoreS3 (GC0308).
9-
Access CoreS3 from a browser via WiFi to control the camera and receive streaming.
10-
10+
Access CoreS3 from a browser via WiFi to control the camera and receive streaming.
11+
It can also perform QR recognition.
1112

12-
## Required libraries
13+
## Required
1314
* [M5Unified](https://github.com/m5stack/M5Unified)
14-
* [es32-camera](https://github.com/espressif/esp32-camera/tree/master)
15-
However, If you set platform = espressif32 and framework = arduino in platformio, esp32-camera is included in the package, so you do not need to specify es32-camera in lib_deps.
15+
* [esp32-camera](https://github.com/espressif/esp32-camera/tree/master)
16+
However, If you set platform = espressif32 and framework = arduino in platformio, esp32-camera is included in the package, so you do not need to specify esp32-camera in lib_deps.
1617
* [gob_GC0308](https://github.com/GOB52/gob_GC0308)
1718
* WiFi connection available
1819

1920
## Build type
2021
|Env|Description|
2122
|---|---|
22-
|release|Basic settings|
23-
|release_face|Support dace detection and recognition|
23+
|release|Basic settings and QR recognition|
24+
|release_face|Support face detection and recognition|
2425

2526
## How to use
2627
Once executed, the IP address will be displayed on the screen and on the serial monitor.
@@ -49,6 +50,8 @@ Please save the credential in some way or rewrite the source.
4950
The currently set camera resolution is displayed. The resolution cannot be changed.
5051
* Contrast
5152
Change the contrast.
53+
* Saturation
54+
Change the saturation.
5255
* Special Effect
5356
Change the special effect.
5457

@@ -95,6 +98,8 @@ Start/Stop receiving stream.
9598
* Enroll Face
9699
Enroll the face on the camera.
97100
Once enrolled, the face will no longer be treated as an intruder (red frame) if Face Recogintion is ON.
101+
* Start/Stop Scan QR
102+
Start/Stop recognize QR code.
98103

99104
* Save
100105
Download incoming images.
@@ -112,3 +117,4 @@ Refer to data sheets and other sources for register and function information.
112117
* M5Unified base to work.
113118
* Modified html for GC0308.
114119
* Functions not present in GC0308 were omitted.
120+
* Add QR code recognition.

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,28 @@
22

33
[English](README.en.md)
44

5-
<img src="https://user-images.githubusercontent.com/26270227/239725404-c5dd33c4-c511-4d05-a192-3d184ef4de8b.png" width="480">
5+
<img src="https://user-images.githubusercontent.com/26270227/239725404-c5dd33c4-c511-4d05-a192-3d184ef4de8b.png" width="320"><img src="https://github.com/GOB52/M5StackCoreS3_CameraWebServer/assets/26270227/fb2e7edb-c2fe-4caf-b585-b2f6728df559" width="320">
6+
67

78
## 概要
89
[espressif/arduino-esp32](https://github.com/espressif/arduino-esp32)[CameraWebServer](https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/Camera/CameraWebServer) を M5Stack CoreS3 向けに移植した物です。
9-
WiFi 経由でブラウザから CoreS3 へアクセスし、カメラの制御とストリーミング受信を行います。
10+
WiFi 経由でブラウザから CoreS3 へアクセスし、カメラの制御とストリーミング受信を行います。
11+
QR 識別も行えます。
1012

1113

1214
## 必要な物
1315
* [M5Unified](https://github.com/m5stack/M5Unified)
14-
* [es32-camera](https://github.com/espressif/esp32-camera/tree/master)
16+
* [esp32-camera](https://github.com/espressif/esp32-camera/tree/master)
1517
platformio で platform = espressif32, framework = arduino なら同梱なので必要無し
1618
* [gob_GC0308](https://github.com/GOB52/gob_GC0308)
1719
* WiFi 接続可能な環境
1820

1921
## ビルド種別
2022
|Env|説明|
2123
|---|---|
22-
|release|基本設定|
24+
|release|基本設定と QR 識別|
2325
|release_face|顔検出、認識あり|
2426

25-
2627
## 使い方
2728
実行すると、画面とシリアルモニタに接続先 IP アドレスが表示されます。
2829
下記は例なので実際は環境によって IP は異なります
@@ -50,6 +51,8 @@ platformio で platform = espressif32, framework = arduino なら同梱なので
5051
現在設定されているカメラの解像度を表示しています。解像度変更はできません。
5152
* Contrast
5253
コントラストを変更します。
54+
* Saturation
55+
彩度を変更します。
5356
* Special Effect
5457
エフェクトをかけます。
5558

@@ -97,6 +100,8 @@ platformio で platform = espressif32, framework = arduino なら同梱なので
97100
* Enroll Face
98101
カメラに写っている顔を登録します。
99102
登録すると Face Recogintion ON の時に侵入者(赤枠)扱いになりません。
103+
* Start/Stop Scan QR
104+
QR 識別の開始/終了。
100105

101106
* Save
102107
受信画像をダウンロードします。
@@ -114,4 +119,5 @@ platformio で platform = espressif32, framework = arduino なら同梱なので
114119
* M5Unified ベースで動作するようにした。
115120
* GC0308 用に html を修正した。
116121
* GC0308 に無い機能を割愛した。
122+
* QR 識別機能を追加した
117123

html/index_gc0308.html

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,23 @@
405405
<option value="0">96x96</option>
406406
</select>
407407
</div>
408-
<div class="input-group" id="contrast-group">
408+
409+
<hr style="width:75%">
410+
411+
<div class="input-group" id="contrast-group">
409412
<label for="contrast">Contrast</label>
410413
<div class="range-min">-2</div>
411414
<input type="range" id="contrast" min="0" max="127" value="64" class="default-action">
412415
<div class="range-max">2</div>
413416
</div>
414417

418+
<div class="input-group" id="saturation-group">
419+
<label for="saturation">Saturation</label>
420+
<div class="range-min">0</div>
421+
<input type="range" id="saturation" min="0" max="255" value="64" class="default-action">
422+
<div class="range-max">255</div>
423+
</div>
424+
415425
<div class="input-group" id="special_effect-group">
416426
<label for="special_effect">Special Effect</label>
417427
<select id="special_effect" class="default-action">
@@ -464,9 +474,13 @@
464474
<label class="slider" for="colorbar"></label>
465475
</div>
466476
</div>
467-
<section id="buttons">
477+
478+
<hr style="width:75%">
479+
480+
<section id="buttons">
468481
<button id="get-still">Get Still</button>
469482
<button id="toggle-stream">Start Stream</button>
483+
<button id="toggle-qr">Start Scan QR</button>
470484
<!-- <button id="face_enroll" class="disabled" disabled="disabled">Enroll Face</button> -->
471485
</section>
472486

@@ -773,6 +787,7 @@
773787
const viewContainer = document.getElementById('stream-container')
774788
const stillButton = document.getElementById('get-still')
775789
const streamButton = document.getElementById('toggle-stream')
790+
const qrButton = document.getElementById('toggle-qr')
776791
const closeButton = document.getElementById('close-stream')
777792
const saveButton = document.getElementById('save-still')
778793
const ledGroup = document.getElementById('led-group')
@@ -788,15 +803,29 @@
788803
streamButton.innerHTML = 'Stop Stream'
789804
}
790805

806+
const stopQR = () => {
807+
window.stop();
808+
qrButton.innerHTML = 'Start Scan QR'
809+
}
810+
811+
const startQR = () => {
812+
view.src = `${streamUrl}/qr`
813+
show(viewContainer)
814+
qrButton.innerHTML = 'Stop Scan QR'
815+
}
816+
817+
791818
// Attach actions to buttons
792819
stillButton.onclick = () => {
793820
stopStream()
821+
stopQR();
794822
view.src = `${baseHost}/capture?_cb=${Date.now()}`
795823
show(viewContainer)
796824
}
797825

798826
closeButton.onclick = () => {
799827
stopStream()
828+
stopQR();
800829
hide(viewContainer)
801830
}
802831

@@ -805,10 +834,21 @@
805834
if (streamEnabled) {
806835
stopStream()
807836
} else {
837+
stopQR();
808838
startStream()
809839
}
810840
}
811841

842+
qrButton.onclick = () => {
843+
const qrEnabled = qrButton.innerHTML === 'Stop Scan QR'
844+
if (qrEnabled) {
845+
stopQR()
846+
} else {
847+
stopStream()
848+
startQR()
849+
}
850+
}
851+
812852
saveButton.onclick = () => {
813853
var canvas = document.createElement("canvas");
814854
canvas.width = view.width;

0 commit comments

Comments
 (0)