Skip to content

Commit

Permalink
Update Example and adding new frame sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
cnadler86 committed Dec 5, 2024
1 parent 176b0a3 commit 7c2f524
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
49 changes: 26 additions & 23 deletions examples/CameraSettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@

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

Expand Down Expand Up @@ -133,7 +133,7 @@
fetch('/get_sensor_name')
.then(response => response.text())
.then(sensorName => {
const showSharpnessAndDenoise = (sensorName === 'OV3640' || sensorName === 'OV5640');
const showSharpnessAndDenoise = (sensorName === 'OV3660' || sensorName === 'OV5640');
document.getElementById('sharpness-container').classList.toggle('hidden', !showSharpnessAndDenoise);
document.getElementById('denoise-container').classList.toggle('hidden', !showSharpnessAndDenoise);
})
Expand Down Expand Up @@ -170,26 +170,29 @@ <h1>Micropython Camera Stream</h1>
<select id="frame_size">
<option value="0">R96x96</option>
<option value="1">QQVGA</option>
<option value="2">CIF</option>
<option value="3">HQVGA</option>
<option value="4">R240x240</option>
<option value="5">QVGA</option>
<option value="6">CIF</option>
<option value="7">HVGA</option>
<option value="8">VGA</option>
<option value="9">SVGA</option>
<option value="10">XGA</option>
<option value="11">HD</option>
<option value="12">SXGA</option>
<option value="13">UXGA</option>
<option value="14">FHD</option>
<option value="15">P_HD</option>
<option value="16">P_3MP</option>
<option value="17">QXGA</option>
<option value="18">QHD</option>
<option value="19">WQXGA</option>
<option value="20">P_FHD</option>
<option value="21">QSXGA</option>
<option value="2">128X128</option>
<option value="3">QCIF</option>
<option value="4">HQVGA</option>
<option value="5">R240x240</option>
<option value="6">QVGA</option>
<option value="7">320X320</option>
<option value="8">CIF</option>
<option value="9">HVGA</option>
<option value="10">VGA</option>
<option value="11">SVGA</option>
<option value="12">XGA</option>
<option value="13">HD</option>
<option value="14">SXGA</option>
<option value="15">UXGA</option>
<option value="16">FHD</option>
<option value="17">P_HD</option>
<option value="18">P_3MP</option>
<option value="19">QXGA</option>
<option value="20">QHD</option>
<option value="21">WQXGA</option>
<option value="22">P_FHD</option>
<option value="23">QSXGA</option>
<option value="24">5MP</option>
</select>
</div>
<div class="setting">
Expand Down
2 changes: 2 additions & 0 deletions src/modcamera.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,12 @@ const mp_rom_map_elem_t mp_camera_hal_pixel_format_table[] = {
const mp_rom_map_elem_t mp_camera_hal_frame_size_table[] = {
{ MP_ROM_QSTR(MP_QSTR_R96X96), MP_ROM_INT(FRAMESIZE_96X96) },
{ MP_ROM_QSTR(MP_QSTR_QQVGA), MP_ROM_INT(FRAMESIZE_QQVGA) },
{ MP_ROM_QSTR(MP_QSTR_R128x128), MP_ROM_INT(FRAMESIZE_128X128) },
{ MP_ROM_QSTR(MP_QSTR_QCIF), MP_ROM_INT(FRAMESIZE_QCIF) },
{ MP_ROM_QSTR(MP_QSTR_HQVGA), MP_ROM_INT(FRAMESIZE_HQVGA) },
{ MP_ROM_QSTR(MP_QSTR_R240X240), MP_ROM_INT(FRAMESIZE_240X240) },
{ MP_ROM_QSTR(MP_QSTR_QVGA), MP_ROM_INT(FRAMESIZE_QVGA) },
{ MP_ROM_QSTR(MP_QSTR_R320X320), MP_ROM_INT(FRAMESIZE_320X320) },
{ MP_ROM_QSTR(MP_QSTR_CIF), MP_ROM_INT(FRAMESIZE_CIF) },
{ MP_ROM_QSTR(MP_QSTR_HVGA), MP_ROM_INT(FRAMESIZE_HVGA) },
{ MP_ROM_QSTR(MP_QSTR_VGA), MP_ROM_INT(FRAMESIZE_VGA) },
Expand Down
2 changes: 1 addition & 1 deletion src/modcamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ extern const mp_rom_map_elem_t mp_camera_hal_pixel_format_table[5];
* @brief Table mapping frame sizes API to their corresponding values at HAL.
* @details Needs to be defined in the port-specific implementation.
*/
extern const mp_rom_map_elem_t mp_camera_hal_frame_size_table[22];
extern const mp_rom_map_elem_t mp_camera_hal_frame_size_table[24];

/**
* @brief Table mapping gainceiling API to their corresponding values at HAL.
Expand Down

0 comments on commit 7c2f524

Please sign in to comment.