Skip to content

Commit

Permalink
chore: Decrese cam jpeg quality to 12
Browse files Browse the repository at this point in the history
  • Loading branch information
becem-gharbi committed Oct 27, 2023
1 parent ef876d5 commit b324a30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,16 @@ <h2>ESP32 Object detection with Edge Impulse</h2>
const captureBtn = document.getElementById('capture-btn')
const camImg = document.getElementById("cam-img");

// Create a canvas element
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");

// Set the canvas size to match the image dimensions
canvas.width = camImg.width;
canvas.height = camImg.height;

captureBtn.addEventListener("click", () => {
// Draw the image onto the canvas
ctx.drawImage(camImg, 0, 0);

canvas.toBlob(blob => { saveAs(blob, "image.jpg") })
canvas.toBlob(blob => { saveAs(blob, "capture.jpg") })
})

</script>
Expand Down
2 changes: 1 addition & 1 deletion src/ei_cam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ bool EICam::_initCam()
.pixel_format = PIXFORMAT_JPEG, // YUV422,GRAYSCALE,RGB565,JPEG
.frame_size = FRAMESIZE_QVGA, // QQVGA-UXGA Do not use sizes above QVGA when not JPEG

.jpeg_quality = 10, // 0-63 lower number means higher quality
.jpeg_quality = 12, // 0-63 lower number means higher quality
.fb_count = 1, // if more than one, i2s runs in continuous mode. Use only with JPEG
.grab_mode = CAMERA_GRAB_WHEN_EMPTY,
};
Expand Down

0 comments on commit b324a30

Please sign in to comment.