Skip to content

Commit 221d4e7

Browse files
authored
feat: support camera image rotation (#1370)
1 parent bcddbbd commit 221d4e7

File tree

4 files changed

+416
-101
lines changed

4 files changed

+416
-101
lines changed

main/Kconfig.projbuild

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,8 @@ config RECEIVE_CUSTOM_MESSAGE
672672
menu "Camera Configuration"
673673
depends on !IDF_TARGET_ESP32
674674

675+
comment "Warning: Please read the help text before modifying these settings."
676+
675677
config XIAOZHI_ENABLE_HARDWARE_JPEG_ENCODER
676678
bool "Enable Hardware JPEG Encoder"
677679
default y
@@ -693,12 +695,35 @@ menu "Camera Configuration"
693695
depends on !CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER
694696
help
695697
This option treats the camera buffer as a uint16_t[] array and performs byte-swapping (endianness conversion) on each element.
696-
698+
697699
Should only be modified by development board integration engineers.
698-
700+
699701
**Incorrect usage may result in incorrect image colors!**
700-
702+
701703
ATTENTION: If the option CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER is available for your sensor, please use that instead.
704+
705+
menuconfig XIAOZHI_ENABLE_ROTATE_CAMERA_IMAGE
706+
bool "Enable Camera Image Rotation"
707+
default n
708+
help
709+
Enable camera image rotation, rotate the camera image to the correct orientation.
710+
- On ESP32-P4, rotation is handled by PPA hardware.
711+
- On other chips, rotation is done in software with performance cost.
712+
- For 180° rotation, use HFlip + VFlip instead of this option.
713+
714+
if XIAOZHI_ENABLE_ROTATE_CAMERA_IMAGE
715+
choice XIAOZHI_CAMERA_IMAGE_ROTATION_ANGLE
716+
prompt "Camera Image Rotation Angle (clockwise)"
717+
default XIAOZHI_CAMERA_IMAGE_ROTATION_ANGLE_90
718+
help
719+
Camera image rotation angle.
720+
config XIAOZHI_CAMERA_IMAGE_ROTATION_ANGLE_90
721+
bool "90°"
722+
config XIAOZHI_CAMERA_IMAGE_ROTATION_ANGLE_270
723+
bool "270°"
724+
comment "For 180° rotation, use HFlip + VFlip instead of this option"
725+
endchoice
726+
endif
702727
endmenu
703728

704729
menu "TAIJIPAI_S3_CONFIG"

0 commit comments

Comments
 (0)