Skip to content
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

feat(hardware): Support camera model OV5640 + Enhanced digital zoom #189

Merged
merged 11 commits into from
Nov 14, 2024

Conversation

Slider0007
Copy link
Owner

@Slider0007 Slider0007 commented Nov 11, 2024

1. Add support of camera model OV5640 (5MP)

  • Plug'n'play exchangeable with OV2640 using with supported boards
  • ⚠️ A heatsink or any heat dissipation is recommended to ensure constant image quality
  • Powering the device with:
    • ⚠️ ESP32CAM: Deviation of core + I/O voltage supply (board: 1.2V / 3.3V, camera: 1.5V / 2.8V [max: 3.0V, abs. max. rating: 4.5V]) --> No issues while testing
    • XIAO ESP32S3 Sense: Small deviation of core voltage supply (board: 1.3V, camera: 1.5V) --> No issues while testing
  • Notes:
    • Autofocus is not supported
    • Power consumption is higher than OV2640 model

2. Enhance the existing two mode zoom functionality to a fully free configurable zoom functionality using a wider and more finely adjustable zoom

(Inspired from jomjol#3063, thanks to jasaw and SybexX)

  • Working principle:
    • The image is captured with the required image resolution derived from configured zoom factor and then scaled down to the resulting working image size of 640x480 which is still kept the same (limited due to RAM restrictions of ESP32). By using the already existing X and Y offset values the visualized zoomed image window can be adjusted. The whole processing of the zoom functionality (windowing and scaling) is done by the camera itself.
  • Available zoom factor (default: 1.0x):
    • OV2640: 1.0x - 2.5x
    • OV5640: 1.0x - 4.0x

⚠️ BREKAING CHANGES

Removed functionality:

  • Image size adjustment from 640 x 40 -> 320 x 240
    This functionality is removed mainly to reduce complexity and because it does not provide any advantage anymore. The device is capable to be operated with 640 x 480.
  • Flip image frame size: (640 x 480 -> 480 x 640)
    This functionality is removed mainly to reduce complexity. It's benefitial to mount the camera that way that all relevant information are visible in the image area without software adjustment (e.g. if benefitial, mount the camera mechanically rotated by 90 degree) and zoom to interested area of the image.
    image
  • Remove automatic sharpness handling for OV2640. It's not officially supported anyway. If sharpness adjustment is required, it still can be adjusted manually. Now it's aligned with OV5640 which also offer manual adjustment only.

Further changes

feat(camera control)!: Enhance two step digital zoom to a free and more finely adjustable zoom
refactor(camera): Refactor camera control and take image class


Usage statistics

Usage before (based on ESP32):
RAM: [= ] 14.1% (used 46272 bytes from 327680 bytes)
Flash: [========= ] 87.3% (used 1697765 bytes from 1945600 bytes)

Usage after:
RAM: [= ] 14.3% (used 46972 bytes from 327680 bytes)
Flash: [========= ] 87.8% (used 1708201 bytes from 1945600 bytes)

@Slider0007 Slider0007 closed this Nov 11, 2024
@Slider0007 Slider0007 deleted the test-cam branch November 11, 2024 15:55
@Slider0007 Slider0007 restored the test-cam branch November 11, 2024 15:56
@Slider0007 Slider0007 reopened this Nov 11, 2024
@Slider0007 Slider0007 merged commit 7038293 into develop Nov 14, 2024
10 checks passed
@Slider0007 Slider0007 deleted the test-cam branch November 17, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant