Rotated the displayed image because camera is in the back of the TTGO

This commit is contained in:
Joachim
2020-08-26 11:16:41 +02:00
parent dd2f5f0ca8
commit d2ea7d585c
2 changed files with 10 additions and 7 deletions

View File

@ -41,17 +41,20 @@ void demo_task(void *arg) {
disp_infos();
while(true) {
auto start = esp_timer_get_time();
camera_fb_t *fb = esp_camera_fb_get();
if (!fb) {
ESP_LOGE(TAG, "Camera capture failed");
} else {
TFT_jpg_image(CENTER, 0, 0, -1, NULL, fb->buf, fb->len);
TFT_jpg_image(CENTER, CENTER, 0, -1, NULL, fb->buf, fb->len);
esp_camera_fb_return(fb);
fb = NULL;
}
ESP_LOGI(TAG, "time taken: %lld ms", (esp_timer_get_time() - start) / 1000);
#if 0 // TODO: next step..
Mat inputImage(fb->height, fb->width, CV_8UC2, fb->buf); // rgb565 is 2 channels of 8-bit unsigned
Mat outputImage;
@ -103,6 +106,8 @@ void app_main()
/* Display memory infos */
disp_infos();
ESP_LOGI(TAG, "Display width = %d, height = %d", tft->width(), tft->height());
/* Start the tasks */
xTaskCreatePinnedToCore(demo_task, "demo", 1024 * 9, nullptr, 24, nullptr, 0);
}