forked from xiaozhi/xiaozhi-esp32
Support both ov2640 and ov3660 with esp_video (#1695)
* Support both ov2640 and ov3660 with esp_video * Use configuration to set up the use of cameras ov3660 and ov2640
This commit is contained in:
@@ -47,6 +47,28 @@ Component config -> ESP PSRAM -> SPI RAM config -> Mode (QUAD/OCT) -> Octal Mode
|
||||
Component config -> PHY -> (10)Max WiFi TX power (dBm)
|
||||
```
|
||||
|
||||
**配置摄像头:**
|
||||
|
||||
* **OV3660**
|
||||
```
|
||||
Component config -> Espressif Camera Sensors Configurations -> Camera Sensor Configuration -> Select and Set Camera Sensor -> OV3660 -> Auto detect OV3660
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
Component config -> Espressif Camera Sensors Configurations -> Camera Sensor Configuration -> Select and Set Camera Sensor -> OV3660 -> Select default output format for DVP interface (YUV422 240x240 24fps, DVP 8-bit, 20M input)
|
||||
```
|
||||
|
||||
* **OV2640**
|
||||
```
|
||||
Component config -> Espressif Camera Sensors Configurations -> Camera Sensor Configuration -> Select and Set Camera Sensor -> OV2640 -> Auto detect OV2640
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
Component config -> Espressif Camera Sensors Configurations -> Camera Sensor Configuration -> Select and Set Camera Sensor -> OV2640 -> Select default output format for DVP interface (YUV422 240x240 25fps, DVP 8-bit, 20M input)
|
||||
```
|
||||
|
||||
**编译:**
|
||||
|
||||
```bash
|
||||
|
||||
@@ -6,7 +6,13 @@
|
||||
"sdkconfig_append": [
|
||||
"CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=10",
|
||||
"CONFIG_ESP_PHY_MAX_TX_POWER=10",
|
||||
"CONFIG_SPIRAM_MODE_OCT=y"
|
||||
"CONFIG_SPIRAM_MODE_OCT=y",
|
||||
"CONFIG_CAMERA_OV2640=n",
|
||||
"CONFIG_CAMERA_OV2640_AUTO_DETECT_DVP_INTERFACE_SENSOR=y",
|
||||
"CONFIG_CAMERA_OV2640_DVP_YUV422_240X240_25FPS=y",
|
||||
"CONFIG_CAMERA_OV3660=y",
|
||||
"CONFIG_CAMERA_OV3660_AUTO_DETECT_DVP_INTERFACE_SENSOR=y",
|
||||
"CONFIG_CAMERA_OV3660_DVP_YUV422_240X240_24FPS=y"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "button.h"
|
||||
#include "config.h"
|
||||
#include "esp_video.h"
|
||||
#include "mcp_server.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include "led/gpio_led.h"
|
||||
#include <esp_log.h>
|
||||
@@ -71,7 +73,14 @@ class DfrobotEsp32S3AiCam : public WifiBoard {
|
||||
};
|
||||
|
||||
camera_ = new EspVideo(video_config);
|
||||
camera_->SetVFlip(1);
|
||||
|
||||
#if ( CONFIG_CAMERA_OV3660 )
|
||||
camera_->SetVFlip(true);
|
||||
camera_->SetHMirror(true);
|
||||
#elif ( CONFIG_CAMERA_OV2640 )
|
||||
camera_->SetVFlip(false);
|
||||
camera_->SetHMirror(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user