-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect frame width and height returned by esp_camera_fb_get() when using sensor->set_res_raw() #669
Comments
While this bug remains outstanding it is possible to patch the erroneous width/height in the camera buffer as the following code demonstrates:
Example output: Note that the JPEGDEC library is not now required. The fix code just uses the esp_jpg_decode already present in the driver. |
Using sensor->set_res_raw allows a custom image size/offset to be specified allowing e.g. a square JPEG to be returned by esp_camera_fb_get(). However, the implementation of esp_camera_fb_get (lines 369-370) sets frame.width and frame.height by indexing into the resolution[] array which is not always appropriate.
It should return the actual width and height of the returned JPEG to simplify further image processing.
Steps to reproduce. Run this sketch (configured for ESP32S3 XIAO):
Example output:
[ 4927][I][SetResRawBug.ino:71] loop(): Driver: Width=1600 Height=1200
[ 4934][I][SetResRawBug.ino:73] loop(): JPEGDEC: Width=1200 Height=1200
The text was updated successfully, but these errors were encountered: