Skip to content

Commit 7c2f524

Browse files
committed
Update Example and adding new frame sizes
1 parent 176b0a3 commit 7c2f524

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

examples/CameraSettings.html

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102

103103
function populateFrameSizeDropdown() {
104104
const frameSizes = [
105-
"R96x96", "QQVGA", "CIF", "HQVGA", "R240x240", "QVGA",
106-
"CIF", "HVGA", "VGA", "SVGA", "XGA", "HD", "SXGA",
105+
"R96x96", "QQVGA", "128X128", "CIF", "HQVGA", "R240x240", "QVGA",
106+
"320X320","CIF", "HVGA", "VGA", "SVGA", "XGA", "HD", "SXGA",
107107
"UXGA", "FHD", "P_HD", "P_3MP", "QXGA", "QHD", "WQXGA", "P_FHD", "QSXGA"
108108
];
109109

@@ -133,7 +133,7 @@
133133
fetch('/get_sensor_name')
134134
.then(response => response.text())
135135
.then(sensorName => {
136-
const showSharpnessAndDenoise = (sensorName === 'OV3640' || sensorName === 'OV5640');
136+
const showSharpnessAndDenoise = (sensorName === 'OV3660' || sensorName === 'OV5640');
137137
document.getElementById('sharpness-container').classList.toggle('hidden', !showSharpnessAndDenoise);
138138
document.getElementById('denoise-container').classList.toggle('hidden', !showSharpnessAndDenoise);
139139
})
@@ -170,26 +170,29 @@ <h1>Micropython Camera Stream</h1>
170170
<select id="frame_size">
171171
<option value="0">R96x96</option>
172172
<option value="1">QQVGA</option>
173-
<option value="2">CIF</option>
174-
<option value="3">HQVGA</option>
175-
<option value="4">R240x240</option>
176-
<option value="5">QVGA</option>
177-
<option value="6">CIF</option>
178-
<option value="7">HVGA</option>
179-
<option value="8">VGA</option>
180-
<option value="9">SVGA</option>
181-
<option value="10">XGA</option>
182-
<option value="11">HD</option>
183-
<option value="12">SXGA</option>
184-
<option value="13">UXGA</option>
185-
<option value="14">FHD</option>
186-
<option value="15">P_HD</option>
187-
<option value="16">P_3MP</option>
188-
<option value="17">QXGA</option>
189-
<option value="18">QHD</option>
190-
<option value="19">WQXGA</option>
191-
<option value="20">P_FHD</option>
192-
<option value="21">QSXGA</option>
173+
<option value="2">128X128</option>
174+
<option value="3">QCIF</option>
175+
<option value="4">HQVGA</option>
176+
<option value="5">R240x240</option>
177+
<option value="6">QVGA</option>
178+
<option value="7">320X320</option>
179+
<option value="8">CIF</option>
180+
<option value="9">HVGA</option>
181+
<option value="10">VGA</option>
182+
<option value="11">SVGA</option>
183+
<option value="12">XGA</option>
184+
<option value="13">HD</option>
185+
<option value="14">SXGA</option>
186+
<option value="15">UXGA</option>
187+
<option value="16">FHD</option>
188+
<option value="17">P_HD</option>
189+
<option value="18">P_3MP</option>
190+
<option value="19">QXGA</option>
191+
<option value="20">QHD</option>
192+
<option value="21">WQXGA</option>
193+
<option value="22">P_FHD</option>
194+
<option value="23">QSXGA</option>
195+
<option value="24">5MP</option>
193196
</select>
194197
</div>
195198
<div class="setting">

src/modcamera.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,12 @@ const mp_rom_map_elem_t mp_camera_hal_pixel_format_table[] = {
315315
const mp_rom_map_elem_t mp_camera_hal_frame_size_table[] = {
316316
{ MP_ROM_QSTR(MP_QSTR_R96X96), MP_ROM_INT(FRAMESIZE_96X96) },
317317
{ MP_ROM_QSTR(MP_QSTR_QQVGA), MP_ROM_INT(FRAMESIZE_QQVGA) },
318+
{ MP_ROM_QSTR(MP_QSTR_R128x128), MP_ROM_INT(FRAMESIZE_128X128) },
318319
{ MP_ROM_QSTR(MP_QSTR_QCIF), MP_ROM_INT(FRAMESIZE_QCIF) },
319320
{ MP_ROM_QSTR(MP_QSTR_HQVGA), MP_ROM_INT(FRAMESIZE_HQVGA) },
320321
{ MP_ROM_QSTR(MP_QSTR_R240X240), MP_ROM_INT(FRAMESIZE_240X240) },
321322
{ MP_ROM_QSTR(MP_QSTR_QVGA), MP_ROM_INT(FRAMESIZE_QVGA) },
323+
{ MP_ROM_QSTR(MP_QSTR_R320X320), MP_ROM_INT(FRAMESIZE_320X320) },
322324
{ MP_ROM_QSTR(MP_QSTR_CIF), MP_ROM_INT(FRAMESIZE_CIF) },
323325
{ MP_ROM_QSTR(MP_QSTR_HVGA), MP_ROM_INT(FRAMESIZE_HVGA) },
324326
{ MP_ROM_QSTR(MP_QSTR_VGA), MP_ROM_INT(FRAMESIZE_VGA) },

src/modcamera.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ extern const mp_rom_map_elem_t mp_camera_hal_pixel_format_table[5];
201201
* @brief Table mapping frame sizes API to their corresponding values at HAL.
202202
* @details Needs to be defined in the port-specific implementation.
203203
*/
204-
extern const mp_rom_map_elem_t mp_camera_hal_frame_size_table[22];
204+
extern const mp_rom_map_elem_t mp_camera_hal_frame_size_table[24];
205205

206206
/**
207207
* @brief Table mapping gainceiling API to their corresponding values at HAL.

0 commit comments

Comments
 (0)